Changing the brightness of a DVI or HDMI monitor on Linux is very easy. This is done with the xrandr utility. This allows a user to change the properties of a connected monitor.
Get a list of connected monitors with the xrandr -q
command.
4.4 Fri May 22 jason@Yog-Sothoth 0: $ xrandr -q Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767 DVI-D-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.00*+ 1280x1024 75.02 60.02 1152x864 75.00 1024x768 75.03 60.00 800x600 75.00 60.32 640x480 75.00 59.94 HDMI-0 disconnected (normal left inverted right x axis y axis) DP-0 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) VGA-1-1 disconnected (normal left inverted right x axis y axis) HDMI-1-1 disconnected (normal left inverted right x axis y axis) HDMI-1-2 disconnected (normal left inverted right x axis y axis) |
Now we have the ID of the monitor, which is DVI-D-0. Now the brightness may be changed like this.
4.4 Fri May 22 jason@Yog-Sothoth 0: $ xrandr --output DVI-D-0 --brightness 0.9 |
This is how to change settings for a monitor easily.
This command is for a nice night-time setting, this will use red-shifted colors and be easier on the eyes at night time.
4.4 Fri May 22 jason@Yog-Sothoth 0: $ xrandr --output DVI-D-0 --gamma 1.1:0.8:0.7 --brightness 0.55 |
Put it back to normal like this.
4.4 Fri May 22 jason@Yog-Sothoth 0: $ xrandr --output DVI-D-0 --gamma 1.1:1:1 --brightness 0.9 |
This is a very easy way to set various values to change the brightness and gamma of your monitor. Just be careful with the –gamma settings. Setting the wrong values can make your screen unreadable.