user-acpid-0.1.0 is not a library.
user-acpid-rs

non-root companion process for linux acpid ( https://sourceforge.net/projects/acpid2/ )
status
- works!
why
- we want a way to react to ACPI events and act upon an interactive user session
- this means being able to easily access the current dbus/wayland/pipewire/etc sessions
acpidis great, but it executes hooks as root instead of as the current interactive user- it's quite (intentionally) fiddly for anyone except that user to access user session sockets, buses, etc
- this tool is intended to be executed as a non-root user in the context of their interactive session
use cases
- in combination with
wlr-randr, turn on/off a built-in display based on laptop lid status - turn on/off a built-in USB webcam based on laptop lid status
- in combination with
pw-cli, turn on/off a built-in USB microphone based on laptop lid status
dependencies
- requires your system to be running
acpidwith the default--socketfilebehaviour
roadmap
- read events from /var/run/acpid.socket
- identify lid open and lid close ACPI events
- run ~/.config/user-acpid/button-lid-open when opened
- run ~/.config/user-acpid/button-lid-close when closed
- check lid status on startup
- support alternative paths to
acpid's socket file - handle socket closure and attempt to re-open after a delay
- close and re-open socket after receiving SIGUSER1 signal
- explore direct kernel access (independence from
acpid)