wms/rwm_mainrole.sh
rootniformaticaservice e83acb54de several changes
2023-03-06 22:55:30 -03:00

40 lines
777 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
. $HOME/.config/rootwm/rwm_var
usage() {
echo "usage:
rwm_starship.sh [ -n, -p, -l, wid ]
-n) next in order stack
-p) prev in order stack
-t) focus the top window in the servers window stack
wid) window id"
}
case $1 in
-n) # focus next in stack order
wid=$(lsw | grep -v $(pfw) | sed '1 p;d')
chwso -r $wid
;;
-p) # focus prev in stack order
wid=$(lsw | grep -v $(pfw) | sed '$ p;d')
chwso -r $wid
;;
-t) # focus the top window in the servers window stack
wid=$(lsw | sed '$ p;d')
;;
0x*) # focus on wid
wattr $1 && wid=$1
chwso -r $wid
;;
*)
usage
;;
esac
# transfer focus
wtf $wid
# set borders
chwb -s $BW -c $BG $(lsw | grep -v $(pfw)) # unfocused color
chwb -s $BW -c $FG $(pfw) # focused color