mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
- Test idle detection methods only once during initialization to prevent repeated failures - Add snap environment detection with automatic method filtering - Add proper snap plugs for system-observe and login-session-observe interfaces - Improve DBus handling by trying gdbus first (works better in snap environments) - Add rate-limited error logging to prevent log spam - Add snap install hook to guide users on connecting required interfaces - Ensure graceful fallback to 0 (not idle) when detection fails This prevents the system freezes that occurred after hibernation due to repeated failing idle detection attempts, and improves snap compatibility for DBus access.
15 lines
No EOL
569 B
Bash
Executable file
15 lines
No EOL
569 B
Bash
Executable file
#!/bin/sh
|
|
# Connect interfaces for idle detection
|
|
if snapctl is-connected login-session-observe; then
|
|
echo "login-session-observe interface already connected"
|
|
else
|
|
echo "Please connect login-session-observe interface for idle detection:"
|
|
echo "sudo snap connect superproductivity:login-session-observe"
|
|
fi
|
|
|
|
if snapctl is-connected system-observe; then
|
|
echo "system-observe interface already connected"
|
|
else
|
|
echo "Please connect system-observe interface for better system integration:"
|
|
echo "sudo snap connect superproductivity:system-observe"
|
|
fi |