# Changing Brightness (Terminal)

**URL:** <https://forum.clockworkpi.com/t/changing-brightness-terminal/7070>\
**Category:** DevTerm\
**Tags:** tinkering, brightness\
**Created:** [September 8, 2021, 8:46am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070 "2021-09-08T08:46:11Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrRaccoon](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/drraccoon/32/1254_2.png) [@DrRaccoon](https://forum.clockworkpi.com/u/DrRaccoon)\
**Post date:** [September 8, 2021, 8:46am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/1 "2021-09-08T08:46:11Z")

</div>

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):

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

```

## Take Note

- For quicker access to changing brightness, see @guu’s [solution for adjustment](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/2) 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

```auto
sudo bash -c "echo 5 > /sys/class/backlight/backlight@0/brightness"

```

---

<div class="post-metadata">

**Author:** ![guu](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@guu](https://forum.clockworkpi.com/u/guu)\
**Post date:** [September 8, 2021, 9:49am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/2 "2021-09-08T09:49:13Z")

</div>

Good

there is a deb for this job,too

```auto
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 …

---

<div class="post-metadata">

**Author:** ![AverageZac](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@AverageZac](https://forum.clockworkpi.com/u/AverageZac)\
**Post date:** [September 8, 2021, 8:09pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/3 "2021-09-08T20:09:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DrRaccoon](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/drraccoon/32/1254_2.png) [@DrRaccoon](https://forum.clockworkpi.com/u/DrRaccoon)\
**Post date:** [September 8, 2021, 9:00pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/4 "2021-09-08T21:00:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Godzil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/godzil/32/60_2.png) [@Godzil](https://forum.clockworkpi.com/u/Godzil)\
**Post date:** [September 8, 2021, 9:27pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/5 "2021-09-08T21:27:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Glbr\_Hanson](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/glbr_hanson/32/4883_2.png) [@Glbr\_Hanson](https://forum.clockworkpi.com/u/Glbr_Hanson)\
**Post date:** [September 11, 2021, 4:19am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/6 "2021-09-11T04:19:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![guu](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@guu](https://forum.clockworkpi.com/u/guu)\
**Post date:** [September 11, 2021, 4:48am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/7 "2021-09-11T04:48:15Z")

</div>

here is the source code, very tiny code

> **[GitHub - cuu/rpi-backlight: Simple program for controlling backlight of the...](https://github.com/cuu/rpi-backlight)**
>
> Simple program for controlling backlight of the official Raspberry Pi Touchscreen. - GitHub - cuu/rpi-backlight: Simple program for controlling backlight of the official Raspberry Pi Touchscreen.

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

---

<div class="post-metadata">

**Author:** ![Glbr\_Hanson](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/glbr_hanson/32/4883_2.png) [@Glbr\_Hanson](https://forum.clockworkpi.com/u/Glbr_Hanson)\
**Post date:** [September 11, 2021, 5:20am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/8 "2021-09-11T05:20:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AverageZac](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@AverageZac](https://forum.clockworkpi.com/u/AverageZac)\
**Post date:** [September 11, 2021, 3:36pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/9 "2021-09-11T15:36:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Radek](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/radek/32/7707_2.png) [@Radek](https://forum.clockworkpi.com/u/Radek)\
**Post date:** [December 23, 2023, 3:55am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/10 "2023-12-23T03:55:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DeRock25](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/derock25/32/7976_2.png) [@DeRock25](https://forum.clockworkpi.com/u/DeRock25)\
**Post date:** [January 28, 2024, 4:48am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/11 "2024-01-28T04:48:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mykhailo\_Chuha](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/mykhailo_chuha/32/8423_2.png) [@Mykhailo\_Chuha](https://forum.clockworkpi.com/u/Mykhailo_Chuha)\
**Post date:** [April 21, 2024, 6:23am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/12 "2024-04-21T06:23:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DeRock25](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/derock25/32/7976_2.png) [@DeRock25](https://forum.clockworkpi.com/u/DeRock25)\
**Post date:** [April 21, 2024, 1:21pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/13 "2024-04-21T13:21:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![estufa](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/estufa/32/9282_2.png) [@estufa](https://forum.clockworkpi.com/u/estufa)\
**Post date:** [April 23, 2024, 12:05am UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/14 "2024-04-23T00:05:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bestedwin](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/bestedwin/32/9541_2.png) [@bestedwin](https://forum.clockworkpi.com/u/bestedwin)\
**Post date:** [June 27, 2024, 3:20pm UTC](https://forum.clockworkpi.com/t/changing-brightness-terminal/7070/15 "2024-06-27T15:20:51Z")

</div>

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
