Take the 2-minute tour ×

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

share|improve this question
Which window manager are you using? –  meagar Oct 30 '10 at 3:09
The default windows manager for Ubuntu –  htmlajax Oct 30 '10 at 3:18
Looks like it is Compiz –  htmlajax Oct 30 '10 at 3:21
add comment

2 Answers

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

share|improve this answer
It won't work with Enlightenment (e17), where the map_state seems to be always IsViewable (this is a feature, which allows for instance screen captures of hidden windows). –  Skippy le Grand Gourou Oct 1 '13 at 13:55
Doesn't work either on Ubuntu 13.04 with Compiz. The result for some window is Map State: IsViewable, for others is Map State: IsUnMapped, but this field seems not related to the actual visibility (normal or minimized) of a window. –  Avio Nov 18 '13 at 14:09
add comment
if xwininfo -all -id $windowIdGoHere |grep "Hidden"; then
  echo "is hidden"
share|improve this answer
add comment

Your Answer


