noblank and compton_toggle

master
Daniel Napora 2021-10-13 12:20:43 +02:00
parent 113ad747d1
commit f727e2448e
2 changed files with 33 additions and 3 deletions

View File

@ -1,16 +1,26 @@
#!/bin/bash
case "$LANG" in
pl*)
DISABLED="Kompozytor Picom zastał WYŁĄCZONY"
ENABLED="Kompozytor Picom został URUCHOMIONY"
;;
*)
DISABLED="Picom compositor DISABLED"
ENABLED="Picom compositor ENABLED"
;;
esac
if [ $(pidof picom) ]; then
echo "Stopping picom"
killall picom
notify-send -i compton -t 5000 "Compositor" "$DISABLED"
else
CONFIGFILE="$HOME/.config/picom.conf"
if [ -f "$CONFIGFILE" ];then
echo "Starting picom with config: $CONFIGFILE"
picom --config "$CONFIGFILE" &
notify-send -i compton -t 5000 "Compositor" "$ENABLED"
else
echo "Starting picom without config file"
picom --config /dev/null &
notify-send -i compton -t 5000 "Compositor" "$ENABLED"
fi
fi
exit

20
bin/noblank 100755
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
case "$LANG" in
pl*)
DISABLED="Wygaszanie monitora jest WYŁĄCZONE"
ENABLED="Wygaszanie monitora jest WŁĄCZONE"
;;
*)
DISABLED="Monitor blanking is DISABLED"
ENABLED="Monitor blanking is ENABLED"
;;
esac
if (xset q|grep --quiet "DPMS is Enabled");
then
xset s off -dpms
notify-send -i monitor -t 5000 "DPMS" "$DISABLED"
else
xset s on +dpms
notify-send -i monitor -t 5000 "DPMS" "$ENABLED"
fi