Skip to content

Night mode functionality similar to "Night Light" in Gnome or Redshift

The Night mode, or a similar sounding name, has the intended goal of lessening eye strains at night by reducing the blue color on screen. This method is nowadays known and used in Gnome or Windows via "Night Light" and KDE. But far before this, we had Redshift or f.lux for example. But all of these tools are discontinued, deprecated, do have weird licenses or not working on Linux any more now.

Even the author of Redshift suggests one to use native methods rather than Redshift, since, according to their README, "Redshift uses the gamma correction ramps to apply this effect which has traditionally been the only way of applying a color effect to the display. [..] As long as Redshift is using gamma ramps, many of these issues are impossible to solve properly in Redshift. [..] Using the features integrated into the desktop environments avoids many of the issues with gamma ramps which is why these implementations should generally be favored over Redshift.".

This is thus my humble attempt to start this feature request at least and get people inspired by this, who would also love to see this quite handy tool implemented directly in Xfce (too).

To go further with this quest, I want to make clear of the requirements and needed steps, since I unfortunately don't know much about the desktop environment structure.

  • First, which sub-package would fit this feature? I thought this might fit into the xfce4-power-manager project. Now that I think about it, it could also fit into the appearance settings, since it also alters some displaying matters. But feel free to correct my assumption. Gnome seems to implement their "Night Light" via gsd-color, which is part of the gnome-settings-daemon. But that depends on the method used to do this color correction.

  • Second, deriving from the first, what method are available for use instead of gamma correction? To be honest, I don't know. Many apps for Android just put a huge filter above the entire shown screen, which is why this needs to be granted with permission. If the app crashes, the color correction will go pouf and the blue color will kill the eyes at night again. Very similar with Redshift. It is not even possible to start the app multiple times, it will hinder each other and lead to a flickering screen. Also harmful. But since this method is only needed as an external app, a native implementation might have the advantage to access the render pipeline of the entire desktop directly. By correcting the colors just before the final rendering on screen, everything could be colored, I think. Maybe this can make this feature even independent from the display server like Xorg or Wayland. But again, I remember vaguely that many recent desktop environments would send already finished "images" of apps to the Xorg server for rendering, especially now due to the trend of client side decoration. Wayland seems to handle this without further methodical differences.

I thank you again for reading through this barrage of text, but even if this will never receive any attentions, at least I tried.