
In this article, we will delve into the use of xrandr --gamma
for implementing a Red Light/Blue Light filter on Ubuntu-Gnome. This can be particularly useful for reducing eye strain during nighttime computer use.
Using xrandr --gamma
on Ubuntu-Gnome allows you to adjust the red and blue color channels to create a Red Light/Blue Light filter. This can help reduce eye strain during nighttime computer use. However, for a more user-friendly experience with additional features, it is recommended to use dedicated tools like redshift
or fluxgui
.
Introduction to xrandr
xrandr
is a command-line tool used for setting the size, orientation, and/or reflection of the outputs for a screen. It can also set the gamma correction through the --gamma
option.
Understanding the –gamma Option
The --gamma
option in xrandr
allows you to adjust the red, green, and blue color channels. It accepts three floating-point values representing the red, green, and blue channels respectively. For instance, xrandr --output <monitor> --gamma 1:1:1
sets the gamma correction for all three color channels to 1.
Using –gamma for Red Light/Blue Light Filter
To create a “Night Light”-like effect using xrandr --gamma
, you can adjust the red and blue values to create a warmer color temperature. Here’s how you can translate the numerical values used in Gnome’s Night Light to --gamma
values:
- 1000: Use a lower value for the red channel, such as
1:0.8:0.8
, to create a warmer/red tint. - 4000: This is the default night light temperature. You can use
1:1:0.9
to slightly reduce the blue channel. - 5500: Use
1:1:1
to maintain a balanced color temperature. - 6500: This is the default night light off temperature. Use
1:1:1
for a neutral color temperature. - 10000: Use a higher value for the blue channel, such as
0.9:0.9:1
, to create a cooler/blue tint.
These values are approximate and can be adjusted based on personal preference.
Implementing the Filter
Here is an example command to set the --gamma
values using xrandr
:
xrandr --output <monitor> --gamma 1:1:0.9
Replace <monitor>
with the appropriate output name, such as eDP-1
or DP-1
. You can also adjust the values to achieve the desired effect.
Limitations and Alternatives
It’s worth mentioning that xrandr
does not provide a built-in transition period like Gnome’s Night Light. To achieve a gradual transition, you can use a script that gradually adjusts the --gamma
values over a specific time period.
In addition to xrandr
, you can also consider using tools like redshift
or fluxgui
which provide more advanced features for adjusting color temperature and blue light reduction. These tools often offer smoother transitions and additional customization options.
Conclusion
While xrandr --gamma
can be used to create a Night Light-like effect, using dedicated tools like redshift
or fluxgui
may provide a more user-friendly experience with additional features. However, for users who prefer the command-line interface or need to use xrandr
for other reasons, the --gamma
option provides a versatile way to adjust screen colors and reduce blue light.
You can use the xrandr
command without any arguments to list the available outputs. Look for the output name next to the "connected" status.
Yes, you can specify the output name for each monitor you want to adjust. For example, xrandr --output eDP-1 --gamma 1:1:0.9 --output DP-1 --gamma 1:1:0.9
will apply the gamma correction to both the eDP-1
and DP-1
outputs.
You can reset the gamma correction by setting all three color channel values to 1. For example, xrandr --output <monitor> --gamma 1:1:1
will reset the gamma correction for the specified monitor.
Yes, you can create a script that runs the xrandr --gamma
command with the desired values. You can then schedule the script to run at specific times using tools like cron.
Yes, you can consider using tools like redshift
or fluxgui
which provide more advanced features for adjusting color temperature and blue light reduction. These tools often offer smoother transitions and additional customization options.