about summary refs log tree commit diff
path: root/src/ui/window.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-01-03 14:52:47 +0300
committerVika <vika@fireburn.ru>2025-01-03 15:00:03 +0300
commit4d50adcfb29e7ee3fb66769e82f5beaf65db2532 (patch)
tree85d78d690b346245430703a96443e7703ff48f6e /src/ui/window.rs
parent8478475d9353aa895c216005cd1b731d8e657d53 (diff)
downloadFurtherance-main.tar.zst
Allow idle time detection on all Wayland desktops HEAD main
Other desktops require C dependencies I don't want to bring in, so
let's leave it at that. Pretty much all of the code was kanged from
the new Iced rewrite.
Diffstat (limited to 'src/ui/window.rs')
-rw-r--r--src/ui/window.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/ui/window.rs b/src/ui/window.rs
index bf23729..7fd4450 100644
--- a/src/ui/window.rs
+++ b/src/ui/window.rs
@@ -583,17 +583,7 @@ impl FurtheranceWindow {
     }
 
     fn get_idle_time(&self) -> Result<u64, Box<dyn std::error::Error>> {
-        let c = Connection::new_session()?;
-
-        let p = c.with_proxy(
-            "org.gnome.Mutter.IdleMonitor",
-            "/org/gnome/Mutter/IdleMonitor/Core",
-            Duration::from_millis(5000),
-        );
-        let (idle_time,): (u64,) =
-            p.method_call("org.gnome.Mutter.IdleMonitor", "GetIdletime", ())?;
-
-        Ok(idle_time / 1000)
+        crate::helpers::get_idle_time()
     }
 
     fn check_user_idle(&self) {