Skip to content

Instantly share code, notes, and snippets.

@Rmlyy
Created December 17, 2021 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rmlyy/d919daee436251614010ec16b9717ea3 to your computer and use it in GitHub Desktop.
Save Rmlyy/d919daee436251614010ec16b9717ea3 to your computer and use it in GitHub Desktop.
Change screen brightness by 10%
#!/bin/sh
brightness="/sys/class/backlight/intel_backlight/brightness"
current=$(cat $brightness)
if [ $1 -eq 0 ]; then
new=$(( current + 10000 ))
else
new=$(( current - 10000 ))
fi
tee $brightness <<< $new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment