1 unstable release
0.1.0 | Dec 19, 2021 |
---|
#1502 in Hardware support
17KB
150 lines
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
acpid
is 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
acpid
with the default--socketfile
behaviour
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
)
Dependencies
~170–630KB