summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-11-02 19:04:38 +0100
committerRobert Günzler <r@gnzler.io>2021-11-02 19:06:53 +0100
commita93171947755bcb74b4818335a73cffdd156898c (patch)
tree8246d0a95c8b684762fdfec48a08e3e6a0acf58a /bin
parent1ef5c2e79119ef5fe3aa361c845996cb9f383519 (diff)
bin/darkmode: prevent triggers during dawn/dusk phases
Diffstat (limited to 'bin')
-rwxr-xr-xbin/darkmode12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/darkmode b/bin/darkmode
index 5fc591f..67f9ae1 100755
--- a/bin/darkmode
+++ b/bin/darkmode
@@ -6,14 +6,22 @@ set -e
 icons=/usr/share/icons/mdi/scalable
 
 case "${1}" in
+dawn | dusk)
+	touch "/tmp/darkmode.${1}"
+	;;
+esac
+
+case "${1}" in
 dawn | day*)
-	# notify-send -i ${icons}/car-light-high.svg -a gamma "gamma: day" "switching to light theme"
+	[ -f "/tmp/darkmode.${1}" ] && exit 0
+	notify-send -i ${icons}/car-light-high.svg -a gamma "gamma: ${1}" "switching to light theme"
 	gsettings set org.gnome.desktop.interface gtk-theme Adwaita
 	pkill -fe -USR1 waybar-gammastep
 	;;
 
 dusk | night)
-	# notify-send -i ${icons}/car-light-dimmed.svg -a gamma "gamma: night" "switching to dark theme"
+	[ -f "/tmp/darkmode.${1}" ] && exit 0
+	notify-send -i ${icons}/car-light-dimmed.svg -a gamma "gamma: ${1}" "switching to dark theme"
 	gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
 	pkill -fe -USR2 waybar-gammastep
 	;;