fix picom handling

This commit is contained in:
Daniel Napora 2024-12-08 22:28:23 +01:00
parent 3d11013030
commit aa31631b95

View File

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