etc/acpi: add
This commit is contained in:
parent
7a7fcebd29
commit
3f7c1b0c7c
5 changed files with 23 additions and 0 deletions
8
etc/acpi/actions/brightnessdsp.sh
Executable file
8
etc/acpi/actions/brightnessdsp.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
for backlight in /sys/class/backlight/*; do
|
||||
[ -d $backlight ] || continue
|
||||
step=$(( $(cat "$backlight/max_brightness") / 20))
|
||||
[ $step -gt 1 ] || step=1
|
||||
printf '%s' "$(( $(cat "$backlight/brightness") $1 $step))" > "$backlight/brightness"
|
||||
done
|
9
etc/acpi/actions/powerbtn.sh
Executable file
9
etc/acpi/actions/powerbtn.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
CURRENT_INIT=`ps -p 1 -o comm=`
|
||||
if [ "$CURRENT_INIT" = "openrc-init" ]
|
||||
then
|
||||
/sbin/openrc-shutdown -p now
|
||||
else
|
||||
/sbin/shutdown -h now "Power button pressed"
|
||||
fi
|
2
etc/acpi/events/brightnessdown
Normal file
2
etc/acpi/events/brightnessdown
Normal file
|
@ -0,0 +1,2 @@
|
|||
event=video[ /]brightnessdown
|
||||
action=/etc/acpi/actions/brightnessdsp.sh -
|
2
etc/acpi/events/brightnessup
Normal file
2
etc/acpi/events/brightnessup
Normal file
|
@ -0,0 +1,2 @@
|
|||
event=video[ /]brightnessup
|
||||
action=/etc/acpi/actions/brightnessdsp.sh +
|
2
etc/acpi/events/powerbtn
Normal file
2
etc/acpi/events/powerbtn
Normal file
|
@ -0,0 +1,2 @@
|
|||
event=button[ /]power
|
||||
action=/etc/acpi/actions/powerbtn.sh %e
|
Loading…
Add table
Add a link
Reference in a new issue