mabox-pipemenus/usr/bin/mabox-compositor
2024-12-10 20:59:19 +01:00

34 lines
594 B
Bash
Executable File

#!/bin/bash
# mabox-compositor - script to start|stop|restart picom
# by Daniel Napora <napcok@gmail.com>
. "$HOME/.config/mabox/mabox.conf"
backend=${picom_renderer:-glx}
start() {
CONFIGFILE="$HOME/.config/picom.conf"
if [ -f "$CONFIGFILE" ];then
picom --backend "$backend" --config "$CONFIGFILE" &
else
picom --backend "$backend" --config /dev/null &
fi
}
stop() {
if [ $(pgrep -u $USER picom) ]; then
killall -u $USER picom
fi
}
restart(){
stop
sleep 0.25
start
}
case "$1" in
--start|start) start;;
--stop|stop) stop;;
--restart|restart) restart;;
esac
exit 0