From e3c14344318063862c57695036c16e9666105b26 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Wed, 23 Apr 2025 23:16:53 +0300 Subject: [PATCH] fix("status_notify"): show disabled status --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8bd4d43..fa9e87f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,9 +59,15 @@ async fn socket_server(disabled: Arc, notify: Arc) { let now = Local::now(); let (cur_temp, cur_gamma) = compute_settings(now); + let body = if disabled.load(Ordering::SeqCst) { + "disabled".to_string() + } else { + format!("temp: {}K, gamma: {}%", cur_temp, cur_gamma) + }; + match Notification::new() .summary("Sunsetting") - .body(format!("temp: {}K, gamma: {}%", cur_temp, cur_gamma).as_str()) + .body(body.as_str()) .timeout(notify_rust::Timeout::Milliseconds(NOTIFICATION_TIMEOUT)) .show_async() .await