add backlight support

This commit is contained in:
koksnuss
2018-05-14 00:11:55 +02:00
parent 25376777d1
commit d1571c5592
3 changed files with 17 additions and 1 deletions

12
backlight Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
DIR="/sys/class/backlight/"
if [[ -d "${DIR}acpi_video0" ]]; then
DIR="${DIR}acpi_video0"
elif [[ -d "${DIR}intel_backlight" ]]; then
DIR="${DIR}intel_backlight"
fi
cat "${DIR}/brightness" "${DIR}/max_brightness" | gawk '
NR==1 { cbr=$1 }
NR==2 { mbr=$1 }
END { printf("%d%", cbr/mbr*100) }
'