A native C++ & Lua extension for HPR (Human Pattern Recorder) that monitors system idle status and automatically manages tracking lifecycle events.
Developed by: Plexescor
| Platform / Desktop Environment | Support Status |
|---|---|
| Windows | ✅ Supported |
| Linux (GNOME) | ✅ Supported |
| Linux (KDE Plasma 6) | ✅ Supported (Beta tho) |
| Linux (Hyprland) | ✅ Supported |
| Linux (niri) | ✅ Supported |
| Linux (Cinnamon) | ✅ Supported |
As HPR relies on wayland protocols to find the idle status/time, if you have enabled no idle timeout in your compositor, HPR-Idle-Detection will not work
src/ — Native C++ module source code.include/ — C++ header files.external/ — Embedded dependencies (sol2, lua).idle_detection.lua — Extension entry point script.[!IMPORTANT]
- Both
idle_detection.luaand the compiled dynamic library (HPR_Idle_Detection_Extension.dllon Windows orHPR_Idle_Detection_Extension.soon Linux) must reside in the exact same folder inside your extensions directory.- The filename of
HPR_Idle_Detection_Extension.dll/HPR_Idle_Detection_Extension.somust be kept exactly as named in the release without renaming.
Placement directories:
%APPDATA%\HPR\HPR_Config\extensions\~/.config/HPR/HPR_Config/extensions/Idle time is configured via idle_detection_config.csv in the extension directory alongside idle_detection.lua.
HPR expects a simple key-value CSV format where the threshold value is specified in milliseconds:
idle-threshold,<time_in_milliseconds>
idle-threshold,60000idle-threshold,300000idle-threshold,480000idle-threshold,600000idle-threshold,900000[!TIP] If
idle_detection_config.csvis missing on launch, the extension will automatically create it with the default 8-minute threshold (480000ms).
idle_detection.lua resolves its absolute directory via HPR.getExtensionAbsoluteDir(), then dynamically loads HPR_Idle_Detection_Extension.dll (or .so) using package.loadlib() to expose native system idle detection (getIdleStatus).idle_detection_config.csv for idle-threshold (defaulting to 8 minutes / 480000 ms if missing).onTick), it checks user idle time against the configured threshold.HPR.stopTracking().HPR.startTracking().The native library selects the appropriate idle detection method at runtime based on the current platform and desktop environment:
| Platform | Backend | How it works |
|---|---|---|
| Windows | GetLastInputInfo (Win32 API) | Queries the timestamp of the last input event directly from the OS |
| Linux — GNOME / Cinnamon | org.gnome.Mutter.IdleMonitor / org.cinnamon.Muffin.IdleMonitor (D-Bus) | Calls the Mutter/Muffin compositor's D-Bus GetIdletime method |
| Linux — other Wayland | ext-idle-notify-v1 (Wayland protocol) | Subscribes to compositor idle/resumed events in a background thread; elapsed time since the idled event is the idle duration |
The Wayland backend works with any compositor that implements the standard ext-idle-notify-v1 protocol, including Hyprland, Sway, niri, and others.
[!WARNING] X11 sessions are not supported. If you are running a desktop on X11 (e.g. Openbox, i3 on X), the extension will load successfully but idle detection will always return "not idle" and tracking will never be paused automatically. Only Wayland sessions are supported on non-GNOME Linux desktops.
To compile the extension from source, you need a C++23 compatible compiler (GCC 13+, Clang 16+, or MSVC 2022), CMake (>= 3.15), and pkg-config.
The following libraries are needed on Linux. Both are required to enable full idle detection coverage (GNOME D-Bus + Wayland):
| Library | Purpose |
|---|---|
libglib2.0-dev / glib2-devel | GLib / GIO — GNOME D-Bus idle detection |
libwayland-dev / wayland-devel | Wayland client — non-GNOME Wayland idle detection |
wayland-protocols | Protocol XML files for ext-idle-notify-v1 |
Install them for your distribution:
sudo apt install build-essential cmake pkg-config libglib2.0-dev libwayland-dev wayland-protocols
sudo dnf install gcc-c++ cmake pkgconfig glib2-devel wayland-devel wayland-protocols
sudo pacman -S base-devel cmake pkgconf glib2 wayland wayland-protocols
sudo zypper install gcc-c++ cmake pkg-config glib2-devel wayland-devel wayland-protocols-devel
sudo apk add build-base cmake pkgconf glib-dev wayland-dev wayland-protocols
[!NOTE] If
wayland-clientorwayland-protocolsare not detected at configure time, the Wayland idle backend is automatically disabled and only GNOME D-Bus detection will be compiled in. A message is printed by CMake:Wayland ext-idle-notify-v1 support enabledorWayland idle detection disabled.
Using CMake:
mkdir build
cd build
cmake ..
cmake --build . --config Release
C++
63.3%
CMake
21.3%
Lua
15.5%
A native C++ & Lua extension for HPR (Human Pattern Recorder) that monitors system idle status and automatically manages tracking lifecycle events.
Developed by: Plexescor
| Platform / Desktop Environment | Support Status |
|---|---|
| Windows | ✅ Supported |
| Linux (GNOME) | ✅ Supported |
| Linux (KDE Plasma 6) | ✅ Supported (Beta tho) |
| Linux (Hyprland) | ✅ Supported |
| Linux (niri) | ✅ Supported |
| Linux (Cinnamon) | ✅ Supported |
As HPR relies on wayland protocols to find the idle status/time, if you have enabled no idle timeout in your compositor, HPR-Idle-Detection will not work
src/ — Native C++ module source code.include/ — C++ header files.external/ — Embedded dependencies (sol2, lua).idle_detection.lua — Extension entry point script.[!IMPORTANT]
- Both
idle_detection.luaand the compiled dynamic library (HPR_Idle_Detection_Extension.dllon Windows orHPR_Idle_Detection_Extension.soon Linux) must reside in the exact same folder inside your extensions directory.- The filename of
HPR_Idle_Detection_Extension.dll/HPR_Idle_Detection_Extension.somust be kept exactly as named in the release without renaming.
Placement directories:
%APPDATA%\HPR\HPR_Config\extensions\~/.config/HPR/HPR_Config/extensions/Idle time is configured via idle_detection_config.csv in the extension directory alongside idle_detection.lua.
HPR expects a simple key-value CSV format where the threshold value is specified in milliseconds:
idle-threshold,<time_in_milliseconds>
idle-threshold,60000idle-threshold,300000idle-threshold,480000idle-threshold,600000idle-threshold,900000[!TIP] If
idle_detection_config.csvis missing on launch, the extension will automatically create it with the default 8-minute threshold (480000ms).
idle_detection.lua resolves its absolute directory via HPR.getExtensionAbsoluteDir(), then dynamically loads HPR_Idle_Detection_Extension.dll (or .so) using package.loadlib() to expose native system idle detection (getIdleStatus).idle_detection_config.csv for idle-threshold (defaulting to 8 minutes / 480000 ms if missing).onTick), it checks user idle time against the configured threshold.HPR.stopTracking().HPR.startTracking().The native library selects the appropriate idle detection method at runtime based on the current platform and desktop environment:
| Platform | Backend | How it works |
|---|---|---|
| Windows | GetLastInputInfo (Win32 API) | Queries the timestamp of the last input event directly from the OS |
| Linux — GNOME / Cinnamon | org.gnome.Mutter.IdleMonitor / org.cinnamon.Muffin.IdleMonitor (D-Bus) | Calls the Mutter/Muffin compositor's D-Bus GetIdletime method |
| Linux — other Wayland | ext-idle-notify-v1 (Wayland protocol) | Subscribes to compositor idle/resumed events in a background thread; elapsed time since the idled event is the idle duration |
The Wayland backend works with any compositor that implements the standard ext-idle-notify-v1 protocol, including Hyprland, Sway, niri, and others.
[!WARNING] X11 sessions are not supported. If you are running a desktop on X11 (e.g. Openbox, i3 on X), the extension will load successfully but idle detection will always return "not idle" and tracking will never be paused automatically. Only Wayland sessions are supported on non-GNOME Linux desktops.
To compile the extension from source, you need a C++23 compatible compiler (GCC 13+, Clang 16+, or MSVC 2022), CMake (>= 3.15), and pkg-config.
The following libraries are needed on Linux. Both are required to enable full idle detection coverage (GNOME D-Bus + Wayland):
| Library | Purpose |
|---|---|
libglib2.0-dev / glib2-devel | GLib / GIO — GNOME D-Bus idle detection |
libwayland-dev / wayland-devel | Wayland client — non-GNOME Wayland idle detection |
wayland-protocols | Protocol XML files for ext-idle-notify-v1 |
Install them for your distribution:
sudo apt install build-essential cmake pkg-config libglib2.0-dev libwayland-dev wayland-protocols
sudo dnf install gcc-c++ cmake pkgconfig glib2-devel wayland-devel wayland-protocols
sudo pacman -S base-devel cmake pkgconf glib2 wayland wayland-protocols
sudo zypper install gcc-c++ cmake pkg-config glib2-devel wayland-devel wayland-protocols-devel
sudo apk add build-base cmake pkgconf glib-dev wayland-dev wayland-protocols
[!NOTE] If
wayland-clientorwayland-protocolsare not detected at configure time, the Wayland idle backend is automatically disabled and only GNOME D-Bus detection will be compiled in. A message is printed by CMake:Wayland ext-idle-notify-v1 support enabledorWayland idle detection disabled.
Using CMake:
mkdir build
cd build
cmake ..
cmake --build . --config Release
C++
63.3%
CMake
21.3%
Lua
15.5%