fix("status_notify"): show disabled status

This commit is contained in:
Vladimir Rubin 2025-04-23 23:16:53 +03:00
parent 65433f3560
commit e3c1434431
Signed by: vavakado
GPG key ID: CAB744727F36B524

View file

@ -59,9 +59,15 @@ async fn socket_server(disabled: Arc<AtomicBool>, notify: Arc<Notify>) {
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