41 lines
777 B
Bash
41 lines
777 B
Bash
|
#!/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 server’s 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 server’s 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
|