12

Recently Gnome came up with a new feature of Night Light. It is really helpful.
It feels too time-consuming that I need to go to settings (and then display) and activate it each time. Is there any terminal command that can simply turn on the night light feature?
Manual and/or sunrise to sunset option aren't really helpful as even I don't know when I will be needing that particular feature to turn on or off.
I tried to google but, found nothing related to command.
Might not matter, but just in case, I am using Kali Linux.

This is the feature I am talking about.
enter image description here

don_crissti
  • 79,330
  • 30
  • 216
  • 245
Ugnes
  • 259
  • 3
  • 6
  • 13

1 Answers1

14

Yes, you can turn it on with

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true

or

dconf write /org/gnome/settings-daemon/plugins/color/night-light-enabled true

Same commands with false instead of true will turn it off.


If you list the keys under the org.gnome.settings-daemon.plugins.color schema you'll see that you can also configure the schedule (auto: on/off, manual: from/to) as well as the night light temperature. A very convenient way to set the latter is via the night light slider extension.

don_crissti
  • 79,330
  • 30
  • 216
  • 245
  • The first command is now giving the error: *GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.* The second one is working fine. **What could be the reason?** – Ugnes Nov 09 '17 at 19:38
  • 1
    @Ugnes - google for that error and you'll see there are plenty of possible causes. FWIW I can't reproduce it... works fine here. – don_crissti Nov 09 '17 at 21:14
  • @don_crissti I am able to execute the commands that you mentioned as follows: `$ gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true; $ gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled; true`. But nothing happens. I opened dconf-editor GUI, and the value doesn't change there, even though using `gsettings get` outputs changed value. What should be done? – Porcupine Feb 07 '20 at 20:10