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

妖精的绣舞 提交于 2019-12-23 09:04:43

问题


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


回答1:


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.)




回答2:


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



回答3:


[ $(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.



来源:https://stackoverflow.com/questions/4057078/how-can-you-check-if-a-window-is-minimized-via-the-terminal-in-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!