03 January 2019

How to reduce the brightness of your monitor to lesser than what the operating system allows



Yet another reason to love Linux.
Sometimes you really need the brightness of your monitor to be lower than it already is, and I've found the best solution is to use xrandr. It's installed by default in Ubuntu.

First, you need to know which device is connected to your display (even if you are using a laptop).
Type:

xrandr -q


You'll get an output that looks something like this:

Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
DP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 256mm x 144mm
   1366x768      60.06*+
   1360x768      59.80    59.96 
   1280x720      60.00 
   1024x768      60.00 
   1024x576      60.00 
   960x540       60.00 
   800x600       60.32    56.25 
   864x486       60.00 
   640x480       59.94 
   720x405       60.00 
   680x384       60.00 
   640x360       60.00 
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)


Look for the one that says "connected", and use that in the next command.
Type:


xrandr --output DP1 --brightness 0.5



And tadaah!!! The brightness goes to 50% lesser than what it was.
Enjoy!!!



Create aliases

Still better, create these two aliases in ~/.bash_aliases.

alias br='xrandr --output eDP1 --brightness 0.5'
alias brightness='xrandr --output eDP1 --brightness '

Now you can just type br or brightness 0.3 or brightness 0.6 etc. instead of typing the entire command.


Update: Oct 2019: Redshift can be manually controlled and can even alter gamma. So rather than use xrandr, use Redshift: https://nrecursions.blogspot.com/2018/03/alternative-to-flux-for-ubuntu-is.html 
 
Update 2022: At least from Ubuntu 22.04 and Windows 10 onward, there's no need of installing redshift or similar apps, since the OS comes pre-installed with a NightLight app. Even Android has it.
 

No comments: