mabox-pipemenus/usr/bin/mabox-compositor

34 lines
594 B
Plaintext
Raw Normal View History

2016-03-25 19:02:03 +01:00
#!/bin/bash
2024-12-08 22:29:26 +01:00
# mabox-compositor - script to start|stop|restart picom
2016-03-25 19:02:03 +01:00
# by Daniel Napora <napcok@gmail.com>
2024-12-08 22:29:26 +01:00
. "$HOME/.config/mabox/mabox.conf"
2016-03-25 19:02:03 +01:00
2024-12-08 22:29:26 +01:00
backend=${picom_renderer:-glx}
2017-01-04 19:18:24 +01:00
2024-12-08 22:29:26 +01:00
start() {
CONFIGFILE="$HOME/.config/picom.conf"
if [ -f "$CONFIGFILE" ];then
picom --backend "$backend" --config "$CONFIGFILE" &
else
2024-12-10 20:59:19 +01:00
picom --backend "$backend" --config /dev/null &
2024-12-08 22:29:26 +01:00
fi
}
stop() {
if [ $(pgrep -u $USER picom) ]; then
killall -u $USER picom
fi
}
restart(){
stop
sleep 0.25
start
}
2016-03-25 19:02:03 +01:00
2024-12-08 22:29:26 +01:00
case "$1" in
2024-12-10 20:59:19 +01:00
--start|start) start;;
--stop|stop) stop;;
--restart|restart) restart;;
2024-12-08 22:29:26 +01:00
esac
2016-03-25 19:02:03 +01:00
exit 0