fix(eyecare): reflect configurable break duration in notification message (#92)

Fixes #63
This commit is contained in:
Apex077
2026-07-24 14:11:38 -04:00
committed by GitHub
parent 85e5dd68f0
commit 706864b3b2
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
id = "apex077/eyecare" id = "apex077/eyecare"
name = "Eye-Care Reminders" name = "Eye-Care Reminders"
version = "1.0.0" version = "1.0.1"
plugin_api = 3 plugin_api = 3
author = "Apex077" author = "Apex077"
license = "MIT" license = "MIT"
+3 -2
View File
@@ -24,6 +24,7 @@ local settings = getSettings()
function onConfigChanged() function onConfigChanged()
settings = getSettings() settings = getSettings()
noctalia.log("eyecare: settings updated") noctalia.log("eyecare: settings updated")
updateState()
end end
-- Play a notification sound using system players -- Play a notification sound using system players
@@ -119,7 +120,7 @@ function update()
if settings.enable_notifications then if settings.enable_notifications then
noctalia.notify( noctalia.notify(
noctalia.tr("notifications.eyecare-break-title"), noctalia.tr("notifications.eyecare-break-title"),
noctalia.tr("notifications.eyecare-break-body") noctalia.tr("notifications.eyecare-break-body", { seconds = settings.break_duration_seconds })
) )
end end
if settings.enable_sound then if settings.enable_sound then
@@ -142,7 +143,7 @@ local function triggerBreak()
if settings.enable_notifications then if settings.enable_notifications then
noctalia.notify( noctalia.notify(
noctalia.tr("notifications.eyecare-break-title"), noctalia.tr("notifications.eyecare-break-title"),
noctalia.tr("notifications.eyecare-break-body") noctalia.tr("notifications.eyecare-break-body", { seconds = settings.break_duration_seconds })
) )
end end
if settings.enable_sound then if settings.enable_sound then
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"notifications": { "notifications": {
"eyecare-break-body": "Focus on an object 20 feet away for 20 seconds.", "eyecare-break-body": "Focus on an object 20 feet away for {seconds} seconds.",
"eyecare-break-finished-body": "Your eyes are rested. You can return to your screen.", "eyecare-break-finished-body": "Your eyes are rested. You can return to your screen.",
"eyecare-break-finished-title": "Break finished", "eyecare-break-finished-title": "Break finished",
"eyecare-break-title": "Time for a break" "eyecare-break-title": "Time for a break"