{"id":15461171,"url":"https://github.com/arkanosis/smhkd","last_synced_at":"2025-07-13T18:35:10.139Z","repository":{"id":60575810,"uuid":"544072962","full_name":"Arkanosis/smhkd","owner":"Arkanosis","description":"Simple MIDI hotkontrol daemon","archived":false,"fork":false,"pushed_at":"2024-07-16T14:38:22.000Z","size":47,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T10:37:29.317Z","etag":null,"topics":["alsa","audio","daemon","linux","midi","midi-controller","pipewire","pulseaudio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arkanosis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-01T15:15:23.000Z","updated_at":"2024-07-16T14:38:26.000Z","dependencies_parsed_at":"2024-10-01T23:41:05.936Z","dependency_job_id":"a3760fc7-e7ea-45ae-bb1e-10c481b72363","html_url":"https://github.com/Arkanosis/smhkd","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"cb1784b5ddda5a4e68090e6d6d749a7b5d85f456"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkanosis%2Fsmhkd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkanosis%2Fsmhkd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkanosis%2Fsmhkd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkanosis%2Fsmhkd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arkanosis","download_url":"https://codeload.github.com/Arkanosis/smhkd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250221944,"owners_count":21394790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alsa","audio","daemon","linux","midi","midi-controller","pipewire","pulseaudio"],"created_at":"2024-10-01T23:40:57.465Z","updated_at":"2025-04-22T10:37:38.819Z","avatar_url":"https://github.com/Arkanosis.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smhkd [![](https://img.shields.io/crates/v/smhkd.svg)](https://crates.io/crates/smhkd) [![License](https://img.shields.io/badge/license-ISC-blue.svg)](/LICENSE)\n\n**smhkd** (Simple MIDI hotkontrol daemon) is a daemon that reacts to MIDI events by executing commands.\n\nIt's inspired by [sxhkd](https://github.com/baskerville/sxhkd), but handles ALSA MIDI events rather than X events.\n\n# Current Status\n\nsmhkd is still in design phase and not yet ready for mainstream usage.\n\nAt the moment, *and at the moment only*, it reads a configuration file in `~/.config/smhkd/smhkdrc.json`, which looks like this:\n\n```json\n{\n    \"@nanoKONTROL2\": {\n        \"0\": \"pactl set-sink-volume @DEFAULT_SINK@ $VALUE%\",\n        \"+32\": \"pactl set-sink-volume @DEFAULT_SINK@ 100%\",\n        \"+48\": \"pactl set-sink-volume @DEFAULT_SINK@ 30%\",\n        \"+64\": \"pactl set-sink-volume @DEFAULT_SINK@ 0%\",\n\n        \"+41\": \"playerctl play-pause\",\n        \"+42\": \"playerctl stop\",\n        \"+43\": \"playerctl position 15-\",\n        \"+44\": \"playerctl position 15+\",\n        \"+58\": \"playerctl previous\",\n        \"+59\": \"playerctl next\",\n\n        \"+61\": \"ddcutil --display 2 setvcp 60 0x11\",\n        \"+62\": \"ddcutil --display 2 setvcp 60 0x0f\",\n\n        \"7\": \"v4l2-ctl -d /dev/video0 --set-ctrl=zoom_absolute=$VALUE\"\n    },\n    \"129:0\": {\n        \"1\": \"pactl set-sink-volume @DEFAULT_SINK@ $VALUE%\",\n        \"+67\": \"pactl set-sink-volume @DEFAULT_SINK@ 100%\",\n        \"+66\": \"pactl set-sink-volume @DEFAULT_SINK@ 30%\",\n        \"+64\": \"pactl set-sink-volume @DEFAULT_SINK@ 0%\"\n    }\n}\n```\n\nand it listens to each pair of client and port (`28:0` — where `28` is the client number for `nanoKONTROL2` and `0` the first available port for it — `129:0` and so on…) for MIDI events.\n\nEvery 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. Buttons are usually associated with value 127 for press and value 0 for release, so to avoid buttons running commands twice, you can prefix the controller ID with either `+` (to run command on press) or `-` (to run command on release). In the example above, it:\n - sets the volume of a PulseAudio sink (which can actually be a PipeWire);\n - controls a music / video player;\n - switches the active input source of a DisplayPort / HDMI monitor;\n - sets the zoom level of a webcam\n\nbut any command could be executed instead.\n\nKeep 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.\n\n## Usage\n\n```\nUsage: smhkd list\n       smhkd run\n       smhkd -h | --help\n       smhkd --version\n\nCommands:\n    list                     List available MIDI controllers.\n    run                      Listen to MIDI events and run commands.\n\nArguments:\n\nOptions:\n    -h, --help               Show this screen.\n    --version                Show version.\n```\n\n## Running on startup\n\nRun `systemctl --user enable --now smhkd` after installing.\n\n## Compiling\n\nRun `cargo build --release` in your working copy.\n\n## Contributing and reporting bugs\n\nContributions are welcome through [GitHub pull requests](https://github.com/Arkanosis/smhkd/pulls).\n\nPlease report bugs and feature requests on [GitHub issues](https://github.com/Arkanosis/smhkd/issues).\n\n## License\n\nsmhkd is copyright (C) 2022-2024 Jérémie Roquet \u003cjroquet@arkanosis.net\u003e and licensed under the ISC license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkanosis%2Fsmhkd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farkanosis%2Fsmhkd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkanosis%2Fsmhkd/lists"}