user-acpid

Crates.iouser-acpid
lib.rsuser-acpid
version0.1.0
sourcesrc
created_at2021-12-19 07:19:27.098543
updated_at2021-12-19 07:19:27.098543
descriptionnon-root companion process for linux acpid ( https://sourceforge.net/projects/acpid2/ )
homepagehttps://gitlab.com/jokeyrhyme/user-acpid-rs
repositoryhttps://gitlab.com/jokeyrhyme/user-acpid-rs.git
max_upload_size
id500320
size47,105
Ron Waldon-Howe (jokeyrhyme)

documentation

README

user-acpid-rs Status Gitlab pipeline status Crates.io docs.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)
Commit count: 23

cargo fmt