开发者

How can you check if a window is minimized via the terminal in linux

开发者 https://www.devze.com 2023-01-22 11:08 出处:网络
How c开发者_运维知识库an you check if a window is minimized via the terminal in linux? xwininfo -name \'Window Title\' | grep \'Map State:\'

How c开发者_运维知识库an you check if a window is minimized via the terminal in linux?


xwininfo -name 'Window Title' | grep 'Map State:'

Look for IsViewable versus IsUnMapped; these come from the map_state field returned by XGetWindowAttributes.

(At least, that works with traditional window managers; I don't know if Compiz does screwy stuff to allow for thumbnailing minimized windows.)


if xwininfo -all -id $windowIdGoHere |grep "Hidden"; then
  echo "is hidden"
fi


[ $(xwininfo -id 0x60001d -all | awk '/Maximized/{print}' | wc -l) -eq 2 ] && echo Maximized

where 0x60001d is window ID. See xwininfo -h for other ways to identify a window for testing.

0

精彩评论

暂无评论...
验证码 换一张
取 消