From 569a135445c616a2c24bfd5e0f2107cbe4ac3af3 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Mon, 26 Dec 2016 22:50:42 +0100 Subject: [PATCH] Added window geometry getter --- src/Window.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Window.php b/src/Window.php index 2a3e5a7..5f5fed4 100644 --- a/src/Window.php +++ b/src/Window.php @@ -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}");