How to change brightness on CRT display through the Linux command line?

20

9

I have a Debian Linux desktop and a CRT display. I want to change the screen's brightness without using the monitor's brightness controls. How can I do this? Is this possible in the command line or is there an application to be installed?

Neilvert Noval

Posted 2011-03-09T14:43:31.987

Reputation: 357

1So you have a desktop with an external monitor and you want to control the backlight, right? It is connected by VGA cable? I don't think there is a way to do that. Most LCD backlight controls are for laptops and handhelds that have direct access (I/O) to the backlight controller. I don't think there is a control path via the VGA interface for that. – Keith – 2011-03-11T07:31:17.803

ADditional info: I'm using CRT monitor. – Neilvert Noval – 2011-03-11T17:06:06.673

@NeilvertNoval Instead of commenting with add. info, add the info to the original question. The fact that it is a CRT monitor should be declared in the question title itself. – None – 2012-01-12T13:09:57.353

Answers

18

Look under /sys/class/backlight for the appropriate files to frob.

echo -n 6 > /sys/class/backlight/acpi_video0/brightness

Ignacio Vazquez-Abrams

Posted 2011-03-09T14:43:31.987

Reputation: 100 516

8my /sys/class/backlight is an empty directory. – Neilvert Noval – 2011-03-11T17:05:47.767

Works, but my path is /sys/class/backlight/acpi_video0/brightness and my range goes up to 15. (Fedora 17 64bit) – pgampe – 2012-06-12T11:24:00.267

@Ignacio Vazquez-Abrams same problem as Neilvert Noval – krupal – 2013-04-25T17:09:10.627

This requires root access, which I think makes this unusable. – oneself – 2013-05-22T04:04:48.523

@oneself: Non-root access was never a part of the question. – Ignacio Vazquez-Abrams – 2013-05-22T04:15:58.027

I think it's fair to say that is implied. No one wants to put in their sudo password every time they need to change screen brightness. This answer is technically correct, but some of the other ones are better (e.g. xbacklight which does not require root). – oneself – 2013-05-22T14:27:49.483

@oneself: How do you know it isn't being run by e.g. systemd, which runs as root anyway... – Ignacio Vazquez-Abrams – 2013-05-22T14:29:36.380

Note that this doesn't work with sudo. You really need to use the su command first to get it working. – Luc – 2013-07-17T13:46:45.307

It works fine with sudo. The trick is to perform the redirection under sudo and not just the echo. – Ignacio Vazquez-Abrams – 2013-07-17T19:27:14.957

On a chromebook: echo -n 937 > /sys/class/backlight/intel_backlight/brightness – Quandary – 2014-03-07T16:45:50.437

16

$ sudo apt-get install xbacklight

How to set brightness to 50%

$ xbacklight -set 50

How to increase brightness 10%

$ xbacklight -inc 10

How to decrease brightness 10%

$ xbacklight -dec 10

More info here

auraham

Posted 2011-03-09T14:43:31.987

Reputation: 333

jcomeau@aspire:~$ xbacklight -set 50 gives error message: No outputs have backlight property – jcomeau_ictx – 2013-11-26T03:00:24.800

it changes the contrast, not the brightness; it doesn't save power. – Edouard Thiel – 2013-12-29T19:43:33.230

7

You need to control the monitor over DDC. See http://ddccontrol.sourceforge.net/ for one program that lets you do this.

Forrest Voight

Posted 2011-03-09T14:43:31.987

Reputation: 211

Project was moved to github: https://github.com/ddccontrol/ddccontrol

– kravemir – 2017-04-24T16:47:57.717

Very good, thanks for the tip! I wrote a program with it, look at it on this page. – Edouard Thiel – 2013-12-29T19:44:23.093

6

If you don't have hardware support for changing the brightness of your monitor you could use the command xrandr together with its option flags --output and --brightness, as can be seen in my answer to a similar question on askubuntu.com

Erik Sjölund

Posted 2011-03-09T14:43:31.987

Reputation: 211

This is actually very nice! – Gerhard Burger – 2013-01-08T11:12:05.710

3

You could give this solution a try:

echo -n 100 > /proc/acpi/video/VGA/LCD/brightness

Also, in the comments, there are some hints what to do alternatively if it doesn't work (f.e. using GLX0 instead of VGA.

EDIT: As this doesn't seem to help, another user in the comments suggests to install xbacklight and calling xbacklight -set 100.

EDIT2: And another one says if you don't have a video folder, try sudo modprobe video.

schnaader

Posted 2011-03-09T14:43:31.987

Reputation: 1 810

I checked on this before posting, but I have no video folder on that path. – Neilvert Noval – 2011-03-09T14:47:13.897

modprobe video -> command not found – Neilvert Noval – 2011-03-10T16:01:20.053

I already installed xbacklight, but when I do xbacklight -set 100. it says No outputs have backlight property – Neilvert Noval – 2011-03-10T16:02:07.107

No video folder + sudo modprobe video doesn't does anything. – Santosh Kumar – 2013-07-31T05:18:20.653

3

After searching around, I think I found a pretty good way to get this done on most laptops. The first command gets the name of your screen, something like LVDS1. If this does not work, try getting the name of your screen with xrandr --current. There are probably more elegant ways to do this, the sed command removes everything after the first space, the head and tail commands simply remove everything except the second line of the output. The second line uses the screen name to change the brightness to 1.0. This can be set to almost anything, including 0.0 for a black screen or 50.0 for a completely white screen, but I think 1.0 is the desired value here.

screenName=$(xrandr --current | sed s/\ .*// | head -n2 | tail -n1);
xrandr --output $screenName --brightness 1.0

The command below sets the brightness to the maximum allowed brightness, as I noticed that just setting it to '100' does not simply work, at least not on all systems.

sudo sh -c 'echo -n $(cat /sys/class/backlight/acpi_video0/max_brightness) > /sys/class/backlight/acpi_video0/brightness'

This worked on multiple laptops running Ubuntu 12.04.

Max Gräsbeck

Posted 2011-03-09T14:43:31.987

Reputation: 56

Mind you, this will do it in software by modifiying the pixel values. It will not actually dim the display. – Mario – 2013-06-04T07:26:58.110

0

Here is a small program I wrote to control the brightness on my laptop for Ubuntu 12.04.3 LTS. Look at explanations inside (file /usr/local/dreamcolor2/README in the tarball):

http://pageperso.lif.univ-mrs.fr/~edouard.thiel/tar/brightness-dreamcolor2.tgz

It uses ddccontrol on i2c buses and works great for my configuration:

- HP ELiteBook 8770w
- NVidia Quadro K3000M
- HP DreamColor 2 Monitor, full HD
- Ubuntu 12.04.3 LTS x86_64, kernel 3.8.0-34-generic
- Nvidia Driver Version: 319.32
- Unity desktop

I tried every other solutions in this page and this is the only one which actually worked for me. Another solution was to run the HP Mobile Display Assistant (downloaded on HP site) but it is only given as rpm, no deb package; it has to be tweaked a little bit to work and is rather slow, and does not work with fn keys.

My script allows to control the brightness by the command line and by the fn keys. Please tell me if it works for you out of the box or if you have to change the i2c device in the script.

Edouard Thiel

Posted 2011-03-09T14:43:31.987

Reputation: 101

0

CRT's (Cathode Ray Tube) don't have backlights. LCD's do have backlights. Adjusting the brightness on a CRT involves changing the signal going to it, unlike a LCD.

CRT's use the maximum amount of power on white screens, because the electron guns use more power to emit more electrons, while LCD's spend the most power on black screens, because all transistors are on flipping the polarity of liquid crystal blocking the light coming from the backlight.

Any utility that can trigger DPMS should work to put the monitor into sleep mode with many of the CRT's made in the mid to late 90's through to the end of production.

Montaray Jack

Posted 2011-03-09T14:43:31.987

Reputation: 1

To elaborate a little more, CRTs emit light though the florescence excitation of phosphors due to the electrons hitting it. Various different chemicals emitted different frequencies of light. – Montaray Jack – 2014-12-23T06:00:22.780

There are four DPMS modes that analog CRTs could be in, all controlled by the state of the VSync and HSYNC lines, ON is HSYNC and VSYNC both on, STANDBY is HSYNC off and VSYNC ON uses around 80% power, SUSPEND HSYNC on VSYNC off uses around 30W for the Energy Star rated monitors and OFF- both HSYNC AND VSYNC off. This used to work just fine with X, going back all the way to the XFree86 days, but I don't know if it still works. – Montaray Jack – 2014-12-23T06:08:27.377

You can query the state of DPMS with xset q, which, I think, is still a part of the standard X Windows set of programs. You can also set the time for DPMS with xset, as well as changing mouse and keyboard parameters. – Montaray Jack – 2014-12-23T06:44:54.113

For permanent changes, you should add Option "DPMS" to the "Monitor" section, and to the Server Layout section of xorg.conf something like Option "BlankTime" "4" Option "StandbyTime" "0" Option "SuspendTime" "0" Option "OffTime" "5" with the times edited to your preference – Montaray Jack – 2014-12-23T06:50:51.530

Changing Brightness and Contrast on a analog monitor is done down on the other side of the RAMDAC, by opamps in the RAMDAC or or between the RAMDAC and VGA connector or on the monitor side by amps in the Monitor. Contrast is controlled by amplification of the signal, and Contrast is controlled by the Bias of the signal, so DC offset. – Montaray Jack – 2014-12-23T10:12:13.830

The RGB colorspace is really ill-suited to the task, there is no headroom and you lose Gamut information. HSV colorspace is better suited to adjusting brightness and contrast, YCbCr even better. It can get pretty involved depending on how deeply you look into it, a good in depth primer is chapter 3 of Andrew S. Glassner's 1400 page Principles of Digital Image Synthesis. – Montaray Jack – 2014-12-23T10:13:25.130

ON modern cards, the best way to do Contrast and Brightness correction is probably through the VideoLUT, the same way color correction is done. Unfortunately, both AMD and NVIdia are pretty closed about how to use that mechanism, possibly for product differentiation, got to make those Quadro and FireGL cards look like they can do more than the gaming cards, and also possibly out of fear of being sued by the color correction corps like Pantone – Montaray Jack – 2014-12-23T10:20:08.440

Another typo above Should be Brightness is controlled by amplification of the signal, and Contrast is controlled by the Bias of the signal, so DC offset. – Montaray Jack – 2014-12-23T13:51:51.533

And to finally answer, no not really with anything in X windows, but you can change it sortof, with xgamma which changes the gamma ramp, not really brightness, but close enough. Type in a terminal xgamma -gamma {value} Gamma values must be between 0.100 and 10.000 – Montaray Jack – 2014-12-23T15:31:39.703

0

Edit the file /etc/default/grub and add "pcie_aspm=force acpi_backlight=vendor" to the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

After the changes whole line will look like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force acpi_backlight=vendor"

For complete detail visit the link.

http://hackingzones.com/increasedecrease-brightness-in-linux-ubuntu-pear-os-backtrackkali/

Chirag Singh

chirag Hz

Posted 2011-03-09T14:43:31.987

Reputation: 1