mabox-tools/bin/compton_toggle

27 lines
687 B
Plaintext
Raw Permalink 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
2023-08-19 16:23:51 +02:00
if [ $(pgrep -u $USER -f picom) ]; then
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
picom --config "$CONFIGFILE" &
2023-08-19 16:23:51 +02:00
notify-send.sh -i compton -t 5000 "Compositor" "$ENABLED"
2020-09-30 22:56:54 +02:00
else
picom --config /dev/null &
2023-08-19 16:23:51 +02:00
notify-send.sh -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