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
if let Ok(proxy) = SwayncControlProxy::new(&connection).await {
if let Ok(is_dnd) = proxy.dnd().await {
if let Ok(proxy) = SwayncControlProxy::new(&connection).await
&& let Ok(is_dnd) = proxy.dnd().await
{
let _ = proxy.set_dnd(!is_dnd).await;
return Ok(WaybarOutput::default());
}
}
// Try toggling Dunst
if let Ok(proxy) = DunstControlProxy::new(&connection).await {
if let Ok(is_paused) = proxy.paused().await {
if let Ok(proxy) = DunstControlProxy::new(&connection).await
&& let Ok(is_paused) = proxy.paused().await
{
let _ = proxy.set_paused(!is_paused).await;
return Ok(WaybarOutput::default());
}
}
return Err(crate::error::FluxoError::Module {
module: "dnd",
@@ -118,8 +118,9 @@ impl DndDaemon {
info!("Connected to D-Bus for DND monitoring");
// Try SwayNC
if let Ok(proxy) = SwayncControlProxy::new(&connection).await {
if let Ok(is_dnd) = proxy.dnd().await {
if let Ok(proxy) = SwayncControlProxy::new(&connection).await
&& let Ok(is_dnd) = proxy.dnd().await
{
debug!("Found SwayNC, using it for DND state.");
let _ = tx.send(DndState { is_dnd });
@@ -141,11 +142,11 @@ impl DndDaemon {
}
}
}
}
// Try Dunst
if let Ok(proxy) = DunstControlProxy::new(&connection).await {
if let Ok(is_dnd) = proxy.paused().await {
if let Ok(proxy) = DunstControlProxy::new(&connection).await
&& let Ok(is_dnd) = proxy.paused().await
{
debug!("Found Dunst, using it for DND state.");
let _ = tx.send(DndState { is_dnd });
@@ -167,7 +168,6 @@ impl DndDaemon {
}
}
}
}
Err(anyhow::anyhow!("DND stream ended or daemon not found"))
}