{ "intent": "Restore the idle-inhibitor autostart that has been silently failing at every i3 login, so the screen stops blanking/locking while a game controller is connected, and stop i3 restarts from stacking duplicate watchers.", "scope": [ "linux_configuration/scripts/periodic_background/i3-configuration/i3/config", "linux_configuration/scripts/single_use/utils/turn_off_auto_idle_screen_shutdown.sh", "Non-goal: no change to what the watcher does once running (the fork-free systemd-inhibit rewrite in fcd3f7e stands)", "Non-goal: no i3 reload performed - a game was running on DP-0, so the live session was fixed by launching the watcher directly instead" ], "changes": [ "i3 config: the exec pointed at /home/kuchy/linux-configuration/scripts/utils/turn_off_auto_idle_screen_shutdown.sh - a typo'd home ('kuchy', which does not exist) and a path that stopped existing when the repo was reorganised in db6276b. Repointed at the script's real location under linux_configuration/scripts/single_use/utils/.", "turn_off_auto_idle_screen_shutdown.sh: --watch-controller now takes an flock on $XDG_RUNTIME_DIR/idle-off-watch.lock for the life of the watcher and declines to start if one is already running. i3 re-runs its exec lines on every `i3-msg restart`, so without this each restart left another long-lived watcher holding a redundant inhibitor." ], "verification": [ { "command": "systemd-inhibit --list | grep idle-off (before the fix)", "result": "fail", "evidence": "No idle-off inhibitor held, while /dev/input/js0 was present - i.e. the screen could blank during controller gaming. Only rtkit/upower/xss-lock inhibitors were listed." }, { "command": "bash turn_off_auto_idle_screen_shutdown.sh --watch-controller (after the fix)", "result": "pass", "evidence": "[idle-off] Holding idle inhibitor (pid 941016) while a controller is connected; systemd-inhibit --list now shows: idle-off 1000 kuhy 941016 systemd-inhibit idle 'game controller connected' block" }, { "command": "second invocation of the same script (singleton check)", "result": "pass", "evidence": "[idle-off] Controller watcher already running; not starting a second one. Exit 0, and `systemd-inhibit --list | grep -c idle-off` stays at 1." }, { "command": "pre-commit run --files linux_configuration/scripts/single_use/utils/turn_off_auto_idle_screen_shutdown.sh", "result": "pass", "evidence": "All hooks Passed or Skipped, including shellcheck and 'Block polling script anti-patterns'." } ], "risks": [ "The lock lives in $XDG_RUNTIME_DIR, which is cleared on logout - correct here, since the watcher is per-session anyway. If XDG_RUNTIME_DIR is unset the lock falls back to /tmp, where a stale lock file is harmless because flock releases on process exit.", "The i3 config change only takes effect on the next i3 restart/login. The running session was fixed by starting the watcher directly, so there is no gap; a future `i3-msg restart` will pick up the corrected path and the singleton guard will prevent a duplicate.", "The deployed ~/.config/i3/config is a separate copy, not a symlink to this tracked file. Both were updated; if only one had been, the next deploy would have reintroduced the broken path." ], "rollback": [ "git revert the commit, then restore the deployed copy: the pre-change ~/.config/i3/config is backed up in the session scratchpad as i3-config.bak.", "After rollback, confirm with `systemd-inhibit --list | grep idle-off` that the inhibitor state matches expectations, and kill any running turn_off_auto_idle_screen_shutdown.sh watcher." ] }