Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bongocat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
11 changes: 8 additions & 3 deletions bongocat/bongocat.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions bongocat/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions bongocat/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down