Add a timeout option to OSD
This commit is contained in:
parent
95bcf6ae14
commit
0a56ecd002
@ -120,6 +120,8 @@ pub mod notify {
|
|||||||
|
|
||||||
pub urgency: Urgency,
|
pub urgency: Urgency,
|
||||||
|
|
||||||
|
pub timeout: i32,
|
||||||
|
|
||||||
// Progress bar stuff
|
// Progress bar stuff
|
||||||
length: i32,
|
length: i32,
|
||||||
|
|
||||||
@ -139,6 +141,8 @@ pub mod notify {
|
|||||||
|
|
||||||
let mut config = Config::new("common");
|
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 length = config.get_default("progressbar", "length", 20);
|
||||||
|
|
||||||
let full = config.get_default("progressbar", "full", String::from("█"));
|
let full = config.get_default("progressbar", "full", String::from("█"));
|
||||||
@ -153,6 +157,7 @@ pub mod notify {
|
|||||||
title: None, icon: None,
|
title: None, icon: None,
|
||||||
contents: OSDContents::default(),
|
contents: OSDContents::default(),
|
||||||
urgency: Urgency::Normal,
|
urgency: Urgency::Normal,
|
||||||
|
timeout,
|
||||||
length, full, empty, start, end,
|
length, full, empty, start, end,
|
||||||
notification
|
notification
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user