Skip to content

Instantly share code, notes, and snippets.

@frankzhao
Created June 15, 2017 00:41
Show Gist options
  • Save frankzhao/da934a317df25d9ac8fb9b59dc9a6bf6 to your computer and use it in GitHub Desktop.
Save frankzhao/da934a317df25d9ac8fb9b59dc9a6bf6 to your computer and use it in GitHub Desktop.
Fix backlight in i3
#!/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