mabox-tools/bin/compton_toggle
2024-12-10 20:57:56 +01:00

35 lines
1016 B
Bash
Executable File

#!/bin/bash
. "$HOME/.config/mabox/mabox.conf"
backend=${picom_renderer:-glx}
case "$LANG" in
pl*)
DISABLED="Kompozytor Picom zastał WYŁĄCZONY"
ENABLED="Kompozytor Picom został URUCHOMIONY"
RENDERER="Sposób renderowania:"
WITHOUT="Bez pliku konfiguracyjnego (/dev/null)"
;;
*)
DISABLED="Picom compositor DISABLED"
ENABLED="Picom compositor ENABLED"
RENDERER="Renderer backend:"
WITHOUT="Running without config file (/dev/null)"
;;
esac
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 --backend "$backend" --config "$CONFIGFILE" &
notify-send.sh -i compton -t 8000 "$ENABLED" "\n$RENDERER: <b>$backend</b>"
else
picom --backend "$backend" --config /dev/null &
notify-send.sh -i compton -t 8000 "$ENABLED" "\n$WITHOUT\n$RENDERER <b>$backend</b>"
fi
fi
exit