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) ;&
|
2022-08-12 13:47:25 +02:00
|
|
|
nametag) ;&
|
2020-06-02 11:11:59 +02:00
|
|
|
pushdown) ;&
|
|
|
|
pushup) ;&
|
|
|
|
self_restart) ;&
|
|
|
|
setlayout) ;&
|
|
|
|
setcfact) ;&
|
2022-08-13 16:24:48 +02:00
|
|
|
showhideclient) ;&
|
2020-06-02 11:11:59 +02:00
|
|
|
switchcol) ;&
|
|
|
|
view) ;&
|
|
|
|
viewall) ;&
|
|
|
|
viewtoleft) ;&
|
|
|
|
viewtoright) ;&
|
|
|
|
tagtoleft) ;&
|
|
|
|
tagtoright) ;&
|
|
|
|
tagandviewtoleft) ;&
|
|
|
|
tagandviewtoright) ;&
|
|
|
|
transfer) ;&
|
|
|
|
transferall) ;&
|
|
|
|
togglealttag) ;&
|
|
|
|
togglebar) ;&
|
2023-06-25 22:52:50 +02:00
|
|
|
toggletopbar) ;&
|
2020-06-02 11:11:59 +02:00
|
|
|
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
|
|
|
|
;;
|
2022-08-01 10:19:03 +02:00
|
|
|
floatpos)
|
|
|
|
signal $1 v $2
|
|
|
|
;;
|
2019-10-07 23:34:23 +02:00
|
|
|
*)
|
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
|
|
|
|
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
|
2021-06-14 07:16:17 +02:00
|
|
|
|