mabox-tools/bin/compton_toggle

27 lines
657 B
Plaintext
Raw Normal View History

2020-02-18 17:24:18 +01:00
#!/bin/bash
2021-10-13 12:20:43 +02:00
case "$LANG" in
pl*)
DISABLED="Kompozytor Picom zastał WYŁĄCZONY"
ENABLED="Kompozytor Picom został URUCHOMIONY"
;;
*)
DISABLED="Picom compositor DISABLED"
ENABLED="Picom compositor ENABLED"
;;
esac
2020-02-18 17:24:18 +01:00
if [ $(pidof picom) ]; then
2020-09-30 22:56:54 +02:00
killall picom
2021-10-13 12:20:43 +02:00
notify-send -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
picom --config "$CONFIGFILE" &
2021-10-13 12:20:43 +02:00
notify-send -i compton -t 5000 "Compositor" "$ENABLED"
2020-09-30 22:56:54 +02:00
else
picom --config /dev/null &
2021-10-13 12:20:43 +02:00
notify-send -i compton -t 5000 "Compositor" "$ENABLED"
2020-09-30 22:56:54 +02:00
fi
2020-02-18 17:24:18 +01:00
fi
exit