Commit Graph

70 Commits

Author SHA1 Message Date
felixzsh 840e7c2e13 Point README folder references at the renamed repo 2026-08-11 15:25:34 -05:00
felixzsh cabdf1307c Treat key combinations as a unit (combos)
The display now only updates on key-down (the combo grows as you press)
and when the last key is released (the empty payload starts the linger
with the last full combo). Intermediate releases no longer shrink the
display, so the order you let go of a shortcut doesn't matter: Ctrl+Shift+N
stays Ctrl+Shift+N whether Ctrl, Shift, or N goes up first, and the 1s
linger shows the full combo instead of a partial release state. Matches
the keybinding-tutorial use case better than keyviz, which shrinks
key-by-key on spaced releases.
2026-08-11 14:57:45 -05:00
felixzsh f53d2553d6 Document the stale-component caveat after plugin updates 2026-08-11 14:18:05 -05:00
felixzsh 34646dec28 Fix pause toggle: never delete the flag file
The FileView watcher fires on content changes but not on deletion, so
resuming (rm of the flag) left the panel and the menu stuck paused.
Rewrite the flag with 0 or 1 instead, matching the state-file pattern
that already works.
2026-08-11 14:03:12 -05:00
felixzsh f255fa05e9 Fix the Show keys toggle: flip the real paused state
ToggleSwitch does not flip checked on click — it only emits toggled()
and the caller owns the value. Reading !checked there yielded the
current bound state, so setPaused's guard always early-returned and the
toggle never did anything. Flip !root.paused instead; the checked
binding follows the flag file.
2026-08-11 13:58:48 -05:00
felixzsh ccce10d393 Document the new config location and why it lives outside the plugin dir 2026-08-11 13:42:24 -05:00
felixzsh 5670aca888 Move config out of the plugin dir so edits don't reload the plugin
The shell watches every file under ~/.config/omarchy/plugins/ with
inotify (no extension filter) and reloads all plugin code on any change,
so config.json there made every edit tear down and rebuild the panel and
bar widget. Config now lives at ~/.config/omarchy/key-visualizer.json, which
is not watched: edits update the display live. The panel migrates the
old plugin-dir config (values carried over, file removed) on first load
after the update.
2026-08-11 13:42:24 -05:00
felixzsh c0d491db29 Document the bar menu and the enable/rescan note 2026-08-11 13:26:32 -05:00
felixzsh 949f41a6be Turn the bar widget into a menu with toggle and display options
Clicking the keyboard glyph now opens a KeyboardPanel popup (the native
bar pattern, e.g. omarchy.audio) instead of toggling pause directly:
Show keys toggle, Mode (all | bindings), and Position (bottom/top/
center). The toggle writes the pause flag and the options write
config.json, both watched by the display panel, so menu and overlay
stay in sync across monitors. Replaces BarWidget.qml with a Panel-based
widget (Panel + BarIconButton + KeyboardPanel).
2026-08-11 13:26:32 -05:00
felixzsh 1b2128e6f1 Keep the bar button glyph in foreground color
active would paint the glyph with the urgent color while running, which
reads backwards for a toggle; dimmed alone is the paused cue.
2026-08-11 11:08:15 -05:00
felixzsh 1f532510a5 Make display options configurable via config.json
The panel reads config.json from its plugin folder (seeded with defaults
on first run, hot-reloaded on save): mode (all | bindings — the bindings
mode only shows combos with a modifier, ideal for keybinding tutorials),
position (keyviz-style alignment, bottom-center by default) and margin,
plus the existing lingerMs. Replaces the hardcoded bottom anchors with
x/y computed from position and margin.
2026-08-11 11:07:47 -05:00
felixzsh bd20dd8a9b Add bar widget to pause and resume the key display
A keyboard glyph in the bar (WidgetButton, right section by default)
toggles a pause flag at $XDG_RUNTIME_DIR/omarchy-key-visualizer.paused that
the panel and every bar widget instance watch, so a click on any monitor
updates all of them. While paused the panel ignores key state and hides;
the button dims. Also exposes pause/resume/toggle over the key-visualizer IPC
target.
2026-08-11 11:06:37 -05:00
felixzsh 7ab4d2f18d Linger on screen after release, keyviz-style
Previously the chips cleared the instant the keys were released, so the
120ms hide delay was invisible. Keep the last combo rendered for the
whole linger window and only clear it when the timer fires, so a quick
tap stays readable (keyviz keeps keys for lingerDurationMs, 5s by
default). Default 1000ms, tunable via lingerMs.
2026-08-11 10:52:54 -05:00
felixzsh 4955c33767 Auto-inject the Hyprland capture hook on plugin load
The capture script must run inside Hyprland's Lua config, but a plugin
cannot register itself in the user-owned hyprland.lua. On first load the
panel appends a small guarded block that dofiles key-visualizer.lua; Hyprland
auto-reloads its config on save, so install is now just add + enable.

The block is idempotent (marker comment), upgrades older plain dofile
lines, and no-ops when the plugin folder is removed so uninstalling never
breaks the config.
2026-08-11 10:11:35 -05:00
felixzsh 64e44c299b Rename plugin id to felixzsh.key-visualizer
omarchy plugin validate rejects the omarchy.* namespace: it is reserved
for first-party plugins. Use the third-party <user>.<name> convention.
2026-08-11 09:58:37 -05:00
felixzsh 96446661b3 Add install and usage docs 2026-08-11 09:53:48 -05:00
felixzsh d0a36e79dd Add key-visualizer panel UI 2026-08-11 09:53:48 -05:00
felixzsh 40bd0dd1f1 Add Hyprland Lua key capture 2026-08-11 09:53:48 -05:00
felixzsh 8cccf21f17 Add plugin manifest 2026-08-11 09:53:48 -05:00
felixzsh 7dcfee467e Add MIT license and gitignore 2026-08-11 09:53:48 -05:00