#!/bin/sh ### # TITLE: # icewm_minimize_all ### # DESCRIPTION: # a quick X11/icesh based hack that offers this 'minimize all windows # on a desktop' feature also for MouseSlaves. ### # USAGE: # Set yourself a button whether you wanna have this thing as a shortcut # to this script. Whenever you will hit that button, this script will # execute and will toggle minimize/restore state of all the windows in # the current desktop. ### # BUGS: # - this script will not succeed to (un)minimize windows unless # it has some window that is currently focused # - after minimization a mouse click is necessary to re-enable full # keyboard based 'navigation' (anyway, MouseSlaves will never notice it) ### # AUTHOR: # Marius FERARU (altblue@n0i.net) ### # LICENSE: # whatever GPL like version you want. ;-] x11gp() { res=$(xprop -id $1 -notype '=$0+\n' $2) [ $? -eq 0 ] && echo $res | cut -d= -f2 } ## my *** icesh version doesn't support "focus" as special WinID WID=$(xdpyinfo | grep ^focus | sed -e 's/.*window //' -e 's/,.*//') WCD=$(x11gp $WID _NET_WM_DESKTOP) for cl in $(xlsclients -l |sed -n 's/^Window \(.\+\):/\1/ p') ; do wd=$(x11gp $cl _NET_WM_DESKTOP) if [ -n "$wd" ] ; then [ $wd -eq $WCD ] && icesh -window $cl toggleState 2 fi done