testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing
Krzysztof kuhy Rudnicki d72f03ea93 setup_midnight_shutdown: split into lib/ — the cap is now zero
1734 -> 109 lines across eight libs plus one payload file. This was the last
file over the 250-line cap; check_file_length.sh --all now reports "all
checked files are within 250 lines".

This file needed a different proof from the others. Its product is scripts
generated into /usr/local/bin via heredocs, so "did the functions move
verbatim" is not the question that matters — "does it still emit the same
bytes" is. Every heredoc body was hashed before the split: 11 of 12 are
byte-identical afterwards, and the twelfth (the 224-line config-unlock body)
now lives in lib/payloads/shutdown-config-unlock.sh.in at hash
1a5c67cfd0244101, exactly matching what it replaced. No new bodies appeared.

The "~39 top-level functions" this file is documented as having are not real.
log(), now_epoch(), cmd_add() and friends sit at column 0 because they are
inside the generated scripts. The brace-matching extractor keeps each heredoc
with its owning generator, so they moved as part of it. That is also why
verify_shell_split.sh reports a bare "-log": it cannot tell a heredoc-internal
definition from a top-level one. log() is not lost — it is line 17 of the
payload, which is where it always ran from.

$_MS_PAYLOAD_DIR is defined in the same file as its use, directly above it,
following the _NL_PAYLOAD_DIR lesson from earlier in this campaign.

--help is byte-identical, shellcheck is clean with no suppression added.
`setup` itself is not executed — it installs systemd units, makes the config
immutable and arms a shutdown timer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3PzGc75gBcdxP3PkHXGcV
2026-08-21 16:27:54 +02:00
..
lib setup_midnight_shutdown: split into lib/ — the cap is now zero 2026-08-21 16:27:54 +02:00
llm-notes Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
pacman pacman_wrapper: split into flat libs under the 250-line cap 2026-08-21 16:19:26 +02:00
systemd Add install_core_system.sh; remove pc_startup and thesis_tracker 2026-05-15 01:13:28 +02:00
virtualbox shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard 2026-08-17 14:27:57 +02:00
.gitignore refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
block_compulsive_opening.sh block_compulsive_opening: split into lib/ under the 250-line cap 2026-08-21 15:51:06 +02:00
install_leechblock.sh install_leechblock: split into lib/ under the 250-line cap 2026-08-21 15:32:48 +02:00
install_ublock.sh Wire uBlock Origin into every real Chromium launch, alongside LeechBlock 2026-08-12 22:44:28 +02:00
leechblock_defaults.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
music_parallelism.sh Split music_parallelism.sh into an entry script and three libs 2026-08-16 21:50:34 +02:00
package-lock.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
package.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
README_COMPULSIVE_BLOCK_LLM.md refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
README_MIDNIGHT_SHUTDOWN_LLM.md Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
remove_guest_mode.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
seed_leechblock_storage.js refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
seed_ublock_storage.js Wire uBlock Origin into every real Chromium launch, alongside LeechBlock 2026-08-12 22:44:28 +02:00
setup_midnight_shutdown.sh setup_midnight_shutdown: split into lib/ — the cap is now zero 2026-08-21 16:27:54 +02:00
setup_night_lockdown.sh setup_night_lockdown: split into lib/ under the 250-line cap 2026-08-21 15:59:35 +02:00
youtube-music-wrapper.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00