1

I am on a stock Ubuntu 20.04 LTS machine with gnome. Using the brightness controls on my keyboard ('fn' + left/right arrow keys), I can adjust the screen brightness up or down (this brings up a gnome-styled slider and sun-like brightness icon, showing where I am in the range between lowest and highest brightness).

Going by the values in /sys/class/backlight/intel_backlight/brightness, the brightness varies between 1200 and 120000, in increments of 5940.

I can set the brightness to other values by redirecting to the /sys/class/backlight/intel_backlight/brightness file (*). To my surprise, the modification persists even through keypresses to change the brightness (i.e. setting it to 3600 and then pressing 'fn' + right arrow once yields a brightness of 9540 (= 3600 + 5940) (**).

However, what I really want is more fine-grained control. I'd ideally like to change the existing 5940 to something more like 2000.

I did try grep -r 5940 /sys/class/backlight/intel_backlight/* in the hope that the value might simply have been stored as a writeable setting somewhere, but no such luck. Apart from that, I'm at a loss as to where to look. I could swear that the values (both the minimum and the increment) were different back in 18.04 (on the same physical machine).

(*) For some reason,

drubbels@drubbels:~$ sudo echo 3600 > /sys/class/backlight/intel_backlight/brightness

fails, but

drubbels@drubbels:~$ su
Password:
root@drubbels:/home/drubbels# echo 3600 > /sys/class/backlight/intel_backlight/brightness 

does work.

(**) It does get 'squashed down' back to the existing minimum or maximum of 1200 or 120000 when I try to take it below or above those.

Note: I do not believe this is a duplicate question. I did find a number of other similar questions complete with answers, but most of these were from 2012 and referenced settings & menus which no longer seem to exist

6
  • Your min and max values are stored in the same directory. I imagine max - min / 5940 is the number of steps your application is coded for. It's simple to write a script that adjusts at 1% steps. – WinEunuuchs2Unix Mar 16 at 19:41
  • My max brightness (120000) is indeed stored there, but my min brightness isn't. Also, the max_brightness file is not writeable (I get Permission Denied even when working as root). – Drubbels Mar 16 at 19:45
  • You never write to max or min. You just write to brightness a value between min and max. – WinEunuuchs2Unix Mar 16 at 21:55
  • Just checking if you have found a solution? – WinEunuuchs2Unix Mar 20 at 19:02
  • No, I have not. I could write my own script - and even tie it to some hotkey combination - to modify the brightness value, but I do not know how to connect it to the existing brightness keys. This is because the existing brightness key combo is [fn + left/right arrow], and the function key is uniquely not directly accessible as a key press event. The recognition of [fn + arrow key] happens somewhere before the OS (maybe in the BIOS?). The OS is of course informed somehow (it has to adjust the brightness), but it doesn't happen as the kind of normal key event which I would know how to access. – Drubbels Mar 21 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.