overwatch

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: GPL-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Overwatch - monitor GPIO Pins for activity

Overwatch is a small tool we use in Rook to implement the on-device Keys. It monitors the three GPIO Pins for a Low signal (including debouncing) and executes a program upon pressing them.

Which commands to execute and which Pins to monitor is configured by a simple JSON configuration file. To run overwatch standalone, simply run overwatch /path/to/config/file.

Configuration Sample

A configuration file has to look like this:

{
    "pins": [
        {
            "pin_number": 17,
            "command": "/usr/bin/command1",
            "pressed_file": "/path/to/file1"
        },
        {
            "pin_number": 27,
            "command": "/usr/bin/command2",
            "pressed_file": "/path/to/file2"
        },
        {
            "pin_number": 22,
            "command": "/usr/bin/command3",
            "pressed_file": "/path/to/file3"
        }
    ]
}

The files given in the pressed_file property are created when a button is pressed and deleted once the button is released. You can use those files to poll for the buttons outside of the scripts executed by overwatch. The pressed_file properties are optional and can be omitted.

Sample systemd Unit File

To run Overwatch as a systemd service, you can create a unit file like the following:

[Unit]
Description=Overwatch GPIO Monitor
After=network.target

[Service]
ExecStart=/path/to/overwatch /path/to/config/file
Restart=on-failure
User=root

[Install]
WantedBy=multi-user.target

Save this file as /etc/systemd/system/overwatch.service, then enable and start the service using:

sudo systemctl enable --now overwatch.service

Development

Packages are created with nfpm

VERSION=1.0.0 make package

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址