htmlajax
htmlajax

Reputation: 71

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

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

Upvotes: 7

Views: 3507

Answers (3)

Simon
Simon

Reputation: 177

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

Upvotes: 0

Aquarius Power
Aquarius Power

Reputation: 3985

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

Upvotes: 1

ephemient
ephemient

Reputation: 204718

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

Upvotes: 1

Related Questions