https://github.com/westleyk/rpi-brightness
Raspberry pi backlight brightness cli simple c
https://github.com/westleyk/rpi-brightness
adjust backlight brightness c cli mode pi raspberry-pi rpi rpi-backlight rpi-brightness sleep
Last synced: 11 months ago
JSON representation
Raspberry pi backlight brightness cli simple c
- Host: GitHub
- URL: https://github.com/westleyk/rpi-brightness
- Owner: WestleyK
- License: mit
- Created: 2018-07-17T18:08:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T02:05:10.000Z (over 7 years ago)
- Last Synced: 2025-04-13T18:45:09.506Z (about 1 year ago)
- Topics: adjust, backlight, brightness, c, cli, mode, pi, raspberry-pi, rpi, rpi-backlight, rpi-brightness, sleep
- Language: C
- Size: 65.4 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## A simple command for adjusting your raspberry pi backlight
Designed and tested for raspberry pi with official 7 inch touchscreen.
Other script that do the same thing:
- go: https://github.com/WestleyK/rpi-backlight
- perl: https://github.com/WestleyK/pi-backlight
- bash/shell: https://github.com/WestleyK/backlight
## Install, Update and Uninstall
### To install:
```
cd ~/
mkdir raspberrypi-backlight
cd raspberrypi-backlight/
git clone https://github.com/WestleyK/rpi-brightness.git
cd rpi-brightness/
make
sudo make install
```
### Easy install:
Paste or type this in your terminal:
```
curl https://raw.githubusercontent.com/WestleyK/rpi-backlight/master/easy-install.sh | sh
```
This will install `rpi-brightness` to the current directory.
To finish the install, do:
```
sudo mv rpi-brightness /usr/local/bin/
```
### To update:
```
cd ~/raspberrypi-backlight/rpi-brightness/
make update
sudo make install
```
### To uninstall:
```
cd ~/raspberrypi-backlight/rpi-brightness/
sudo make uninstall
```
## Usage:
```
pi@raspberrypi:~ $ rpi-brightness -help
Usage: rpi-backlight [OPTION]
-h | -help | --help (print help menu)
-u | -up (adjust backlight brighter by: 20/255)
-d | -down (adjust brightness lower by: 20/255)
-s | -sleep (enter sleep mode, press to exit)
-c (print current brightness)
[15-255] (adjust brightness from: 15 to: 255)
-i | -info (print compiled info)
-v | -version | --version (print version & date)
Source code: https://github.com/WestleyK/rpi-brightness
pi@raspberrypi:~ $
```
For example, you can do:
```
sudo rpi-backlight 200
```
And:
```
sudo rpi-backlight -sleep
```
Will enter sleep mode.
Make sure you type `sudo` before adjusting backlight,
Or you might get this `ERROR`
```
pi@raspberrypi:~ $ rpi-brightness -up
ERROR: Brightness file not writable or doesn't exist:
/sys/class/backlight/rpi_backlight/brightness
Try: $ sudo rpi-brightness [OPTION] (or) https://github.com/WestleyK/rpi-brightness (for help)
pi@raspberrypi:~ $
```
### Don't like the sudo?
If you you don't like typing `sudo` before adjusting brightness, then
run the `no-root.sh` script:
```
sudo ./no-root.sh
sudo reboot
```
Now you should not need the `sudo`.
To undo what you did, type:
```
sudo rm /etc/udev/rules.d/backlight-permissions.rules
sudo reboot
```
## Troubleshooting:
```
pi@raspberrypi:~ $ rpi-brightness [OPTION]
ERROR: Brightness file not writable.
Try: sudo rpi-brightness (or) https://github.com/WestleyK/rpi-brightness (for help)
pi@raspberrypi:~ $
```
Possible causes or fixes:
- Try `sudo` and then the command.
- Try [updating](#To-update).
- File does't exist.
### End README