diff --git a/bin/compton_toggle b/bin/compton_toggle index 615f084..2d5c612 100755 --- a/bin/compton_toggle +++ b/bin/compton_toggle @@ -1,4 +1,8 @@ #!/bin/bash +. "$HOME/.config/mabox/mabox.conf" + +backend=${picom_renderer:-glx} + case "$LANG" in pl*) DISABLED="Kompozytor Picom zastał WYŁĄCZONY" @@ -10,17 +14,17 @@ case "$LANG" in ;; esac -if [ $(pgrep -u $USER -f picom) ]; then +if [ $(pgrep -u $USER picom) ]; then killall -u $USER picom notify-send.sh -i compton -t 5000 "Compositor" "$DISABLED" else CONFIGFILE="$HOME/.config/picom.conf" if [ -f "$CONFIGFILE" ];then - picom --config "$CONFIGFILE" & - notify-send.sh -i compton -t 5000 "Compositor" "$ENABLED" + picom --backend "$backend" --config "$CONFIGFILE" & + notify-send.sh -i compton -t 5000 "Compositor" "$ENABLED\nRenderer: $backend" else - picom --config /dev/null & - notify-send.sh -i compton -t 5000 "Compositor" "$ENABLED" + picom --backend "$backend" --config /usr/share/doc/picom/picom.conf.example & + notify-send.sh -i compton -t 5000 "Compositor" "$ENABLED\n Using picom example config file\nRenderer: $backend" fi fi exit