Changing Brightness (Terminal)

You can change the brightness of your DevTerm in the terminal. To do so, just echo a new value into the brightness file which lives @ /sys/class/backlight/backlight@0. In this folder, you’ll find some useful files, such as: actual_brightness, brightness & max_brightness.

This was tested and accomplished on the DevTerm running raspbian.

How

To change brightness, you can change brightness to anything between 0 and 9. 0 being backlight off, and 9 being brightest. The device defaults to 5.

To change brightness, type in (changing N for brightness 0 thru 9):

echo N > /sys/class/backlight/backlight@0/brightness

Take Note

  • For quicker access to changing brightness, see @guu’s solution for adjustment via FN keys.
  • Setting brightness to 0 turns off the backlight and makes the display near impossible to view.
  • This command may require you to elevate your terminal session to root using su, or
sudo bash -c "echo 5 > /sys/class/backlight/backlight@0/brightness"
5 Likes

Good

there is a deb for this job,too

sudo apt update && sudo apt install devterm-backlight-rpi 
sudo reboot

then we can use FN+< > to adjust the backlight

I made this deb after the CM3 shippment,so …

12 Likes

incredible, thank you; it’s a shame the keycaps don’t include notations for this.

Does this publish to a global variable? one of my wishlist mods for my devterm is to backlight the keyboard, syncing to the screen brightness would be ideal

2 Likes

Oh this is even more usable than doing it through term!
Thanks for sharing.

Good luck with that. Not impossible, but not going to be easy

could you please upload the source of package 'devterm-backlight-rpi ’ on github?
I prefer to use console mode (multiuser.target), but the function does not work in the mode.
Thanks

here is the source code, very tiny code

I used xbindkeys with this modified rpi-backlight to do the brightness control

3 Likes

Looking at the source, I think it can be applied to other parts. Thank you.

I figured I’d ask this here, instead of starting a new thread; can anyone point me in the right direction for the screen timeout/turn off value? I didn’t think there was one until i walked away from mine and came back, thought it had powered off but a flick of the trackball brought it back to life. Is this the “sleep” mode referenced in the manual (eg don’t pull the batteries in sleep mode)? I initially thought the power button was sending it to a light sleep, until i noticed that the same command line scrolled past as when i used sudo shutdown

2 Likes

For example:
xset s 60
sets timeout to 60 seconds
xset dpms 120 121 122
sets suspend to 120 seconds, standby to 121 seconds and off to 122 seconds.

1 Like

i cant seem to find the newer thread that this was referenced… but this has never worked on cm4, i installed xbindkeys-config to find that the default binding file is empty… and also… the gamepad buttons are not recognized by xbindkeys to use for brightness… and on the standard keyboard firmware fn activates the shift labels on the regular direction pads… am i behind and this has a fix somewhere? but i can say that the rpi-backlight.c works great when it is bound to shift + directions on my cm4

hey, how i get it autostart after system load(rpi)? trying to do the same on uconsole with latest kernel

hmm, reinstall xbindkeys… because it is a service that should auto-add to startup… you can verify it is there in the gui by going to “session and startup” and look for “xbindkeys” it runs the command “xbindkeys_autostart” if that still doesn’t work … just add it to session and startup manually.

At worst you should be able (I think) to just create your own service.

edwin@clockworkpi:~ $ sudo apt install devterm-backlight-rpi
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package devterm-backlight-rpi
edwin@clockworkpi:~ $

I am using uconsole with the bookworm image