make timeout configurable

This commit is contained in:
Daylin Morgan 2024-10-21 19:16:09 -05:00
parent f73bbbd0d3
commit 7a06a2a28c
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 3 additions and 3 deletions

View file

@ -157,9 +157,8 @@ proc handleHyprEvent(e: string) =
notify("eww failed:\n" & output) notify("eww failed:\n" & output)
proc maybeTriggerSwww(last: var DateTime) = proc maybeTriggerSwww(last: var DateTime) =
const swwwTimeout = 10 # seconds
let current = now() let current = now()
if (current - last).inSeconds > swwwTimeout: if (current - last).inSeconds > config.timeout:
oneShotSwww() oneShotSwww()
last = current last = current

View file

@ -13,7 +13,8 @@ proc notify*(message: string) =
type type
Icons = Table[string, string] Icons = Table[string, string]
Config = object # config vs icons? Config = object # config vs icons?
wallpapers* {.defaultVal: ""}: string timeout* {.defaultVal: 60.}: int
wallpapers* {.defaultVal: "".}: string
classes*: Icons classes*: Icons
`no-client`*: string `no-client`*: string
`default-icon`*: string `default-icon`*: string