wms/wms_termtogle.sh

15 lines
362 B
Bash
Executable file

#!/bin/bash
## toggle between terminals ##
. /tmp/wms_var
TNAME=$(echo $TERMINAL | cut -d ' ' -f 1) # terminal name
TARGET=$(
for wid in $(lsw); do # print all windows, filter and target the first in stack
printf '%s\n' "$wid $(atomx WM_CLASS $wid)"
done | grep "$TNAME" | cut -d ' ' -f 1 | head -n 1)
wms_mainrole.sh $TARGET # focus terminal