diff --git a/opt/switch.sh b/opt/switch.sh new file mode 100755 index 0000000..a5331d7 --- /dev/null +++ b/opt/switch.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +## switch between windows ## +# wms_jumper.sh by @root_informatica. + +. $HOME/.config/wms/wms_var + +# all maped widnows. +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 | $XMENU | cut -d '|' -f 1) + +sleep $DELAY && +wms_focuser.sh "$TARGET" # focus target +fi