smhkd

Crates.iosmhkd
lib.rssmhkd
version0.2.0
sourcesrc
created_at2022-10-01 15:35:54.786109
updated_at2022-12-06 23:41:43.912928
descriptionSimple MIDI hotkontrol daemon
homepagehttps://github.com/Arkanosis/smhkd
repositoryhttps://github.com/Arkanosis/smhkd
max_upload_size
id677877
size25,778
Jérémie Roquet (Arkanosis)

documentation

https://github.com/Arkanosis/smhkd

README

smhkd License

smhkd (Simple MIDI hotkontrol daemon) is a daemon that reacts to MIDI events by executing commands.

It's inspired by sxhkd, but handles ALSA MIDI events rather than X events.

Current Status

smhkd is still in design phase and not yet ready for mainstream usage.

At the moment, and at the moment only, it reads a configuration file in ~/.config/smhkd/smhkdrc.json, which looks like this:

{
    "28:0": {
        "0": "pactl set-sink-volume @DEFAULT_SINK@ $VALUE%",
        "32": "pactl set-sink-volume @DEFAULT_SINK@ 100%",
        "48": "pactl set-sink-volume @DEFAULT_SINK@ 30%",
        "64": "pactl set-sink-volume @DEFAULT_SINK@ 0%"
    },
    "129:0": {
        "1": "pactl set-sink-volume @DEFAULT_SINK@ $VALUE%",
        "67": "pactl set-sink-volume @DEFAULT_SINK@ 100%",
        "66": "pactl set-sink-volume @DEFAULT_SINK@ 30%",
        "64": "pactl set-sink-volume @DEFAULT_SINK@ 0%"
    }
}

and it listens to each pair of client and port (28:0, 129:0 and so on…) for MIDI events.

Every time it receives an event, it runs the command associated with the controller ID (if any). Occurences of $VALUE in that command are replaced with the value of the event.

Keep in mind that this configuration format is only temporary and will ultimately be replaced with something more similar to what sxhkd uses. There is no plan to provide backward compatibility with JSON or even a migration path when than happens.

Usage

Usage: smhkd list
       smhkd run
       smhkd -h | --help
       smhkd --version

Commands:
    list                     List available MIDI controllers.
    run                      Listen to MIDI events and run commands.

Arguments:

Options:
    -h, --help               Show this screen.
    --version                Show version.

Compiling

Run cargo build --release in your working copy.

Contributing and reporting bugs

Contributions are welcome through GitHub pull requests.

Please report bugs and feature requests on GitHub issues.

License

smhkd is copyright (C) 2022 Jérémie Roquet jroquet@arkanosis.net and licensed under the ISC license.

Commit count: 13

cargo fmt