feat: add keybind cheatsheet plugin (#64)

* feat: add keybind cheatsheet

* docs: refresh keybind cheatsheet preview

* docs: use official generated keybind thumbnail

* feat(keybind-cheatsheet): preload cached snapshots

Move parser and cache ownership into an event-driven data service so the panel opens from a prepared last-known-good snapshot. Document the plugin's inspiration and independent v5 implementation.
This commit is contained in:
cheerfulScumbag
2026-07-21 19:50:47 -04:00
committed by GitHub
parent 17f7b819d3
commit 2a1efe0468
19 changed files with 2985 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
--!nonstrict
-- Static, event-only bar entry. Parsing and cache ownership belong to the data
-- service; this widget only toggles the panel or requests a refresh.
local PANEL_ID = "kenn/keybind-cheatsheet:cheatsheet"
local REFRESH_REQUEST_KEY = "keybind-cheatsheet.refresh-request"
local function render()
barWidget.setGlyph(noctalia.getConfig("glyph") or "keyboard")
barWidget.setTooltip(noctalia.tr("widget_tooltip"))
end
function onClick()
noctalia.togglePanel(PANEL_ID)
end
function onIpc(event, _payload)
if event == "toggle" then
noctalia.togglePanel(PANEL_ID)
elseif event == "refresh" then
local generation = tonumber(noctalia.state.get(REFRESH_REQUEST_KEY)) or 0
noctalia.state.set(REFRESH_REQUEST_KEY, generation + 1)
end
end
render()