From 847e9767a01788a63c5058ae4ff85ae5e18fcc71 Mon Sep 17 00:00:00 2001 From: Demmie <2e3s19@gmail.com> Date: Wed, 24 Jan 2024 01:13:35 -0500 Subject: [PATCH] Add logging to see retries on Gnome --- watchers/src/watchers/gnome_wayland.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/watchers/src/watchers/gnome_wayland.rs b/watchers/src/watchers/gnome_wayland.rs index 3f2e302..dc3376d 100644 --- a/watchers/src/watchers/gnome_wayland.rs +++ b/watchers/src/watchers/gnome_wayland.rs @@ -15,18 +15,20 @@ fn is_gnome() -> bool { fn is_wayland() -> bool { std::env::var("WAYLAND_DISPLAY").is_ok() - && !std::env::var("XDG_SESSION_TYPE") + && std::env::var("XDG_SESSION_TYPE") .unwrap_or("".into()) .to_lowercase() - .contains("x11") + .contains("wayland") } pub async fn load_watcher() -> anyhow::Result { if is_gnome() && is_wayland() { + debug!("Gnome Wayland detected"); let mut watcher = Err(anyhow::anyhow!("")); for _ in 0..3 { watcher = T::load().await; - if watcher.is_err() { + if let Err(e) = &watcher { + debug!("Failed to load Gnome Wayland watcher: {e}"); tokio::time::sleep(tokio::time::Duration::from_secs(3)).await; } }