2020-06-02 11:11:59 +02:00
|
|
|
#!/usr/bin/env bash
|
2019-10-07 23:34:23 +02:00
|
|
|
|
|
|
|
signal() {
|
|
|
|
xsetroot -name "fsignal:$*"
|
|
|
|
}
|
|
|
|
|
|
|
|
case $# in
|
|
|
|
1)
|
|
|
|
case $1 in
|
2020-06-02 11:11:59 +02:00
|
|
|
focusurgent) ;&
|
|
|
|
mirrorlayout) ;&
|
|
|
|
mpdcontrol) ;&
|
|
|
|
pushdown) ;&
|
|
|
|
pushup) ;&
|
|
|
|
self_restart) ;&
|
|
|
|
setlayout) ;&
|
|
|
|
setcfact) ;&
|
|
|
|
switchcol) ;&
|
|
|
|
view) ;&
|
|
|
|
viewall) ;&
|
|
|
|
viewtoleft) ;&
|
|
|
|
viewtoright) ;&
|
|
|
|
tagtoleft) ;&
|
|
|
|
tagtoright) ;&
|
|
|
|
tagandviewtoleft) ;&
|
|
|
|
tagandviewtoright) ;&
|
|
|
|
transfer) ;&
|
|
|
|
transferall) ;&
|
|
|
|
togglealttag) ;&
|
|
|
|
togglebar) ;&
|
|
|
|
togglefloating) ;&
|
|
|
|
togglefullscreen) ;&
|
|
|
|
fullscreen) ;&
|
|
|
|
togglefakefullscreen) ;&
|
|
|
|
togglesticky) ;&
|
|
|
|
togglehorizontalmax) ;&
|
|
|
|
toggleverticalmax) ;&
|
|
|
|
togglemax) ;&
|
|
|
|
togglegaps) ;&
|
|
|
|
defaultgaps) ;&
|
|
|
|
unfloatvisible) ;&
|
|
|
|
winview) ;&
|
|
|
|
xrdb) ;&
|
|
|
|
zoom) ;&
|
|
|
|
killclient) ;&
|
|
|
|
quit)
|
2019-10-07 23:34:23 +02:00
|
|
|
signal $1
|
|
|
|
;;
|
|
|
|
*)
|
2020-06-04 20:29:16 +02:00
|
|
|
echo "Unknown command ($1) or missing one argument."
|
2019-10-07 23:34:23 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
case $1 in
|
2020-06-02 11:11:59 +02:00
|
|
|
cyclelayout) ;&
|
|
|
|
explace) ;&
|
|
|
|
moveplace) ;&
|
|
|
|
mpdchange) ;&
|
2020-06-04 20:29:16 +02:00
|
|
|
setkeymode) ;&
|
2020-06-02 11:11:59 +02:00
|
|
|
switchtag) ;&
|
|
|
|
togglescratch) ;&
|
2019-10-07 23:34:23 +02:00
|
|
|
view)
|
|
|
|
signal $1 ui $2
|
|
|
|
;;
|
2020-06-02 11:11:59 +02:00
|
|
|
viewex) ;&
|
|
|
|
toggleviewex) ;&
|
|
|
|
tagallmon) ;&
|
|
|
|
tagswapmon) ;&
|
|
|
|
tagex) ;&
|
|
|
|
toggletagex) ;&
|
|
|
|
setborderpx) ;&
|
2020-06-04 20:29:16 +02:00
|
|
|
setgaps) ;&
|
2020-06-02 11:11:59 +02:00
|
|
|
setlayoutex) ;&
|
|
|
|
setlayoutaxisex) ;&
|
|
|
|
swapfocus) ;&
|
|
|
|
focusstack) ;&
|
|
|
|
pushstack) ;&
|
|
|
|
inplacerotate) ;&
|
|
|
|
rotatestack) ;&
|
|
|
|
rotatelayoutaxis) ;&
|
|
|
|
incnmaster) ;&
|
|
|
|
incnstack) ;&
|
|
|
|
incrgaps) ;&
|
|
|
|
incrigaps) ;&
|
|
|
|
incrogaps) ;&
|
|
|
|
incrihgaps) ;&
|
|
|
|
incrivgaps) ;&
|
|
|
|
incrohgaps) ;&
|
|
|
|
incrovgaps) ;&
|
|
|
|
movestack) ;&
|
|
|
|
shiftview) ;&
|
|
|
|
shiftviewclients) ;&
|
|
|
|
focusmon) ;&
|
|
|
|
tagmon)
|
2019-10-07 23:34:23 +02:00
|
|
|
signal $1 i $2
|
|
|
|
;;
|
2020-06-02 11:11:59 +02:00
|
|
|
setcfact) ;&
|
2019-10-07 23:34:23 +02:00
|
|
|
setmfact)
|
|
|
|
signal $1 f $2
|
|
|
|
;;
|
|
|
|
*)
|
2020-06-04 20:29:16 +02:00
|
|
|
echo "Unknown command ($1) or too many arguments"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
5)
|
|
|
|
case $1 in
|
|
|
|
setgaps)
|
|
|
|
# Expects "setgaps oh ov ih iv" where -1 means to keep existing values
|
|
|
|
[ $2 = -1 ] && oh=128 || oh=$2
|
|
|
|
[ $3 = -1 ] && ov=128 || ov=$3
|
|
|
|
[ $4 = -1 ] && ih=128 || ih=$4
|
|
|
|
[ $5 = -1 ] && iv=128 || iv=$5
|
|
|
|
echo $(((oh << 24) + (ov << 16) + (ih << 8) + iv))
|
|
|
|
signal $1 i $(((oh << 24) + (ov << 16) + (ih << 8) + iv))
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown command ($1) or too many arguments"
|
2019-10-07 23:34:23 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
*)
|
2020-06-04 20:29:16 +02:00
|
|
|
echo "Unknown command ($1) or too many arguments"
|
2019-10-07 23:34:23 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
2020-06-02 11:11:59 +02:00
|
|
|
esac
|