New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alsa: allow 'sound.mediaKeys.enable' to work even when 'hardware.pulseaudio.enable' is used #67227
Conversation
6a1499c
to
61fa66d
Compare
40c75db
to
b6236d1
Compare
NixOS/nixpkgs#67227 use new options from this pull request
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/47 |
Some processes require user level permissions to interact with them, E.g. pulseaudio. Allow users to make keybindings for them. * add new 'userMode' toggle to bindings; default to 'false' * add 'ENV{SYSTEMD_USER_WANTS}' to udev rule * only launch user service instances if there are relevant bindings * add 'start-actkbd' user service to initialize actkbd instances
Resolves NixOS#66854 Media keys are audio server agnostic and 'just work' * declare new keybinds for pulseaudio using pamixer * set new keybinds if pulseaudio is enabled otherwise use original binds
bfea392
to
abf5c8f
Compare
Just did a force push to use pactl instead of pamixer. I didn't realize that you could use @DEFAULT_SINK@ for pactl until today (its not in the manpage). This simplifies the PR a bit as I no longer needed to modify the volumeStep type so this should be much less intrusive. Should work with all existing configurations. I checked everything again just to be sure it still works and its good to go. Any takers? |
Any reason this was closed besides inactivity? This seems like a good option to have available for pulseaudio users. |
ConditionPathExists = "%I"; | ||
}; | ||
serviceConfig = { | ||
Type = "forking"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe forking could be changed to simple and -D removed from the ExecStart -line.
Motivation for this change
This resolves #66854 by adding new functionality to actkbd, allowing it to selectively deploy a systemd user service when a special 'userMode' toggle is set in the bindings attribute set. This does not work globally, but per binding so you can still have system-wide bindings for those that work fine that way, and user session bindings for any program which requires user permissions. I have split the config files for each instance so that the same binding will not be called by both services.
Additionally, I have modified 'sound.mediaKeys.enable' to take advantage of this new feature so that bindings for volume control will still work even when 'hardware.pulseaudio.enable' is set.
I imagine many users of NixOS are advanced users that use a lightweight window manager and not a full DE, so this should benefit anybody in that situation to have volume keys that 'just work' even when using a Wayland session or no graphical session at all.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @