4 Commits
0.1.0 ... 0.1.2

View File

@ -99,12 +99,35 @@ class Window
return false;
}
public function getWindowGeometry()
{
exec("xdotool getwindowgeometry --shell {$this->windowId}", $output, $status);
$ret = [];
foreach ($output as $line) {
list($k,$v) = explode("=",$line,2);
$ret[strtolower($k)]=$v;
}
return (object)$ret;
}
public function setWindowSize($width, $height)
{
exec("xdotool windowsize {$this->windowId} {$width} {$height}");
return $this;
}
public function windowMinimize()
{
exec("xdotool windowminimize {$this->windowId}");
return $this;
}
public function windowRestore()
{
exec("xdotool windowmap {$this->windowId} windowraise {$this->windowId}");
return $this;
}
public function dump()
{
$size = $this->getWindowSize();