lrc: add settings panel for separator (#172)

* added a basic settings panel

* fix lrc settings: nest translation keys and document settings in README

---------

Co-authored-by: shin01221 <mohamed@madin372.com>
This commit is contained in:
shin01221
2026-07-31 08:17:56 -04:00
committed by GitHub
co-authored by shin01221
parent c861c17e02
commit f9dc0d4a03
4 changed files with 41 additions and 3 deletions
+7 -1
View File
@@ -2,6 +2,8 @@ noctalia.setUpdateInterval(300)
local fetching = false
local mpdPlayer = "mpd"
local showSeparator = noctalia.getConfig("show_separator") ~= false
local separator = noctalia.getConfig("separator") or "| "
noctalia.runAsync("playerctl -l 2>/dev/null", function(r)
if r.exitCode == 0 then
@@ -47,7 +49,11 @@ function fetchLyrics(player)
if r.exitCode == 0 then
local text = r.stdout:gsub("%s+$", "")
if #text > 0 and text ~= "(no lyrics)" then
barWidget.setText("| " .. text)
local prefix = ""
if showSeparator then
prefix = separator
end
barWidget.setText(prefix .. text)
return
end
end