Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions screen_recorder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
38 changes: 37 additions & 1 deletion screen_recorder/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 16 additions & 5 deletions screen_recorder/recorder.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
17 changes: 17 additions & 0 deletions screen_recorder/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down