wms/rwm_mainrole.sh

43 lines
809 B
Bash
Raw Normal View History

2023-03-06 19:08:25 +01:00
#!/bin/sh
2023-03-07 14:01:29 +01:00
## give windows the stardom ##
2023-03-06 19:08:25 +01:00
. $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