7 releases (4 breaking)

0.5.0 Jun 19, 2021
0.4.0 Feb 1, 2021
0.3.0 Jan 18, 2021
0.2.1 Jul 1, 2020
0.1.1 Feb 1, 2020

#70 in GUI

Download history 10/week @ 2021-04-13 21/week @ 2021-04-20 2/week @ 2021-04-27 12/week @ 2021-05-04 3/week @ 2021-05-11 12/week @ 2021-05-18 3/week @ 2021-05-25 28/week @ 2021-06-01 13/week @ 2021-06-08 21/week @ 2021-06-15 7/week @ 2021-06-22 5/week @ 2021-06-29 7/week @ 2021-07-06 6/week @ 2021-07-13 17/week @ 2021-07-20 22/week @ 2021-07-27

51 downloads per month
Used in 2 crates

MIT/Apache

13KB
241 lines

Get a users idle time

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

* 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::UserIdle;

let idle = UserIdle::get_time().unwrap();

let idle_seconds = idle.as_seconds();
let idle_minutes = idle.as_minutes();
// Check the documentation for more methods

lib.rs:

Get a users idle time.

The time returned is the time since the last user input event.

See the README.md for more information.

Example:

use user_idle::UserIdle;
let idle = UserIdle::get_time().unwrap();
let idle_seconds = idle.as_seconds();
let idle_minutes = idle.as_minutes();
// Check the documentation for more methods

Dependencies

~0–275KB