This commit is contained in:
2026-04-04 04:24:35 +02:00
parent cb8b641447
commit 52cc041c42
+12 -12
View File
@@ -29,20 +29,20 @@ impl WaybarModule for DndModule {
})?; })?;
// Try toggling SwayNC // Try toggling SwayNC
if let Ok(proxy) = SwayncControlProxy::new(&connection).await { if let Ok(proxy) = SwayncControlProxy::new(&connection).await
if let Ok(is_dnd) = proxy.dnd().await { && let Ok(is_dnd) = proxy.dnd().await
{
let _ = proxy.set_dnd(!is_dnd).await; let _ = proxy.set_dnd(!is_dnd).await;
return Ok(WaybarOutput::default()); return Ok(WaybarOutput::default());
} }
}
// Try toggling Dunst // Try toggling Dunst
if let Ok(proxy) = DunstControlProxy::new(&connection).await { if let Ok(proxy) = DunstControlProxy::new(&connection).await
if let Ok(is_paused) = proxy.paused().await { && let Ok(is_paused) = proxy.paused().await
{
let _ = proxy.set_paused(!is_paused).await; let _ = proxy.set_paused(!is_paused).await;
return Ok(WaybarOutput::default()); return Ok(WaybarOutput::default());
} }
}
return Err(crate::error::FluxoError::Module { return Err(crate::error::FluxoError::Module {
module: "dnd", module: "dnd",
@@ -118,8 +118,9 @@ impl DndDaemon {
info!("Connected to D-Bus for DND monitoring"); info!("Connected to D-Bus for DND monitoring");
// Try SwayNC // Try SwayNC
if let Ok(proxy) = SwayncControlProxy::new(&connection).await { if let Ok(proxy) = SwayncControlProxy::new(&connection).await
if let Ok(is_dnd) = proxy.dnd().await { && let Ok(is_dnd) = proxy.dnd().await
{
debug!("Found SwayNC, using it for DND state."); debug!("Found SwayNC, using it for DND state.");
let _ = tx.send(DndState { is_dnd }); let _ = tx.send(DndState { is_dnd });
@@ -141,11 +142,11 @@ impl DndDaemon {
} }
} }
} }
}
// Try Dunst // Try Dunst
if let Ok(proxy) = DunstControlProxy::new(&connection).await { if let Ok(proxy) = DunstControlProxy::new(&connection).await
if let Ok(is_dnd) = proxy.paused().await { && let Ok(is_dnd) = proxy.paused().await
{
debug!("Found Dunst, using it for DND state."); debug!("Found Dunst, using it for DND state.");
let _ = tx.send(DndState { is_dnd }); let _ = tx.send(DndState { is_dnd });
@@ -167,7 +168,6 @@ impl DndDaemon {
} }
} }
} }
}
Err(anyhow::anyhow!("DND stream ended or daemon not found")) Err(anyhow::anyhow!("DND stream ended or daemon not found"))
} }