wms/opt/wms_toggle.sh
2024-09-17 11:09:56 -03:00

41 lines
477 B
Bash
Executable file

#!/bin/sh
## toggle visivility of windows ##
# wms_toggle.sh by @root_informatica.
FLAG=$1
# focused window.
FW=$(pfw)
usage() {
cat<<EOF
usage: wms_toggle.sh [-t,-u ]
-t) toggle map.
-u) unmap widnow.
EOF
}
unmap() {
atomx WM_MAP="$FW" $FW
mapw -u $FW
}
toggle() {
for wid in $(lsw); do
atomx WM_MAP="$wid" $wid
done
mapw -t $(atomx WM_MAP $(lsw -a))
}
case $FLAG in
-t)
toggle
;;
-u)
unmap
;;
*)
usage
;;
esac