10

There's a manual option to set the times you want GNOME night light to be on and off. I want it always on.

The closest I can get is to set it to turn on at 00:00 and turn off at 23:59. But then at midnight it goes off for a minute which is annoying. Then I have to turn it back on through the settings. How do I force it "always on".

  • Just curious. Why do you want Night Light ON all the time? There are other programs that can change screen gamma/temperature, as outlined in some answers below. – heynnema Oct 26 '18 at 14:45
  • 2
    @hennema because I don't like the default 6500 daylight setting. I find 5000 more pleasing to the eye during the day. Yes there are other programs but Night Light is included by default, why install additional programs if you don't have to? My two cents. – stackinator Oct 26 '18 at 16:50
17

The "native" way for Gnome Shell to always keep your nightlight color on involves to access some hidden options in dconf-editor. dconf-editor is not installed by default on Ubuntu 18.04. You may need to install it first.

  • Open dconf-editor and navigate to the key /org/gnome/settings-daemon/plugins/color/
  • Set night-light-schedule-automatic to false
  • Set night-light-schedule-from to 0, and night-light-schedule-to to 24 (or any value higher than this)

You can also adjust your color temperature there.

In Ubuntu versions later than 18.04, these settings are exposed in "Settings", under "Displays".

| improve this answer | |
  • 1
    And you can manually change the color at any time in the terminal with the following ('5000' can be any value) gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 5000 – stackinator Oct 26 '18 at 17:34
4

Another alternative is sct which you can install with sudo apt install sct.

$ sct -h
Usage: sct [temperature]
Temperatures must be in a range from 1000-10000
If no arguments are passed sct resets the display to the default temperature (6500K)
If -h is passed sct will display this usage information
$ 

Putting sct 3500 or whatever other value you prefer in your autostart should do it.

| improve this answer | |
2

I was similarly looking for a way to keep it on at all times but didn't see a way through the GUI. The other answers work but I found a simpler way to enable it via terminal without having to install any additional tools:

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-automatic false
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-from 0
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-to 24
gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 5000

To get an idea of temperature value ranges, Redshift uses default values of 3700 at night and 5500 during the day.

| improve this answer | |
1

The question can be reframed to "How can I have screen color temperature at 5000 all the time?".

In this case you can use xrandr to set the color temperature. From these notes:

/* -----------------------------------------------------------------------------
    Dec 9, 2018 - Future Help Screen? Below taken from `sct` C source code:

/* cribbed from redshift, but truncated with 500K steps */
static const struct { float r; float g; float b; } whitepoints[] = {
    { 1.00000000,  0.18172716,  0.00000000, }, /* 1000K */
    { 1.00000000,  0.42322816,  0.00000000, },
    { 1.00000000,  0.54360078,  0.08679949, }, /* 2000K */
    { 1.00000000,  0.64373109,  0.28819679, },
    { 1.00000000,  0.71976951,  0.42860152, }, /* 3000K */
    { 1.00000000,  0.77987699,  0.54642268, },
    { 1.00000000,  0.82854786,  0.64816570, }, /* 4000K */
    { 1.00000000,  0.86860704,  0.73688797, },
    { 1.00000000,  0.90198230,  0.81465502, }, /* 5000K */
    { 1.00000000,  0.93853986,  0.88130458, },
    { 1.00000000,  0.97107439,  0.94305985, }, /* 6000K */
    { 1.00000000,  1.00000000,  1.00000000, },             /* 6500K */
    { 0.95160805,  0.96983355,  1.00000000, }, /* 7000K */
    { 0.91194747,  0.94470005,  1.00000000, },
    { 0.87906581,  0.92357340,  1.00000000, }, /* 8000K */
    { 0.85139976,  0.90559011,  1.00000000, },
    { 0.82782969,  0.89011714,  1.00000000, }, /* 9000K */
    { 0.80753191,  0.87667891,  1.00000000, },
    { 0.78988728,  0.86491137,  1.00000000, }, /* 10000K */
    { 0.77442176,  0.85453121,  1.00000000, },
};

----------------------------------------------------------------------------- */

You can see 5000K is:

{ 1.00000000,  0.90198230,  0.81465502, }, /* 5000K */

So you can use xrandr like this

xrandr --output DP-1 --gamma 1:.90:.81

Do this on startup and forget about Night Light or any other add on.


Ironically looking at the code redshift (at night) mostly entails blue shift + green shift (reduction).

| improve this answer | |
  • This only sets colors on some programs, not all – Dagelf Jul 6 at 19:27
  • @Dagelf since xrandr is the heart of the system or the meat & potatoes as it were, it would be interesting if you would list at least one of the programs that do not honor xrandr settings. – WinEunuuchs2Unix Jul 9 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.