diff options
Diffstat (limited to 'unix/utils/backlight_default.sh')
| -rwxr-xr-x | unix/utils/backlight_default.sh | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/unix/utils/backlight_default.sh b/unix/utils/backlight_default.sh deleted file mode 100755 index b79e680..0000000 --- a/unix/utils/backlight_default.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -set -e - -backlight_sys_dir="/sys/class/backlight/intel_backlight" - -read -r max_brightness < "${backlight_sys_dir}/max_brightness" -read -r curr_brightness < "${backlight_sys_dir}/brightness" - -if ! groups | grep -q backlight; then - echo "User is not in the backlight group" - exit 1 -fi - -if [ "$#" -eq 0 ] ; then - # set to half that of 'max_brightness' - echo $((max_brightness / 2)) > "$backlight_sys_dir"/brightness - exit 0 -fi - -case "$1" in - up) increment="+ 10" ;; - down) increment="- 10" ;; - *) exit 1 ;; -esac - -new_brightness=$(($curr_brightness $increment)) - -if $((new_brightness < 1)) || $((new_brightness > $max_brightness)); then - exit 1 -else - echo "$new_brightness" > "$backlight_sys_dir"/brightness -fi |
