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 5dd326f..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" @@ -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" },