testsAndMisc/scripts/utils
Krzysztof kuhy Rudnicki 51fb0d6064 Refactor: Extract common code to shared library
Created scripts/lib/common.sh with shared functions:
- log_message(), log() - consistent logging with timestamps
- require_root() - root privilege checking with optional sudo re-exec
- get_actual_user(), get_actual_user_home() - handle SUDO_USER properly
- parse_interactive_args() - standard --interactive/-i and --help/-h handling
- notify() - cross-platform desktop notifications
- require_command(), ensure_dir() - common utility functions
- enable_service(), is_service_active() - systemd helpers

Refactored scripts to use common library:
- block_compulsive_opening.sh
- setup_pc_startup_monitor.sh
- setup_periodic_system.sh
- setup_thorium_startup.sh
- nvidia_troubleshoot.sh
- hosts/guard/setup_hosts_guard.sh
- hosts/guard/enforce-hosts.sh

Merged duplicate scripts:
- Created convert_video.sh (combined to_mp4.sh and to_webm.sh)
- Removed pdf_to_png.sh (was identical to pdf_to_image.sh)

Reduced duplication from 4.08% (48 clones) to 1.86% (26 clones)
2025-12-11 17:43:50 +01:00
..
convert_video.sh Refactor: Extract common code to shared library 2025-12-11 17:43:50 +01:00
convert_words.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
format_sd_card.sh feat: script for formatting sd card 2025-11-14 14:49:51 +01:00
image_to_resolution.sh feat: add 4 utils 2025-11-14 15:44:34 +01:00
organize_downloads.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
pdf_to_image.sh feat: add 4 utils 2025-11-14 15:44:34 +01:00
root_bl9000.sh chore: rooting bl9000 with etc hosts 2025-11-17 11:14:38 +01:00
setup_android_adblock.sh Refactor: Extract common code to shared library 2025-12-11 17:43:50 +01:00
setup_media_organizer.sh fix: repair media-organizer.service and prevent future issues 2025-12-04 20:31:44 +01:00
setup_passwordless_system.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
sort_downloads.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
steam_compatibility.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
to_mp4.sh Refactor: Extract common code to shared library 2025-12-11 17:43:50 +01:00
to_webm.sh Refactor: Extract common code to shared library 2025-12-11 17:43:50 +01:00
toggle_mic.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
toggle_wheel.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
toggle_window_manager.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
turn_off_auto_idle_screen_shutdown.sh fix: shellcheck issues 2025-11-01 15:36:22 +01:00
txt_to_image.sh feat: add 4 utils 2025-11-14 15:44:34 +01:00
update_android_hosts.sh Refactor: Extract common code to shared library 2025-12-11 17:43:50 +01:00