Added window geometry getter

This commit is contained in:
Chris 2016-12-26 22:50:42 +01:00
parent a8ccaca28a
commit 569a135445
1 changed files with 11 additions and 0 deletions

View File

@ -99,6 +99,17 @@ 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}");