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