Skip to content

Instantly share code, notes, and snippets.

@substack substack/light.sh
Created Sep 22, 2018

Embed
What would you like to do?
backlight script
#!/bin/bash
n=$1
if test -z "$n"; then
cat /sys/class/backlight/radeon_bl0/brightness
exit
elif echo "$n" | grep '%'; then
max=$(cat /sys/class/backlight/radeon_bl0/max_brightness)
nn=$(echo "$n" | sed 's/%$//')
b=$(cat /sys/class/backlight/radeon_bl0/brightness)
n=$((b+nn*max/100))
fi
sudo bash -c "echo $n > /sys/class/backlight/radeon_bl0/brightness"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.