Acpi

From Void Linux Wiki
Jump to: navigation, search

ACPI (Advanced Configuration and Power Interface) allows the operating to interface with hardware, enabling functions such as control of the power or lid button, battery status, dock status and fan status.


Handling ACPI events

To enable handling of ACPI events, first enable the acpid service:

# ln -s /etc/sv/acpid /var/service 

Next, edit the handler script located in etc/acpi/handler.sh

Locking the screen on lid close

To lock the screen when the lid of a laptop is closed, edit the /etc/acpi/handler.sh script, adding a line to run your screen locker before the zzz command:

File: /etc/acpi/handler.sh

# suspend-to-ram
logger "LID closed, suspending..."
i3lock #replace with your screen locker
zzz
;;