wms/wms_termtogle.sh

16 lines
362 B
Bash
Raw Normal View History

2023-03-06 19:08:25 +01:00
#!/bin/bash
2023-03-07 14:01:29 +01:00
## toggle between terminals ##
2023-08-08 04:42:24 +02:00
. /tmp/wms_var
2023-03-06 19:08:25 +01:00
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)
2023-03-20 02:46:41 +01:00
wms_mainrole.sh $TARGET # focus terminal
2023-03-06 19:08:25 +01:00