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

nixos/acpid: pass event parameters to handler #34190

Merged
merged 2 commits into from Feb 10, 2018
Merged

Conversation

JohnAZoidberg
Copy link
Member

Previously the parameters were just dropped. Now they can be read
from within the handler script. An example to show this is added.

Makes use of the new writeShellScript function as suggested in:
issue #21557

resolves: #21557

Motivation for this change

Previously the script for a certain event was run with no further information. This is fine for a button event where an action is executed on every press. But for something like ac_adapter we want to know what state the connection changed to.

To find out what the parameters are, you can listen to the socket with: nc -U /var/run/acpid.socket

Things done
  • Pass parameter with '%e' argument
  • Add example which takes advantage of parameters
  • Add and use new writeShellScript function
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests). There are no tests
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/) no binaries because is a module
  • Fits CONTRIBUTING.md.

Previously the parameters were just dropped. Now they can be read
from within the handler script. An example to show this is added.

Makes use of the new writeShellScript function as suggested in:
issue NixOS#21557

resolves:  NixOS#21557
@Mic92
Copy link
Member

Mic92 commented Feb 10, 2018

Sorry, I meant: writeShellScriptBin. No need introduce a new function for that.

@Mic92 Mic92 merged commit 713a69d into NixOS:master Feb 10, 2018
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.

acpid doesn't pass event text to event handlers
3 participants