From a93171947755bcb74b4818335a73cffdd156898c Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Tue, 2 Nov 2021 19:04:38 +0100 Subject: bin/darkmode: prevent triggers during dawn/dusk phases --- bin/darkmode | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bin/darkmode') diff --git a/bin/darkmode b/bin/darkmode index 5fc591f..67f9ae1 100755 --- a/bin/darkmode +++ b/bin/darkmode @@ -5,15 +5,23 @@ 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 ;; -- cgit 1.4.1