34 lines
594 B
Bash
Executable File
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
|