Created
April 22, 2015 06:05
-
-
Save christianbundy/94ab5ff42200b6ee1ac8 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
MIN=0 | |
MAX=1 | |
STEPS=100 | |
RANGE=$(echo "$MAX - $MIN" | bc -l) | |
INC=$(echo "$RANGE / $STEPS" | bc -l) | |
fade () { | |
for i in `seq $1 $2 $3`; | |
do | |
screenbrightness -v $i 2>&1 > /dev/null | |
done | |
} | |
up () { | |
fade $MIN $INC $MAX && down | |
} | |
down () { | |
fade $MAX -$INC $MIN && up | |
} | |
up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dependency:
screenbrightness