From 521429f1d56688bd1eae66098c82e1403191a090 Mon Sep 17 00:00:00 2001 From: rrzt <3382198490@qq.com> Date: Sat, 25 Jul 2026 02:12:18 +0800 Subject: [PATCH] feat(lyrics): update to 1.4.3 (#94) * feat(lyrics): update to 1.4.3 * fix(lyrics): rely on host scroll setting --- lyrics/README.md | 2 +- lyrics/lyrics.luau | 12 +++++++++++- lyrics/plugin.toml | 10 +++++++++- lyrics/translations/en.json | 4 ++++ lyrics/translations/zh-Hans.json | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lyrics/README.md b/lyrics/README.md index 7ea3946..f42685a 100644 --- a/lyrics/README.md +++ b/lyrics/README.md @@ -1,4 +1,4 @@ -# Noctalia Lyrics 1.4.2 +# Noctalia Lyrics 1.4.3 Synchronized lyrics for the Noctalia bar, with multiple MPRIS players, translation and romanization layers, configurable sources, karaoke highlighting, diff --git a/lyrics/lyrics.luau b/lyrics/lyrics.luau index 42c6604..f59e57e 100644 --- a/lyrics/lyrics.luau +++ b/lyrics/lyrics.luau @@ -4,6 +4,8 @@ noctalia.setUpdateInterval(33) local glyph = noctalia.getConfig("glyph") +local showGlyph = noctalia.getConfig("show_glyph") +if showGlyph == nil then showGlyph = true end local showArtist = noctalia.getConfig("show_artist") local hideWhenPaused = noctalia.getConfig("hide_when_paused") local showCover = noctalia.getConfig("show_cover") @@ -445,7 +447,7 @@ local function render() or coverShape == "square" and 0 or math.min(coverRadius, coverSize / 2) prefix[#prefix + 1] = ui.image({ path = coverPath, width = coverSize, height = coverSize, radius = radius, fit = "cover" }) - else + elseif showGlyph then prefix[#prefix + 1] = ui.glyph({ name = glyph, size = 14, @@ -580,6 +582,14 @@ function onRightClick() end) end +function onScroll(axis, steps) + if axis ~= "vertical" or playerInstance == "" then return end + local direction = tonumber(steps) or 0 + if direction == 0 then return end + local action = direction < 0 and "next" or "previous" + noctalia.runAsync("playerctl --player " .. shellQuote(playerInstance) .. " " .. action, function() end) +end + function update() local now = os.clock() local delta = lastClock > 0 and now - lastClock or 0 diff --git a/lyrics/plugin.toml b/lyrics/plugin.toml index 1e46edf..15b3687 100644 --- a/lyrics/plugin.toml +++ b/lyrics/plugin.toml @@ -1,6 +1,6 @@ id = "h465855hgg/lyrics" name = "Lyrics" -version = "1.4.2" +version = "1.4.3" plugin_api = 3 author = "h465855hgg" license = "MIT" @@ -461,11 +461,19 @@ entry = "lyrics_service.luau" id = "lyrics" entry = "lyrics.luau" + [[widget.setting]] + key = "show_glyph" + type = "bool" + label_key = "settings.show_glyph.label" + description_key = "settings.show_glyph.description" + default = true + [[widget.setting]] key = "glyph" type = "glyph" label_key = "settings.glyph.label" default = "music" + visible_when = { key = "show_glyph", values = ["true"] } [[widget.setting]] key = "show_artist" diff --git a/lyrics/translations/en.json b/lyrics/translations/en.json index b8a701a..5995edd 100644 --- a/lyrics/translations/en.json +++ b/lyrics/translations/en.json @@ -129,6 +129,10 @@ "glyph": { "label": "Glyph" }, + "show_glyph": { + "label": "Show glyph", + "description": "Display the configured glyph when no album cover is available." + }, "gradient": { "description": "Light up each character as the song progresses (karaoke style).", "label": "Per-character gradient" diff --git a/lyrics/translations/zh-Hans.json b/lyrics/translations/zh-Hans.json index 7ca3aa9..6137147 100644 --- a/lyrics/translations/zh-Hans.json +++ b/lyrics/translations/zh-Hans.json @@ -129,6 +129,10 @@ "glyph": { "label": "图标" }, + "show_glyph": { + "label": "显示图标", + "description": "没有专辑封面时显示设置的图标。" + }, "gradient": { "description": "根据播放进度逐字点亮当前歌词。", "label": "逐字渐变"