Re: How to kill all the windows on a desktop?
Bernd Eggink <[email protected]>
| Newsgroups | gmane.comp.window-managers.icewm.user |
|---|---|
| Message-ID | <[email protected]> |
Am 12.07.2010 02:15, schrieb Peng Yu: Sorry, I forgot to attach the script. Here it is. -- Bernd Eggink http://sudrala.de ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ IceWM-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/icewm-user
desktop-pids
(text/plain, 611 B)
#!/bin/bash
# desktop-pids
# prints the PIDs of all clients running on the current desktop
rootProps=$(xprop -root)
curDesktop=$(grep '_WIN_WORKSPACE(' <<<"$rootProps")
curDesktop=${curDesktop#*= }
clientsLine=$(grep '^_WIN_CLIENT_LIST(' <<<"$rootProps")
IFS=, read -a clients <<<"${clientsLine#*= }"
for client in ${clients[*]}
do
clientProps=$(xprop -id $client)
pid=$(grep '^_NET_WM_PID(' <<<"$clientProps")
pid=${pid##* }
clientDesktop=$(grep '^_WIN_WORKSPACE(' <<<"$clientProps")
clientDesktop=${clientDesktop##* }
[[ $clientDesktop == $curDesktop ]] && echo $pid
done
exit 0