Skip to main content

dbus-idle

pypi python version license

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.DBus interface
    • xprintidle command
    • libX11 with XScreenSaverInfo
    • swayidle command
    • Windows
    • macOS

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)

Source distribution for dbus-idle 2026.9.0
File Size Uploaded
dbus_idle-2026.9.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbus-idle 2026.9.0
File Interpreter ABI Platform
dbus_idle-2026.9.0-py3-none-any.whl Python 3 none any Details

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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page