Created
June 15, 2017 00:41
-
-
Save frankzhao/da934a317df25d9ac8fb9b59dc9a6bf6 to your computer and use it in GitHub Desktop.
Fix backlight in i3
This file contains 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
#!/bin/bash | |
set -e | |
file="/sys/class/backlight/intel_backlight/brightness" | |
current=$(cat "$file") | |
new="$current" | |
if [ "$1" = "-inc" ] | |
then | |
new=$(( current + $2 )) | |
fi | |
if [ "$1" = "-dec" ] | |
then | |
new=$(( current - $2 )) | |
fi | |
echo "$new" | tee "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment