Files
community-plugins/screen-toolkit/shortcut.luau
T
87ef0483dc screen-toolkit: add compact/full panel modes, mode-aware toggle, and … (#237)
* screen-toolkit: add compact/full panel modes, mode-aware toggle, and full documentation

* screen-toolkit: restrict compact tile hover/click to icon and label

* screen-toolkit: full-mode hover border on tile, mirror compact colors

* screen-toolkit: add plugin thumbnail screenshot

---------

Co-authored-by: Ahmed5Emad <ahmed5emad@users.noreply.github.com>
2026-08-03 22:38:07 -04:00

29 lines
943 B
Luau

--!nonstrict
-- Screen Toolkit — control-center [[shortcut]] tile.
--
-- Mirrors the bar widget: shows the recording state and toggles the main
-- panel. Drives the [[service]] through the "command"
-- state channel — no shell-out, no IPC PATH dependency.
local recording = false
local function apply()
shortcut.setLabel(recording and noctalia.tr("shortcut.recording") or noctalia.tr("shortcut.label"))
shortcut.setIcon("crosshair", "crosshair")
shortcut.setActive(recording)
end
noctalia.state.watch("recording", function(value)
recording = value == true
apply()
end)
function onClick()
-- The shortcut tile never stops a recording; it just opens the panel so
-- the stop button (in the panel header, next to the close X) is reachable.
local panelId = noctalia.getConfig("panel-mode") == "full" and "alexander/screen-toolkit:panel-full" or "alexander/screen-toolkit:panel"
noctalia.togglePanel(panelId)
end
apply()