Save hints about backlight hack on laptop
This commit is contained in:
parent
ee4ebf4b9b
commit
c20416644b
|
@ -0,0 +1 @@
|
|||
ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/local/sbin/backlighthack.sh"
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
|
||||
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
|
||||
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
|
||||
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
|
||||
newintelbrightness=`expr $acpibrightness \* $scale`
|
||||
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
|
||||
|
||||
if [ "$newintelbrightness" -ne "$curintelbrightness" ]; then
|
||||
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue