From b5586a88a053bcdc73a5ecb9719f8ff3f6f4b9ca Mon Sep 17 00:00:00 2001 From: Nousad Date: Fri, 26 Jun 2026 20:21:13 +0200 Subject: [PATCH] feat(bongocat): add executable_path setting --- bongocat/README.md | 1 + bongocat/bongocat.luau | 11 ++++++++--- bongocat/plugin.toml | 6 ++++++ bongocat/translations/en.json | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bongocat/README.md b/bongocat/README.md index 699ac50..184b5cc 100644 --- a/bongocat/README.md +++ b/bongocat/README.md @@ -38,6 +38,7 @@ Audio reactivity uses Noctalia's PipeWire spectrum callback. | Setting | Type | Default | Description | | --- | --- | --- | --- | | `input_devices` | `string_list` | `[]` | Input device paths or globs to read with `evtest`. | +| `executable_path` | `file` | `evtest` | Path to the input reader executable. | | `audio_spectrum` | `bool` | `false` | Enables PipeWire audio spectrum events. | | `tappy_mode` | `bool` | `false` | Makes the cat tap its paws to detected beats. | | `rave_mode` | `bool` | `false` | Flashes cat colors on detected beats. | diff --git a/bongocat/bongocat.luau b/bongocat/bongocat.luau index 939dc5a..da04344 100644 --- a/bongocat/bongocat.luau +++ b/bongocat/bongocat.luau @@ -229,13 +229,18 @@ local function startInputReader() if #patterns == 0 then return end - if not noctalia.commandExists("evtest") then - noctalia.notifyError("Bongo Cat", "evtest is not installed — cannot read input devices") + + local executable = barWidget.getConfig("executable_path") or "evtest" + + if not noctalia.commandExists(executable) then + noctalia.notifyError("Bongo Cat", "the evtest path is invalid (" .. executable .. ") — cannot read input devices") return end local command = "for device in " .. table.concat(patterns, " ") - .. '; do [ -e "$device" ] || continue; evtest "$device" 2>/dev/null & done; wait' + .. '; do [ -e "$device" ] || continue; ' .. executable + .. ' "$device" 2>/dev/null & done; wait' + if not noctalia.runStream(command, onEvtestLine) then noctalia.notifyError("Bongo Cat", "Unable to start input device reader") end diff --git a/bongocat/plugin.toml b/bongocat/plugin.toml index 12893b1..500d99b 100644 --- a/bongocat/plugin.toml +++ b/bongocat/plugin.toml @@ -27,6 +27,12 @@ entry = "bongocat.luau" description_key = "settings.input_devices.description" default = [] + [[widget.setting]] + key = "executable_path" + type = "file" + label_key = "settings.executable_path.label" + default = "evtest" + [[widget.setting]] key = "audio_spectrum" type = "bool" diff --git a/bongocat/translations/en.json b/bongocat/translations/en.json index b8b188a..1c6e947 100644 --- a/bongocat/translations/en.json +++ b/bongocat/translations/en.json @@ -4,6 +4,9 @@ "label": "Input devices", "description": "Prefer /dev/input/by-id/*-event-* or /dev/input/by-path/*-event-*; /dev/input/eventN can change after kernel or device updates" }, + "executable_path": { + "label": "Alternative evtest binary" + }, "audio_spectrum": { "label": "React to audio" },