Created
November 17, 2014 21:10
-
-
Save OrangeTux/8c6805de37b8c2534822 to your computer and use it in GitHub Desktop.
Increase or decrease brightness of screen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Increase or decrease brightness of screen. | |
# | |
# Example usage: | |
# | |
# $ edit_brightness -50 | |
# $ edit_brightness 10 | |
# | |
# Make sure /sys/class/backlight/radeaon_b10/brightness is writable. This can | |
# be done add the folowing line to crontab file of root: | |
# | |
# @reboot chmod o+w /sys/class/backlight/radeon_bl0/brightness | |
# | |
set -e | |
SYS_PATH="/sys/class/backlight/radeon_bl0" | |
CUR_BRIGHTNESS=$(cat "$SYS_PATH/actual_brightness") | |
NEW_BRIGHTNESS=$(($CUR_BRIGHTNESS + $1)) | |
echo $NEW_BRIGHTNESS | tee "$SYS_PATH/brightness" &> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment