wms/opt/wms_switch.sh
2024-09-13 22:13:00 -03:00

23 lines
463 B
Bash
Executable file

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