How to use command line to change brightness and color?

17,718

Solution 1

You can modify gamma settings (colors and effectively contrast too) using xrandr tool. First determine the output name of your monitor:

 $ xrandr -q | grep connected
 DFP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
 CRT1 disconnected (normal left inverted right x axis y axis)

In the above example I have a monitor connected and seen as output DFP1. So now for the gamma modification example:

$ xrandr --output DFP1 --gamma 0.8:0.8:1.1

Where gamma values are in format Red:Green:Blue.

Edit: Another option is xcalib (you may need to install it first). It can be used with -a parameter to have effect directly on the connected monitor. See the output of xcalib for more details. Unfortunately, the color/brightness settings seem to work additively, so you might need to do randr --output ... --gamma 1:1:1 to restore the default state.

Solution 2

From xrandr's manpage:

Some versions of xrandr also have this option:

   --brightness brightness

          Multiply the gamma values on the crtc currently attached to  the
          output  to specified floating value. Useful for overly bright or
          overly  dim  outputs.   However,  this  is   a   software   only
          modification,  if  your  hardware has support to actually change
          the brightness, you will probably prefer to use xbacklight.
Share:
17,718

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    Is there any way to change the brightness and color? Using any command line tools?

    I am trying in Fedora and Ubuntu but no luck so far.

    Follow up:

    [command]    [conneccted output]   [effects R:G:B, value 0 to 255]        
    |     /      |            /        |            /
    ^    ^       ^            ^        ^           ^
    xrandr       --output VGA1         --gamma 0:0:0
    
    • Admin
      Admin over 12 years
      The gamma values should be in range 0..1 or slightly above. Not 0..255.
  • Joe Hammer
    Joe Hammer over 12 years
    Excellent. This is what i am trying really the native way to change the gamma, color, brightness, sharpness.
  • Emanuel Berg
    Emanuel Berg over 11 years
    Hm, you should probably mention that those are the exact words from man xrandr.