This package implements a systemd unit and shell scripts for controlling volume levels in response to ACPI events.
This is required because PulseAudio has to be controlled by the user running the service, so adding acpid event handlers (which run as root) does not work. This is better than having a window manager handle the events because it works from a virtual terminal as well.
Because this is a user unit, and acpid is a system unit, systemd cannot handle the dependency itself. First, enable and start acpid.service.
sudo systemctl enable acpid.service
sudo systemctl start acpid.service
Then enable and start this service.
systemctl --user enable pulseaudio-acpi-volume.service
systemctl --user start pulseaudio-acpi-volume.service
acpid writes its events to a socket, which this service listens to. The handled events are
button/volumeup
-- increase the volume on the default sinkbutton/volumedown
-- decrease the volume on the default sinkbutton/mute
-- mute the volume on the default sinkbutton/f20
-- mute the default source (microphone)
button/f20
is the event generated by the microphone mute button on a Thinkpad
T480s laptop (and other Thinkpad laptops). There is currently no way to
configure the ACPI event corresponding to muting the default source.