7

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

2
  • 1
    Which window manager are you using? Commented Oct 30, 2010 at 3:09
  • The default windows manager for Ubuntu Commented Oct 30, 2010 at 3:18

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

2 Comments

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).
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.
1
if xwininfo -all -id $windowIdGoHere |grep "Hidden"; then
  echo "is hidden"
fi

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.