Skip to content

Instantly share code, notes, and snippets.

@kapad
Created July 3, 2018 20:30
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kapad/bdbf5df735690afd8cd36225becf7304 to your computer and use it in GitHub Desktop.
Save kapad/bdbf5df735690afd8cd36225becf7304 to your computer and use it in GitHub Desktop.
Script to toggle the Gnome nightlight setting.
#!/bin/bash
setting=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)
if [[ $setting == "true" ]]; then
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false
else
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
fi
@thelazt16
Copy link

thelazt16 commented Apr 21, 2019

Thanks for the script, it's useful. Now i can activate night light just pressing Super+N. Instead using .sh filetype, i chmod +x the file moved it to custom folder in ~/.local/share/myscript create symlink of the file to /usr/local/bin and name it tooglens, set key shortcut on gnome setting to Ctrl+Super+N, modify the shortcut key using dconf editor to Super+N and voila.

@plibither8
Copy link

@thelazt16 thanks for this, beautifully described instructions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment