user-idle-time

Crates.iouser-idle-time
lib.rsuser-idle-time
version0.7.0
created_at2025-03-27 09:52:25.734121+00
updated_at2025-03-27 15:57:59.299288+00
descriptionGet a user's idle time.
homepagehttps://github.com/BenjaminBrienen/user-idle-time
repositoryhttps://github.com/BenjaminBrienen/user-idle-time
max_upload_size
id1607776
size73,856
Benjamin Brienen (BenjaminBrienen)

documentation

README

user-idle-time

Get the idle time of a user

OS Supported
Linux (x11) ✔️
Linux (dbus) ✔️*
Linux (wayland)
Windows ✔️
MacOS

[!NOTE] DBus returns the time the session has been locked, not the time since the last user input event.

By default, x11 is used on Linux. DBus can be enabled in Cargo.toml by disabling default-features and enabling dbus.

Example

use user_idle_time::get_idle_time;
let idle = get_idle_time().unwrap();
let idle_seconds = idle.as_secs();

Check the documentation for more methods.

Commit count: 34

cargo fmt