1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- #
- # Start a composition manager.
- # (picom, xcompmgr or compton)
- compmgr=picom
- comphelp() {
- echo "Composition Manager:"
- echo " (re)start: COMP"
- echo " toggle: COMP -t"
- echo " stop: COMP -s"
- echo " query: COMP -q"
- echo " returns if composition manager is running"
- exit
- }
- checkcomp() {
- pgrep $compmgr &>/dev/null
- }
- statuscomp() {
- if checkcomp; then
- echo "$compmgr is runing"
- else
- echo "$compmgr is stoped"
- fi
- exit 0
- }
- stopcomp() {
- checkcomp && killall $compmgr
- }
- startcomp() {
- stopcomp
- $compmgr &
- exit 0
- }
- togglecomp() {
- if checkcomp; then
- echo "Turning $compmgr OFF"
- stopcomp
- else
- echo "Turning $compmgr ON"
- startcomp
- fi
- exit 0
- }
- case "$1" in
- "") startcomp ;;
- "-q") statuscomp ;;
- "-s") stopcomp; exit ;;
- "-t") togglecomp ;;
- *) comphelp ;;
- esac
|