Mon PC ne s'endort plus jamais... Note

Mon PC ne s'endort plus jamais : comment j'ai supprimé la veille et le verrouillage sous Linux

Modern Linux systems automatically lock sessions and turn off screens during inactivity, posing a problem for overnight automations. The author details a four-layer approach to prevent this on Pop!_OS 24.04. First, desktop environment settings for CosmicIdle are modified by creating configuration files that set screen, lock, and suspend timeouts to zero, effectively disabling them. Second, systemd's logind service is configured to ignore inactivity signals and system sleep targets are masked to prevent any form of sleep. Third, a Python script using DBus is employed to continuously inhibit the screensaver, ensuring the session never locks. This script is set to run as a user service, persisting across reboots. Finally, as a security measure for a continuously active machine, the firewall is configured to deny all incoming connections by default, allowing only trusted local network traffic. This comprehensive solution ensures the screen remains on, the session stays unlocked, and the system cannot enter sleep mode. The only drawback is the manual need to turn off the monitor. These configurations are documented in the author's practical guides.