Created
September 4, 2013 23:20
-
-
Save worenga/6444126 to your computer and use it in GitHub Desktop.
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 | |
light=$(cat /sys/class/leds/samsung\:\:kbd_backlight/brightness); | |
max_light=$(cat /sys/class/leds/samsung\:\:kbd_backlight/max_brightness); | |
if [ "$1" == "inc" ]; then | |
newlight=$((light + 1)); | |
if [ $newlight -gt $max_light ]; then | |
newlight=8; | |
fi | |
else | |
newlight=$((light - 1)); | |
if [ $newlight -lt 0 ]; then | |
newlight=0; | |
fi | |
fi | |
echo $newlight > /sys/class/leds/samsung\:\:kbd_backlight/brightness | |
echo keyboard lightness is now : $newlight; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment