SYSTEMD-GPIO(5)
NAME
systemd-gpio - run commands when a button on a GPIO pin is pressed
DESCRIPTION
Use systemd to configure commands to run when a button attached to a GPIO pin is pressed, released, or held.
To configure a GPIO pin, create a file called /etc/gpio/N, where N is an integer pin number following the gpiozero pin numbering convention. Once you have populated the configuration file, activate the button by running the following command, replacing N with the pin number:
sudo systemctl enable --now gpio@N.service
ENVIRONMENT
Button behavior. See the documentation for the corresponding constructor arguments of gpiozero.Button.
Commands to run when the button is held, pressed, or released, respectively. See the documentation for the corresponding properties of gpiozero.Button.
FILES
/etc/gpio/N
Configuration file for GPIO pin N, where N corresponds to the gpiozero pin numbering. The file should be in the systemd EnvironmentFile syntax and may define any of the environment variables listed above.
HISTORY
This project is inspired by https://github.com/ali1234/systemd-gpio. The main difference is that we are using gpiozero rather than WiringPi, because WiringPi is no longer maintained.
EXAMPLES
The following example configures GPIO 23 so that when it is pressed, it prints a message to all TTYs, and when held, shuts down the machine:
# /etc/gpio/23 GPIO_HOLD_TIME=5 GPIO_WHEN_PRESSED="wall 'Hold the power button for 5 seconds to power off.'" GPIO_WHEN_HELD=poweroff
To activate the pin, run the following command:
sudo systemctl enable --now gpio@23.service
SEE ALSO
systemctl(1), systemd.exec(5)
Metadata
Release files for systemd-gpio 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| systemd-gpio-0.1.0.tar.gz | 7.9 kB | Without provenance | Details for systemd-gpio-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| systemd_gpio-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for systemd_gpio-0.1.0-py3-none-any.whl |
Total release size: 15.8 kB
Release files / systemd-gpio-0.1.0.tar.gz
| Download URL | systemd-gpio-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd24b5408aa11ccfdbd90facd0a98928667a6cdf76d789d0355e17cb9aa91c16
|
|
BLAKE2b-256 checksum How to use checksums |
6fd64227147c96e4e08dbc159dc0d2161b596c2a95c92c3a16312fec914a2ca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / systemd_gpio-0.1.0-py3-none-any.whl
| Download URL | systemd_gpio-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f353da781b3698025b24c11492dce83228e85b8b4aaa6f6c2c33d79d1c519c9d
|
|
BLAKE2b-256 checksum How to use checksums |
59618c0873456ed162bae112629e97b513aeb1439e614115ecdca086db0aeacf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for systemd-gpio 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.