dbus-idle
Python library to detect user idle time in milliseconds (and from that, inactivity) on Linux, Windows, and macOS.
Requirements
- Python 3.7 or later
- One of the following:
- D-Bus with
org.freedesktop.DBusinterface xprintidlecommand- libX11 with
XScreenSaverInfo swayidlecommand- Windows
- macOS
- D-Bus with
Installation
Install using:
sudo apt install meson libdbus-glib-1-dev patchelf
pip install dbus-idle
On non-Linux systems,
pip install dbus-idle
Usage
You can use this module from the command line
dbus-idle
or access the current idle time from within your python program
from dbus_idle import IdleMonitor
milliseconds = IdleMonitor().get_dbus_idle()
IdleMonitor.is_idle() uses a 120-second threshold by default. Both
idle_threshold and get_dbus_idle() use milliseconds:
monitor = IdleMonitor(idle_threshold=120_000)
Contribution
This is based on the work by Alexander Frenzel
Metadata
Release files for dbus-idle 2026.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dbus_idle-2026.9.0.tar.gz | 7.2 kB | Without provenance | Details for dbus_idle-2026.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dbus_idle-2026.9.0-py3-none-any.whl | Python 3 | none | any | Details for dbus_idle-2026.9.0-py3-none-any.whl |
Total release size: 14.9 kB
Release files / dbus_idle-2026.9.0.tar.gz
| Download URL | dbus_idle-2026.9.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afbbc8781d3c0e072ab11dc342ffba820267c67f5718a09ce769a854e8586c7d
|
|
BLAKE2b-256 checksum How to use checksums |
5d664718ac4c1d03328698e31ca51b2ba9caf9d8abb107cf3271c4aa90f9382c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / dbus_idle-2026.9.0-py3-none-any.whl
| Download URL | dbus_idle-2026.9.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb6196b3e9ad201457a0342a14aa147c332c18cc22103a647d3be3e7c2e63287
|
|
BLAKE2b-256 checksum How to use checksums |
c2e48a387efc6e6dfedd591d04e52137da74ffcb2d8e34f54ec34d01631427a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for dbus-idle 2026.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.