Update Envy

This commit is contained in:
2018-03-05 17:52:27 -07:00
parent 94c0687d06
commit e73cae4c81
8 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
#!/bin/sh
bl_device=/sys/class/backlight/amdgpu_bl0/brightness
echo $(($(cat $bl_device)-5)) | sudo tee $bl_device

View File

@@ -0,0 +1,4 @@
#!/bin/sh
bl_device=/sys/class/backlight/amdgpu_bl0/brightness
echo $(($(cat $bl_device)+5)) | sudo tee $bl_device

View File

@@ -0,0 +1,3 @@
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e

View File

@@ -0,0 +1,2 @@
event=video/brightnessdown BRTDN 00000087 00000000
action=/etc/acpi/actions/bl_down.sh

View File

@@ -0,0 +1,2 @@
event=video/brightnessup BRTUP 00000086 00000000
action=/etc/acpi/actions/bl_up.sh

77
HP_Envy/etc/acpi/handler.sh Executable file
View File

@@ -0,0 +1,77 @@
#!/bin/bash
# Default acpi script that takes an entry for all actions
case "$1" in
button/power)
case "$2" in
PBTN|PWRF)
logger 'PowerButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
button/sleep)
case "$2" in
SLPB|SBTN)
logger 'SleepButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
ac_adapter)
case "$2" in
AC|ACAD|ADP0)
case "$4" in
00000000)
logger 'AC unpluged'
;;
00000001)
logger 'AC pluged'
;;
esac
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
;;
00000001)
logger 'Battery offline'
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
logger 'LID closed'
;;
open)
logger 'LID opened'
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac
# vim:set ts=4 sw=4 ft=sh et:

View File

@@ -0,0 +1,4 @@
blacklist acer_wmi
blacklist sp5100_tco
blacklist amd_gpio
blacklist tpm_crb