mabox-tools/bin/compton_toggle

35 lines
1016 B
Plaintext
Raw Normal View History

2020-02-18 17:24:18 +01:00
#!/bin/bash
2024-12-08 22:28:23 +01:00
. "$HOME/.config/mabox/mabox.conf"
backend=${picom_renderer:-glx}
2021-10-13 12:20:43 +02:00
case "$LANG" in
pl*)
DISABLED="Kompozytor Picom zastał WYŁĄCZONY"
ENABLED="Kompozytor Picom został URUCHOMIONY"
2024-12-10 20:57:56 +01:00
RENDERER="Sposób renderowania:"
WITHOUT="Bez pliku konfiguracyjnego (/dev/null)"
2021-10-13 12:20:43 +02:00
;;
*)
DISABLED="Picom compositor DISABLED"
ENABLED="Picom compositor ENABLED"
2024-12-10 20:57:56 +01:00
RENDERER="Renderer backend:"
WITHOUT="Running without config file (/dev/null)"
2021-10-13 12:20:43 +02:00
;;
esac
2020-02-18 17:24:18 +01:00
2024-12-08 22:28:23 +01:00
if [ $(pgrep -u $USER picom) ]; then
2023-08-19 16:23:51 +02:00
killall -u $USER picom
notify-send.sh -i compton -t 5000 "Compositor" "$DISABLED"
2020-02-18 17:24:18 +01:00
else
2020-09-30 22:56:54 +02:00
CONFIGFILE="$HOME/.config/picom.conf"
if [ -f "$CONFIGFILE" ];then
2024-12-08 22:28:23 +01:00
picom --backend "$backend" --config "$CONFIGFILE" &
2024-12-10 20:57:56 +01:00
notify-send.sh -i compton -t 8000 "$ENABLED" "\n$RENDERER: <b>$backend</b>"
2020-09-30 22:56:54 +02:00
else
2024-12-10 20:57:56 +01:00
picom --backend "$backend" --config /dev/null &
notify-send.sh -i compton -t 8000 "$ENABLED" "\n$WITHOUT\n$RENDERER <b>$backend</b>"
2020-09-30 22:56:54 +02:00
fi
2020-02-18 17:24:18 +01:00
fi
exit