From 1e6f7e7920ab6cce276afb8192cd6f733e25e8a8 Mon Sep 17 00:00:00 2001 From: John Mylchreest Date: Thu, 27 Aug 2026 13:46:17 +0100 Subject: [PATCH 1/2] feat(screen_recorder): configurable bar glyph per state The bar widget hardcoded its glyph for each state, so the only way to change one was to edit recorder.luau and lose it on the next update. Five settings, one per state the widget renders: unavailable, idle, pending, recording, replaying. Each defaults to the glyph that state already used, and an unset or empty value falls back to the same, so this is a no-op until someone sets one. The case that prompted it: Tabler carries filled variants of most outline icons, so `glyph_recording = "video-filled"` makes the active state read as a solid camera rather than an outline one that differs from idle only by colour. Left out of the defaults deliberately, since that is a taste change rather than a fix. Colours are untouched: recording stays `error`, pending `primary`, replaying `secondary`. --- screen_recorder/plugin.toml | 36 ++++++++++++++++++++++++++++ screen_recorder/recorder.luau | 21 ++++++++++++---- screen_recorder/translations/en.json | 17 +++++++++++++ 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/screen_recorder/plugin.toml b/screen_recorder/plugin.toml index 5dd326f..b52e0a0 100644 --- a/screen_recorder/plugin.toml +++ b/screen_recorder/plugin.toml @@ -144,6 +144,42 @@ type = "bool" label_key = "settings.hide_inactive.label" default = false +# Bar glyph per state. Defaults are the values the widget previously hardcoded, +# so this changes nothing until someone sets one. Tabler carries filled variants +# of most outline icons, so "video-filled" is the usual pick for `recording` if +# you want the active state to read as solid rather than outline. +[[setting]] +key = "glyph_unavailable" +type = "glyph" +label_key = "settings.glyph_unavailable.label" +description_key = "settings.glyph_unavailable.description" +default = "video-off" + +[[setting]] +key = "glyph_idle" +type = "glyph" +label_key = "settings.glyph_idle.label" +default = "video" + +[[setting]] +key = "glyph_pending" +type = "glyph" +label_key = "settings.glyph_pending.label" +description_key = "settings.glyph_pending.description" +default = "video" + +[[setting]] +key = "glyph_recording" +type = "glyph" +label_key = "settings.glyph_recording.label" +default = "video" + +[[setting]] +key = "glyph_replaying" +type = "glyph" +label_key = "settings.glyph_replaying.label" +default = "repeat" + [[setting]] key = "replay_enabled" type = "bool" diff --git a/screen_recorder/recorder.luau b/screen_recorder/recorder.luau index f18e6bd..b563a98 100644 --- a/screen_recorder/recorder.luau +++ b/screen_recorder/recorder.luau @@ -19,6 +19,17 @@ local function send(action) noctalia.state.set("command", { action = action, focusedOutputName = noctalia.focusedOutputName() }) end +-- Glyph per state, configurable. The fallback passed to each lookup is the +-- value this widget used before the settings existed, so an unset or blank +-- glyph keeps the previous appearance. +local function glyphFor(key, fallback) + local configured = noctalia.getConfig(key) + if type(configured) == "string" and configured ~= "" then + return configured + end + return fallback +end + local function applyStatus(status) if type(status) == "table" then state = status.state or "idle" @@ -28,29 +39,29 @@ local function applyStatus(status) local hideInactive = noctalia.getConfig("hide_inactive") if not available then - barWidget.setGlyph("video-off") + barWidget.setGlyph(glyphFor("glyph_unavailable", "video-off")) barWidget.setGlyphColor("on_surface_variant") barWidget.setVisible(not hideInactive) return end if state == "recording" then - barWidget.setGlyph("video") + barWidget.setGlyph(glyphFor("glyph_recording", "video")) barWidget.setGlyphColor("error") barWidget.setColor("error") barWidget.setVisible(true) elseif table.find(PENDING_STATES, state) then - barWidget.setGlyph("video") + barWidget.setGlyph(glyphFor("glyph_pending", "video")) barWidget.setGlyphColor("primary") barWidget.setColor("primary") barWidget.setVisible(true) elseif state == "replaying" then - barWidget.setGlyph("repeat") + barWidget.setGlyph(glyphFor("glyph_replaying", "repeat")) barWidget.setGlyphColor("secondary") barWidget.setColor("secondary") barWidget.setVisible(true) else - barWidget.setGlyph("video") + barWidget.setGlyph(glyphFor("glyph_idle", "video")) barWidget.setGlyphColor("on_surface") barWidget.setVisible(not hideInactive) end diff --git a/screen_recorder/translations/en.json b/screen_recorder/translations/en.json index d42a7a3..5878ea9 100644 --- a/screen_recorder/translations/en.json +++ b/screen_recorder/translations/en.json @@ -54,6 +54,23 @@ "frame_rate": { "label": "Frame Rate" }, + "glyph_idle": { + "label": "Glyph: Idle" + }, + "glyph_pending": { + "label": "Glyph: Starting", + "description": "Shown while a recording or replay buffer is starting." + }, + "glyph_recording": { + "label": "Glyph: Recording" + }, + "glyph_replaying": { + "label": "Glyph: Replay Buffer" + }, + "glyph_unavailable": { + "label": "Glyph: Unavailable", + "description": "Shown when gpu-screen-recorder is not installed." + }, "hide_inactive": { "label": "Hide Widget When Idle" }, From 66f627b2ba61b0c2559bc80c1141d2b13e78eaad Mon Sep 17 00:00:00 2001 From: Lemmy Date: Sun, 30 Aug 2026 11:34:40 -0400 Subject: [PATCH 2/2] fix(screen_recorder): bump version to 1.2.3 and document glyph settings --- screen_recorder/README.md | 5 +++++ screen_recorder/plugin.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/screen_recorder/README.md b/screen_recorder/README.md index aea5b55..f286a17 100644 --- a/screen_recorder/README.md +++ b/screen_recorder/README.md @@ -63,6 +63,11 @@ Replay controls are available only when `replay_enabled` is true. | `color_range` | `select` | `limited` | Uses limited or full color range. | | `copy_to_clipboard` | `bool` | `false` | Copies the saved recording URI to the clipboard. | | `hide_inactive` | `bool` | `false` | Hides the bar widget while idle. | +| `glyph_unavailable` | `glyph` | `video-off` | Bar glyph when gpu-screen-recorder is not installed. | +| `glyph_idle` | `glyph` | `video` | Bar glyph when idle. | +| `glyph_pending` | `glyph` | `video` | Bar glyph while a recording or replay buffer is starting. | +| `glyph_recording` | `glyph` | `video` | Bar glyph while recording. | +| `glyph_replaying` | `glyph` | `repeat` | Bar glyph while the replay buffer is running. | | `replay_enabled` | `bool` | `false` | Enables replay-buffer controls. | | `replay_duration` | `int` | `30` | Replay buffer duration in seconds. | | `replay_storage` | `select` | `ram` | Stores replay data in RAM or on disk. | diff --git a/screen_recorder/plugin.toml b/screen_recorder/plugin.toml index b52e0a0..be575df 100644 --- a/screen_recorder/plugin.toml +++ b/screen_recorder/plugin.toml @@ -12,7 +12,7 @@ id = "noctalia/screen_recorder" name = "Screen Recorder" -version = "1.2.2" +version = "1.2.3" plugin_api = 3 author = "noctalia" license = "MIT"