wms/wms_switcher.sh
2023-09-07 00:52:48 -03:00

19 lines
390 B
Bash
Executable file

#!/bin/sh
## switch between windows ##
. /tmp/wms_var
AMW=$(lsw) # all maped windows
DELAY=.2
if [ -n "$AMW" ]; then
TARGET=$(\
for wid in $(lsw); do # print id, class and name in xmenu
printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)"
done | cut -c 1-100 | $XMENU | cut -d '|' -f 1)
sleep $DELAY &&
wms_mainrole.sh "$TARGET" # focus target
fi