testsAndMisc/linux_configuration/scripts/periodic_background
Krzysztof kuhy Rudnicki 26965bad32 Split install_usage_monitoring.sh into an entry plus five libs
The 290-line installer was 40 over the 250-line cap. Its five banner-marked
steps move into a sibling lib/, leaving a 53-line entry that owns log()/die(),
the globals that cross between steps, and the call order.

Proven by execution, not inspection: meta/scripts/trace_shell_split.sh
--prefix was captured at HEAD in place (tracing from a detached worktree
changes REPO_DIR, which is interpolated into a generated file, and fakes a
diff), then re-run after the split. The traces are identical -- same exit
status, same ordered stubbed calls, and all five generated-file hashes
unchanged, including usage-report-catchup.sh at sha=9f4803ab157c5527.

REPO_DIR is computed once in the entry and read as a global rather than
recomputed inside a lib one directory deeper; recomputing it would have
pointed the generated catch-up script at the wrong repo while still exiting 0.

test_usage_monitoring_installer_efficiency.sh greps the installer's source
text for the pmon heredoc, so it follows that heredoc to lib/nvidia_pmon.sh.
Its extraction anchor also had to become whitespace-insensitive: the
pre-commit hook runs `shfmt -w` on staged shell files and rewrites
`cat > "x" << 'SCRIPT'` to `cat >"x" <<'SCRIPT'`, which silently broke
extraction. All five property assertions are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 07:26:56 +02:00
..
digital_wellbeing Split music_parallelism.sh into an entry script and three libs 2026-08-16 21:50:34 +02:00
hosts Block by hiding apps, which the phone cannot undo 2026-08-11 19:49:11 +02:00
i3-configuration i3blocks: add Claude usage block, fix icon rendering, drop dead blocks 2026-08-10 15:14:34 +02:00
lib Split two more linux_configuration scripts; revert a third 2026-08-16 18:44:18 +02:00
system-maintenance Split install_usage_monitoring.sh into an entry plus five libs 2026-08-17 07:26:56 +02:00
utils Fail the build on any shellcheck finding; fix the 222 the old gate hid 2026-08-03 19:49:11 +02:00
check_and_enable_services.sh Fail the build on any shellcheck finding; fix the 222 the old gate hid 2026-08-03 19:49:11 +02:00
setup_periodic_system.sh Split two more linux_configuration scripts; revert a third 2026-08-16 18:44:18 +02:00