testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing
Krzysztof kuhy Rudnicki 1dceca6600 install_leechblock: split into lib/ under the 250-line cap
485 -> 114 lines, with the six install phases moved into four sourced
libs: leechblock_fetch.sh, leechblock_config.sh, leechblock_browsers.sh
and leechblock_firefox.sh.

detect_browsers, replace_browser_in_place and wire_up_browsers stay in
one lib on purpose: detect_browsers writes the BROWSERS/FIREFOXES arrays
that wire_up_browsers reads, and splitting them would create a
write-only cross-file global.

Four justified body changes, all recorded in the evidence:

- Quoted the six hyphenated associative-array keys. shfmt 3.13.1 parses
  an unquoted [google-chrome-stable] as arithmetic and rewrites it to
  [google - chrome - stable], which would break browser detection
  entirely. The pre-commit hook runs shfmt -w on staged files and
  re-stages them, so this corruption would have landed in the commit
  unseen -- this is what caused the previous attempt at this split to be
  reverted. Behaviour-preserving: quoted and unquoted are the same key.

- SCRIPT_DIR is assigned in the entry script rather than inside
  inject_default_config. Left in the lib, ${BASH_SOURCE[0]} resolves to
  lib/, so the defaults JSON lookup would miss and default blocking
  rules would silently never be seeded.

- install_firefox_policy takes ff_found as a parameter instead of
  reading it as a cross-file global, fixing a genuine SC2154 without a
  suppression.

- Added require_cmd unzip. It was used bare under set -Eeuo pipefail, so
  a missing unzip would abort after the version dir was populated but
  before the 'current' symlink was made, leaving a half-installed tree.

verify_shell_split.sh reports additions only -- no -/+ pair -- so
get_latest_tag and replace_browser_in_place moved byte-identically.
--help and unrecognized-flag output are byte-identical to the baseline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 15:32:48 +02:00
..
lib install_leechblock: split into lib/ under the 250-line cap 2026-08-21 15:32:48 +02:00
llm-notes Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
pacman Split install_pacman_wrapper.sh into an entry plus four libs 2026-08-17 07:42:31 +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 fix(wellbeing): clear every remaining error/warning; drop thesis_tracker 2026-07-17 08:58:43 +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 feat(shutdown): night lockdown instead of power-off, so servers stay up 2026-07-17 09:09:54 +02:00
setup_night_lockdown.sh Add overnight power-save to night-lockdown; harden dnsmasq with a watchdog 2026-07-23 11:58:37 +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