From 7a06a2a28c546b172dca79a35b5b12476d7e24da Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 21 Oct 2024 19:16:09 -0500 Subject: [PATCH] make timeout configurable --- src/hyprland.nim | 3 +-- src/lib.nim | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hyprland.nim b/src/hyprland.nim index 1b808d5..8a8bcbc 100644 --- a/src/hyprland.nim +++ b/src/hyprland.nim @@ -157,9 +157,8 @@ proc handleHyprEvent(e: string) = notify("eww failed:\n" & output) proc maybeTriggerSwww(last: var DateTime) = - const swwwTimeout = 10 # seconds let current = now() - if (current - last).inSeconds > swwwTimeout: + if (current - last).inSeconds > config.timeout: oneShotSwww() last = current diff --git a/src/lib.nim b/src/lib.nim index 6a4a196..d06934f 100644 --- a/src/lib.nim +++ b/src/lib.nim @@ -13,7 +13,8 @@ proc notify*(message: string) = type Icons = Table[string, string] Config = object # config vs icons? - wallpapers* {.defaultVal: ""}: string + timeout* {.defaultVal: 60.}: int + wallpapers* {.defaultVal: "".}: string classes*: Icons `no-client`*: string `default-icon`*: string