Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

nrdxp
Copy link
Contributor

@nrdxp nrdxp commented Aug 22, 2019

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@nrdxp nrdxp force-pushed the pulseaudio/mediaKeys branch 2 times, most recently from 6a1499c to 61fa66d Compare August 22, 2019 05:01
@nrdxp nrdxp changed the title allow 'sound.mediaKeys.enable' to work even when 'hardware.pulseaudio.enable' is used alsa: allow 'sound.mediaKeys.enable' to work even when 'hardware.pulseaudio.enable' is used Aug 22, 2019
@nrdxp nrdxp force-pushed the pulseaudio/mediaKeys branch 2 times, most recently from 40c75db to b6236d1 Compare August 24, 2019 00:48
nrdxp added a commit to nrdxp/nixos that referenced this pull request Aug 25, 2019
NixOS/nixpkgs#67227

use new options from this pull request
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/55

@nixos-discourse
Copy link

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

Timothy DeHerrera added 2 commits September 23, 2019 18:16
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
@nrdxp
Copy link
Contributor Author

nrdxp commented Sep 24, 2019

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?

@nrdxp nrdxp closed this Oct 17, 2019
@rileyinman
Copy link
Contributor

Any reason this was closed besides inactivity? This seems like a good option to have available for pulseaudio users.

ConditionPathExists = "%I";
};
serviceConfig = {
Type = "forking";
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hardware.pulseaudio.enable conflicts with sound.mediaKeys.enable
4 participants