diff options
| author | Robert Günzler <r@gnzler.io> | 2021-05-31 16:48:08 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-05-31 16:48:08 +0200 |
| commit | ba2816cbaa894aa584a3ea48980278e11bc038d6 (patch) | |
| tree | f30b084d7a5e2a84c471e6280855f4141cea2016 /bin | |
| parent | 316dfe676c98b26b0892ac943e10e930dc76397a (diff) | |
add darkmode script
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/darkmode | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/darkmode b/bin/darkmode new file mode 100755 index 0000000..19d60eb --- /dev/null +++ b/bin/darkmode @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e +[ -n "$DEBUG" ] && set -x + +icons=/usr/share/icons/mdi/scalable + +case "${1}" in + daytime) + notify-send -i ${icons}/car-light-high.svg -a gamma "gamma: day" "switching to light theme" + gsettings set org.gnome.desktop.interface gtk-theme Adwaita + pkill -fe -USR1 waybar-gammastep + ;; + + night) + notify-send -i ${icons}/car-light-dimmed.svg -a gamma "gamma: night" "switching to dark theme" + gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark + pkill -fe -USR2 waybar-gammastep + ;; + + dusk | dawn) + # noop + # pkill -fe -USR2 waybar-gammastep + ;; + + *) + printf "usage: %s [night|daytime]\n" "$(basename "$(readlink -f -- "$0")")" + ;; +esac |