hyprshell_core_lib/
notify.rs1use notify_rust::{Hint, Notification};
2use std::time::Duration;
3use tracing::{info, warn};
4
5pub fn notify(body: &str, duration: Duration) {
6 info!("{}", body);
7 let _ = Notification::new()
8 .summary("Hyprshell")
9 .body(body)
10 .appname("hyprshell")
11 .timeout(duration)
12 .urgency(notify_rust::Urgency::Normal)
13 .show();
14}
15
16pub fn notify_resident(body: &str, duration: Duration) {
17 info!("{}", body);
18 let _ = Notification::new()
19 .summary("Hyprshell")
20 .body(body)
21 .appname("hyprshell")
22 .timeout(duration)
23 .hint(Hint::Resident(true))
24 .timeout(Duration::from_secs(0))
25 .urgency(notify_rust::Urgency::Normal)
26 .show();
27}
28
29pub fn notify_warn(body: &str) {
30 warn!("{}", body);
31 let _ = Notification::new()
32 .summary("Hyprshell")
33 .body(body)
34 .appname("hyprshell")
35 .timeout(Duration::from_secs(8))
36 .urgency(notify_rust::Urgency::Critical)
37 .show();
38}