Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -eq 1 ];
- then
- PAST=`cat /sys/class/backlight/acpi_video0/brightness`
- CURRENT=$PAST
- if [ $1 == "inc" ];
- then
- if [ $CURRENT -lt 10 ];
- then
- ((CURRENT++))
- fi
- elif [ $1 == "dec" ];
- then
- if [ $CURRENT -gt 1 ];
- then
- ((CURRENT--))
- fi
- elif [ $1 == "get" ];
- then
- echo $PAST
- elif [ $1 -ge 1 ] && [ $1 -le 10 ];
- then
- CURRENT=$1
- fi
- if [ $CURRENT != $PAST ];
- then
- tee /sys/class/backlight/acpi_video0/brightness <<< $CURRENT > /dev/null
- fi
- fi
Add Comment
Please, Sign In to add comment