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.
30 lines
728 B
30 lines
728 B
#!/usr/bin/env sh |
|
[ -e /sys/class/backlight/edp-backlight ] && DEV=/sys/class/backlight/edp-backlight |
|
[ -e /sys/devices/platform/backlight/backlight/backlight ] && DEV=/sys/devices/platform/backlight/backlight/backlight |
|
|
|
MAX=$(cat $DEV/max_brightness) |
|
MIN=2 |
|
MINSTEP=1 |
|
STEP=$(echo "($MAX - $MIN) / 10" | bc | xargs -ISTP echo -e "$MINSTEP\nSTP" | sort -r | head -n1) |
|
|
|
setdelta() { |
|
sxmo_setpinebacklight $( |
|
cat $DEV/brightness | |
|
xargs -IB echo B $1 | |
|
bc | |
|
xargs -INUM echo -e "$MIN\nNUM" | sort -n | tail -n1 | |
|
xargs -INUM echo -e "$MAX\nNUM" | sort -n | head -n1 |
|
) |
|
sxmo_notify.sh 200 "Backlight $(cat $DEV/brightness)/${MAX}" |
|
} |
|
|
|
up() { |
|
setdelta "+${STEP}" |
|
|
|
} |
|
|
|
down() { |
|
setdelta "-${STEP}" |
|
} |
|
|
|
$1 $2 |