Code: Select all
rox -D /
EDIT 1
On special request and in all its ugliness, the code to close all ROX windows on the current desktop at once:
Code: Select all
D=$(xprop -root _NET_CURRENT_DESKTOP);D=${D##* };R=$(echo -n "`wmctrl -lx`" | awk -F"[ .]+" '{if ($2=='$D' && $3=="ROX-Filer") print $1}');for i in $R;do wmctrl -ic $i;done
EDIT 2
This closes <any program> windows on all desktops at once.
The active window determines the windows to close. E.g if the currently active window belongs to the program mtPaint, this window and all other mtPaint windows will be closed.
Code: Select all
#!/bin/sh
ACTIVE_WID="$(xprop -root | sed -n 's/^_NET_ACTIVE_WINDOW(WINDOW): window id # //p')"
ACTIVE_WNAME="$(xprop -id $ACTIVE_WID | sed -n 's/^.*WM_CLASS(STRING) = "//p' | sed 's/".*$//')"
Xdialog --yesno "Close all $ACTIVE_WNAME windows on ALL desktops?" 0 0 || exit
R=$(echo -n "`wmctrl -lx`" | awk -F"[ .]+" '{if ($3=="'"$ACTIVE_WNAME"'") print $1}')
for i in $R;do wmctrl -ic $i;done
Edit 2 needed some code cleaning, so I made a version that might even be useful. This will let the user close all windows of a given application, either those on the a) current desktop b) all desktops excluding the current or c) all desktops:
Code: Select all
#!/bin/bash
AI=$(xprop -root _NET_ACTIVE_WINDOW) ;AI=${AI##* } # Active Window ID
AN=$(xprop -id $AI WM_CLASS);AN=${AN#*\"};AN=${AN%%\"*} # Active Window Name
AD=$(xprop -root _NET_CURRENT_DESKTOP) ;AD=${AD##* } # Active Desktop No. (base 0)
RC=$(wmctrl -lx|awk -F"[ .]+" '{if ($2=='$AD' && $3=="'"$AN"'") print $1}') # Window IDs CURRENT
RO=$(wmctrl -lx|awk -F"[ .]+" '{if ($2!='$AD' && $3=="'"$AN"'") print $1}') # Window IDs OTHER
RA=$(wmctrl -lx|awk -F"[ .]+" '{if ( $3=="'"$AN"'") print $1}') # Window IDs ALL
CC=${RC//[^x]};CC=${#CC} # Count CURRENT
CO=${RO//[^x]};CO=${#CO} # Count OTHER
CA=${RA//[^x]};CA=${#CA} # Count ALL
gxmessage -c -fn 'bold 11' -bg '#06F' -fg '#FFF' \
-buttons "CURRENT ($CC)":101,"OTHER ($CO)":102,"ALL ($CA)":103,Cancel:1 \
$'\n\tClose '"\"$AN\" windows on "$'\n\tCURRENT, OTHER or ALL desktops'
case $? in 1) exit ;; 101) R=$RC;; 102) R=$RO;; 103) R=$RA;; esac
for i in $R;do wmctrl -ic $i;done