You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
574 B
20 lines
574 B
#!/bin/sh |
|
brightness_dir="/sys/class/backlight/intel_backlight/brightness" |
|
max_brightness=`cat /sys/class/backlight/intel_backlight/max_brightness` |
|
current_brightness_level=`cat $brightness_dir` |
|
new_brightness_level=`expr $current_brightness_level + $1` |
|
|
|
if [ "$1" -ge 0 ]; then |
|
if [ "$new_brightness_level" -le "$max_brightness" ]; then |
|
echo $new_brightness_level > $brightness_dir |
|
else |
|
echo $max_brightness > $brightness_dir |
|
fi |
|
else |
|
if [ "$new_brightness_level" -ge 0 ]; then |
|
echo $new_brightness_level > $brightness_dir |
|
else |
|
echo 0 > $brightness_dir |
|
fi |
|
fi |
|
|
|
|