From 0a56ecd0027b3f797feaac24548d7c03c78060aa Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Wed, 16 Sep 2020 18:54:19 +0300 Subject: [PATCH] Add a timeout option to OSD --- common/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/src/lib.rs b/common/src/lib.rs index 09a71a2..0e8d033 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -120,6 +120,8 @@ pub mod notify { pub urgency: Urgency, + pub timeout: i32, + // Progress bar stuff length: i32, @@ -139,6 +141,8 @@ pub mod notify { let mut config = Config::new("common"); + let timeout = config.get("notification", "default timeout").unwrap_or(-1); // -1 means the default timeout of the notification server + let length = config.get_default("progressbar", "length", 20); let full = config.get_default("progressbar", "full", String::from("█")); @@ -153,6 +157,7 @@ pub mod notify { title: None, icon: None, contents: OSDContents::default(), urgency: Urgency::Normal, + timeout, length, full, empty, start, end, notification };