-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathaccent-cycler.lua
More file actions
24 lines (22 loc) · 727 Bytes
/
Copy pathaccent-cycler.lua
File metadata and controls
24 lines (22 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- accent-cycler: a `cycle_accent` command that rotates the theme accent color at runtime.
--
-- Theme overrides from set_theme are runtime-only; they reset when spotatui restarts.
--
-- Install (single file):
-- cp accent-cycler.lua ~/.config/spotatui/plugins/
--
-- Suggested binding, in ~/.config/spotatui/config.yml:
-- plugin_commands:
-- cycle_accent: "ctrl-y"
local accents = { "Magenta", "Cyan", "Green", "Yellow", "Red", "Blue" }
local index = 0
spotatui.register_command("cycle_accent", function()
index = (index % #accents) + 1
local color = accents[index]
spotatui.set_theme({
playbar_progress = color,
hint = color,
selected = color,
})
spotatui.notify("Accent: " .. color, 2)
end)