Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Code to minimize all the windows in Linux
#!/bin/bash
new_window_id=`xprop -root | grep '_NET_ACTIVE_WINDOW(WINDOW)'| cut -d '#' -f 2`
old_window_id=""
close_wait=0
while [ $close_wait -le 10 ]
do
if [ "$old_window_id" = "$new_window_id" ]
then
close_wait=$(($close_wait+1))
else
close_wait=0
xwit -id $new_window_id -iconify
fi
old_window_id=$new_window_id
new_window_id=`xprop -root | grep '_NET_ACTIVE_WINDOW(WINDOW)'| cut -d '#' -f 2`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment