Skip to content

Instantly share code, notes, and snippets.

@worenga
Created September 4, 2013 23:20
Show Gist options
  • Save worenga/6444126 to your computer and use it in GitHub Desktop.
Save worenga/6444126 to your computer and use it in GitHub Desktop.
#!/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