This change allows aw-watcher-window-wayland to work even if the KDE idle mechanism is not present. It does that by attempting to instantiate a KDE Idle object as normal, but not panicking if that fails, and instead marking the idle part of the watcher as inactive, and not making subsequent calls to it.
The background is that Issue #35 [1] reports that sway has switched idle mechanisms to not use the KDE idle mechanism. Presumably, other window managers may also fail to support the KDE idle mechanism. Pending full support for idle-notify-v1, it's still useful to use activity watch on sway to get focused window titles, so this commit allows the program to run on sway.
Some changes to Cargo.lock were necessary to compile.
This description was created by Ellipsis for commit 4ebb5a41f8b81c77d773870b4ab62619d408bb35
Summary:
This PR updates aw-watcher-window-wayland to handle platforms without KDE idle mechanism by modifying assign_idle_timeout to return a Result and adjusting idle event handling in src/main.rs.
Key points:
Update src/idle.rs to modify assign_idle_timeout to return Result<(), String> instead of panicking.
Handle absence of KDE idle mechanism by marking idle watcher as inactive in src/main.rs.
Add error handling in src/main.rs to print error message if KDE idle mechanism is not available.
Conditional heartbeat sending for AFK events based on idle mechanism availability in src/main.rs.
This change allows aw-watcher-window-wayland to work even if the KDE idle mechanism is not present. It does that by attempting to instantiate a KDE Idle object as normal, but not panicking if that fails, and instead marking the idle part of the watcher as inactive, and not making subsequent calls to it.
The background is that Issue #35 [1] reports that sway has switched idle mechanisms to not use the KDE idle mechanism. Presumably, other window managers may also fail to support the KDE idle mechanism. Pending full support for idle-notify-v1, it's still useful to use activity watch on sway to get focused window titles, so this commit allows the program to run on sway.
Some changes to Cargo.lock were necessary to compile.
[1] https://github.com/ActivityWatch/aw-watcher-window-wayland/issues/35
Summary:
This PR updates
aw-watcher-window-wayland
to handle platforms without KDE idle mechanism by modifyingassign_idle_timeout
to return aResult
and adjusting idle event handling insrc/main.rs
.Key points:
src/idle.rs
to modifyassign_idle_timeout
to returnResult<(), String>
instead of panicking.src/main.rs
.src/main.rs
to print error message if KDE idle mechanism is not available.src/main.rs
.Generated with :heart: by ellipsis.dev