summary refs log tree commit diff
path: root/.config/gammastep/hooks/switch.sh
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-04-26 01:58:12 +0200
committerRobert Günzler <r@gnzler.io>2021-04-26 02:09:50 +0200
commit2fa1b42fc9e37dc1e0baa02f8ede0a6655b72858 (patch)
tree73dd41d7c1f789d0eae56d121d63147d5c13f1d0 /.config/gammastep/hooks/switch.sh
parent5bd9cdf6e45da7a9d22d9aedeb3ecd9fdce33bf0 (diff)
gammastep: switch desktop theme when going into night mode
Diffstat (limited to '.config/gammastep/hooks/switch.sh')
-rwxr-xr-x.config/gammastep/hooks/switch.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/.config/gammastep/hooks/switch.sh b/.config/gammastep/hooks/switch.sh
new file mode 100755
index 0000000..fae86ec
--- /dev/null
+++ b/.config/gammastep/hooks/switch.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -x
+
+case "$1" in
+	period-changed)
+
+		case "$3" in
+			night|transition)
+				notify-send gammastep "changing to night"
+				gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
+				pkill -fe -USR2 waybar-gammastep
+				;;
+
+			daytime)
+				notify-send gammastep "changing to day"
+				gsettings set org.gnome.desktop.interface gtk-theme Adwaita
+				pkill -fe -USR1 waybar-gammastep
+				;;
+
+			none)
+				notify-send gammastep "turning off"
+				pkill -fe -USR1 waybar-gammastep
+				;;
+		esac
+		;;
+esac