super-productivity/snap/hooks/install
Johannes Millan fc343b801b fix: idle detection errors and system freezes after hibernation
- 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.
2025-06-21 08:43:24 +02:00

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