dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 36d3fe39be7ff9eac6191cda1628f09eb0925f62
parent dd0288aab9e8268b7ba0841c0985c9d7d78ae0c3
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Wed,  1 Nov 2023 04:30:45 +0200

Add toggle night light script.

Diffstat:
Abin/toggle-night-light.sh | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/bin/toggle-night-light.sh b/bin/toggle-night-light.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ -z "$(command -v gsettings)" ]; then + echo "No gsettings."; + exit 1; +fi + +current_value="$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)" + +if [ "$current_value" = "true" ]; then + echo "Night light turn off." + gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false +elif [ "$current_value" = "false" ]; then + echo "Night light turn on." + gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true +else + echo "Something's wrong! Not a valid value: $current_value" +fi