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

Open
wants to merge 2 commits into
base: master
from

Conversation

@nrdxp
Copy link
Contributor

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 nrdxp:pulseaudio/mediaKeys branch 2 times, most recently from 6a1499c to 61fa66d Aug 22, 2019
@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 nrdxp:pulseaudio/mediaKeys branch 2 times, most recently from 40c75db to b6236d1 Aug 24, 2019
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

This comment has been minimized.

Copy link

commented Aug 26, 2019

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

This comment has been minimized.

Copy link

commented Aug 27, 2019

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

nrdxp added 2 commits Aug 24, 2019
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 #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 nrdxp force-pushed the nrdxp:pulseaudio/mediaKeys branch from bfea392 to abf5c8f Sep 24, 2019
@nrdxp

This comment has been minimized.

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.