23 lines
428 B
Bash
Executable file
23 lines
428 B
Bash
Executable file
#!/bin/sh
|
|
|
|
## switch between windows ##
|
|
|
|
. /tmp/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_mainrole.sh "$TARGET" # focus target
|
|
|
|
fi
|