testsAndMisc/linux_configuration/scripts/periodic_background
Krzysztof kuhy Rudnicki 28779586eb
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
fix(wellbeing): symlink focus-mode-daemon so edits actually deploy
install_focus_mode_daemon.sh copied the script to /usr/local/bin, so the
deployed daemon went stale the instant the repo file was edited: what you
run stops matching what you read, with nothing to tell you. That is not
hypothetical - the zombie-detection fix in 22e22c1 sat in the repo while
a months-old copy at /usr/local/bin/focus-mode-daemon went on entering
GAMING mode and killing browsers. It only surfaced because the deployed
copy was checked by hand.

Link instead of copy, so editing the repo file IS deploying it. Also
chmod +x the source, since a symlink takes its executability from the
target rather than from an install mode.

uninstall now guards with [[ -e || -L ]] rather than [[ -f ]]: both -f
and -e follow the link and report false when the target is gone, which
is exactly the case (repo moved or deleted) where a stale link most
needs clearing.

The link resolves into the user's checkout, so /usr/local/bin/... is only
as trustworthy as that path. Fine here - focus-mode runs as a systemd
*user* service, crossing no privilege boundary. Not a pattern to copy for
anything root runs.

Verified: stat -L reports the same inode (92274745) for the deployed path
and the repo file; appending a marker to the repo file makes it appear at
/usr/local/bin/focus-mode-daemon immediately, with no reinstall; a link
to a missing target is now removed by uninstall where [[ -f ]] skipped it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rN2usTS3pYLJqeVg2ZpgR
2026-07-17 14:02:33 +02:00
..
digital_wellbeing fix(wellbeing): symlink focus-mode-daemon so edits actually deploy 2026-07-17 14:02:33 +02:00
hosts fix(hosts-guard): stop setup aborting silently, so the guards actually enable 2026-07-17 08:25:51 +02:00
i3-configuration feat(digital-wellbeing): time-boxed shutdown overrides + drift-proof i3blocks deploy 2026-07-10 21:57:05 +02:00
system-maintenance fix(maintenance): make repair failures loud instead of silently exiting 0 2026-07-17 08:17:51 +02:00
utils/android_guardian refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
check_and_enable_services.sh fix(wellbeing): clear every remaining error/warning; drop thesis_tracker 2026-07-17 08:58:43 +02:00
setup_periodic_system.sh fix(pacman): wrap makepkg so an orphaned db.lck can't hang makepkg -i 2026-07-17 07:46:31 +02:00