refactor: enforce noctalia.getConfig across community plugins

This commit is contained in:
Lemmy
2026-07-15 00:22:44 -04:00
parent 8ab6eef6eb
commit 05820914d3
10 changed files with 131 additions and 19 deletions
+4 -4
View File
@@ -13,10 +13,10 @@ function update()
local secondsSinceMidnight: number = (os.time() + BIEL_OFFSET_SECONDS) % 86400 -- 86400 = seconds in one day
local totalCentibeats: number = math.floor(secondsSinceMidnight / SECONDS_PER_CENTIBEAT)
-- define display of subbeat toggle
local useCentibeats: boolean = barWidget.getConfig("show_centibeats")
local useCentibeats: boolean = noctalia.getConfig("show_centibeats")
-- define display of @beats toggle
local showSuffix: boolean = barWidget.getConfig("beat_display")
local timeFormatToggle: boolean = barWidget.getConfig("time_format_toggle")
local showSuffix: boolean = noctalia.getConfig("beat_display")
local timeFormatToggle: boolean = noctalia.getConfig("time_format_toggle")
local checkValue: number = useCentibeats and totalCentibeats or math.floor(totalCentibeats / 100)
-- layout updates when values tick
if checkValue ~= lastValue then
@@ -42,4 +42,4 @@ function update()
-- defines targeting of next whole beat change (+100ms padding)
noctalia.setUpdateInterval(math.floor((secondsToNextBeat * 1000) + 100))
end
end
end