diff --git a/.gitignore b/.gitignore index f12d027..028677c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Thumbs.db .idea/ .vscode/ __pycache__/ +*.pyc diff --git a/AGENTS.md b/AGENTS.md index a0fc008..6e07cd6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ missing desktop pieces, and applies a Graphite Amber identity. ## Entry points -- `run.sh` runs a fixed ordered list of `scripts/[0-9][0-9]-*.sh` steps. +- `install.sh` runs a fixed ordered list of `scripts/[0-9][0-9]-*.sh` steps. - `install.sh` is the unattended wrapper. - `scripts/verifySetup.sh` is the read-only end-state audit. @@ -28,4 +28,4 @@ missing desktop pieces, and applies a Graphite Amber identity. - `bash -n` on changed shell files. - `bash scripts/verifySetup.sh` on a target system. -- `bash run.sh --list` after adding or renaming a step. +- `bash install.sh --list` after adding or renaming a step. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index edcae5c..2c1f044 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Small changes, small pull requests. 1. Branch from `main`. 2. Make one complete change. 3. Use a Conventional Commit style title: `feat:`, `fix:`, `docs:`, `chore:`, `ci:`, `security:`. -4. Run `./run.sh --verify` before opening a pull request. +4. Run `./install.sh --verify` before opening a pull request. 5. Let the read-only CI checks pass, then squash-merge. No tests. Validation means parsers, syntax checks and the read-only verifier above. diff --git a/README.md b/README.md index d1c3c83..fe4d177 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ takes an existing devuan cinnamon desktop past stock defaults with a graphite am | | | | --- | --- | | **steps** | ten numbered steps replace the old 33 per-feature scripts. each still runs standalone. | -| **runner** | `./install.sh` runs all ten unattended. `./run.sh` asks before each step. | +| **runner** | `./install.sh` runs all ten unattended. `./install.sh` asks before each step. | | **theme** | gtk apps, terminal and update window share one graphite amber palette. | | **init** | native to openrc. no systemctl in the tree. | @@ -20,12 +20,12 @@ cd devuan-cinnamon-setup bash install.sh # everything, fully unattended (runs a verify pass at the end) bash install.sh --no-verify # skip the end-state audit # or the runner directly: -bash run.sh # run all 10 steps (deterministic, no prompts) -bash run.sh --list # show the ordered steps -bash run.sh --only 05 # run a single script by number -bash run.sh --no-update # skip the apt-get update up front -bash run.sh --verify # run scripts/verifySetup.sh (end-state audit) afterwards -bash run.sh --backup # snapshot current config via scripts/configBackup.sh first +bash install.sh # run all 10 steps (deterministic, no prompts) +bash install.sh --list # show the ordered steps +bash install.sh --only 05 # run a single script by number +bash install.sh --no-update # skip the apt-get update up front +bash install.sh --verify # run scripts/verifySetup.sh (end-state audit) afterwards +bash install.sh --backup # snapshot current config via scripts/configBackup.sh first ``` Run as your **normal user**, never `/root` and never `sudo bash ...`. diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 8b96431..a245014 --- a/install.sh +++ b/install.sh @@ -36,4 +36,4 @@ done if [ "$NO_VERIFY" -eq 0 ]; then EXTRA+=(--verify) fi -exec bash "$SCRIPT_DIR/run.sh" "${EXTRA[@]}" \ No newline at end of file +exec bash "$SCRIPT_DIR/lib/runner.sh" "${EXTRA[@]}" \ No newline at end of file diff --git a/lib/__pycache__/apply-burnmywindows-settings.cpython-313.pyc b/lib/__pycache__/apply-burnmywindows-settings.cpython-313.pyc deleted file mode 100644 index 28dcc58..0000000 Binary files a/lib/__pycache__/apply-burnmywindows-settings.cpython-313.pyc and /dev/null differ diff --git a/lib/__pycache__/dconf-list-add.cpython-313.pyc b/lib/__pycache__/dconf-list-add.cpython-313.pyc deleted file mode 100644 index 9392ab3..0000000 Binary files a/lib/__pycache__/dconf-list-add.cpython-313.pyc and /dev/null differ diff --git a/lib/__pycache__/dconf-list-remove.cpython-313.pyc b/lib/__pycache__/dconf-list-remove.cpython-313.pyc deleted file mode 100644 index b480a06..0000000 Binary files a/lib/__pycache__/dconf-list-remove.cpython-313.pyc and /dev/null differ diff --git a/lib/__pycache__/install-spice.cpython-313.pyc b/lib/__pycache__/install-spice.cpython-313.pyc deleted file mode 100644 index 96fccd3..0000000 Binary files a/lib/__pycache__/install-spice.cpython-313.pyc and /dev/null differ diff --git a/lib/__pycache__/panel-applet-add.cpython-313.pyc b/lib/__pycache__/panel-applet-add.cpython-313.pyc deleted file mode 100644 index 2191ae1..0000000 Binary files a/lib/__pycache__/panel-applet-add.cpython-313.pyc and /dev/null differ diff --git a/lib/__pycache__/set-panel-layout.cpython-313.pyc b/lib/__pycache__/set-panel-layout.cpython-313.pyc deleted file mode 100644 index c1252e3..0000000 Binary files a/lib/__pycache__/set-panel-layout.cpython-313.pyc and /dev/null differ diff --git a/lib/common.sh b/lib/common.sh index f94076e..7dc0e50 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -100,7 +100,7 @@ purge_if_installed() { } # Refresh apt package lists exactly once per run. Honors -# DEBSWAY_SKIP_APT_UPDATE=1 (set automatically by run.sh/install.sh after the +# DEBSWAY_SKIP_APT_UPDATE=1 (set automatically by install.sh/install.sh after the # first successful refresh so the remaining ~15 steps don't re-refresh). apt_update() { if [ "${DEBSWAY_SKIP_APT_UPDATE:-0}" = "1" ]; then @@ -173,7 +173,7 @@ service_restart() { esac } -ACTUAL_USER="${SUDO_USER:-$USER}" +ACTUAL_USER="${SUDO_USER:-${USER:-$(id -un)}}" run_as_user() { if [ "$(id -un)" = "$ACTUAL_USER" ]; then "$@" diff --git a/run.sh b/lib/runner.sh similarity index 84% rename from run.sh rename to lib/runner.sh index f1070fe..02cdf32 100644 --- a/run.sh +++ b/lib/runner.sh @@ -13,20 +13,20 @@ # the apps that 06+ finish wiring up). # # Usage: -# bash run.sh # run everything -# bash run.sh --yes # same as above (DEBSWAY_ASSUME_YES=1, default) -# bash run.sh --list # just show the ordered steps -# bash run.sh --only 05 # run a single script by number -# bash run.sh --no-update # skip apt-get update up front -# bash run.sh --verify # run scripts/verifySetup.sh afterwards -# bash run.sh --backup # run scripts/configBackup.sh first +# bash install.sh # run everything +# bash install.sh --yes # same as above (DEBSWAY_ASSUME_YES=1, default) +# bash install.sh --list # just show the ordered steps +# bash install.sh --only 05 # run a single script by number +# bash install.sh --no-update # skip apt-get update up front +# bash install.sh --verify # run scripts/verifySetup.sh afterwards +# bash install.sh --backup # run scripts/configBackup.sh first # ========================================== set -uo pipefail # NOTE: intentionally not using `set -e` - one script failing (say, a flaky # download in an installer step) shouldn't abort every later step. Each # script exits non-zero on failure so this runner can report it and carry on. -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SCRIPTS_DIR="$SCRIPT_DIR/scripts" # shellcheck source=lib/common.sh @@ -37,7 +37,7 @@ source "$SCRIPT_DIR/lib/common.sh" # ~/.local/bin) must land in the real user's $HOME, not /root. Scripts call # sudo themselves for the parts that need it. if [ "$(id -u)" -eq 0 ] && [ -z "${SUDO_USER:-}" ]; then - echo -e "${RED}Please run this as your normal user, not as root / sudo bash run.sh.${NC}" + echo -e "${RED}Please run this as your normal user, not as root / sudo bash install.sh.${NC}" echo -e "${YELLOW}Each script will call sudo itself for the parts that need it.${NC}" exit 1 fi @@ -69,14 +69,17 @@ for arg in "$@"; do done # --- Distro check (Devuan or Debian; both ship /etc/debian_version) --- -if [ -f /etc/devuan_version ]; then - echo -e "${GREEN}Devuan detected: $(cat /etc/devuan_version)${NC}" -elif [ -f /etc/debian_version ]; then - echo -e "${YELLOW}Debian-based system detected: $(cat /etc/debian_version) (not Devuan - most of this should still work)${NC}" -else - echo -e "${YELLOW}Warning: this toolkit targets Devuan/Debian. Your system may not be compatible.${NC}" - read -r -p "Continue anyway? (y/N): " continue_anyway - [[ "$continue_anyway" =~ ^[Yy]$ ]] || exit 1 +# --list is read-only and host-independent, so it skips the compatibility gate. +if [ "$SHOW_LIST" -eq 0 ]; then + if [ -f /etc/devuan_version ]; then + echo -e "${GREEN}Devuan detected: $(cat /etc/devuan_version)${NC}" + elif [ -f /etc/debian_version ]; then + echo -e "${YELLOW}Debian-based system detected: $(cat /etc/debian_version) (not Devuan - most of this should still work)${NC}" + else + echo -e "${YELLOW}Warning: this toolkit targets Devuan/Debian. Your system may not be compatible.${NC}" + read -r -p "Continue anyway? (y/N): " continue_anyway + [[ "$continue_anyway" =~ ^[Yy]$ ]] || exit 1 + fi fi # --- Init system check --- @@ -124,7 +127,7 @@ if [ "$SHOW_LIST" -eq 1 ]; then echo -e "${BLUE}Devuan Cinnamon Setup - ordered steps:${NC}" show_list echo - echo -e "${YELLOW}Run everything with: bash run.sh${NC}" + echo -e "${YELLOW}Run everything with: bash install.sh${NC}" exit 0 fi @@ -135,7 +138,7 @@ STATE_LOG="$STATE_DIR/last-run.log" record_run() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >> "$STATE_LOG" } -record_run "run.sh start (flags: $*) init=$(init_system)" +record_run "install.sh start (flags: $*) init=$(init_system)" FAILED=() @@ -224,9 +227,9 @@ fi if [ "${#FAILED[@]}" -gt 0 ]; then echo -e "${RED}Failed: ${FAILED[*]}${NC}" echo -e "${YELLOW}Re-run individual scripts with: bash scripts/.sh${NC}" - record_run "run.sh end: FAILED=${FAILED[*]}" + record_run "install.sh end: FAILED=${FAILED[*]}" exit 1 fi -record_run "run.sh end: all OK" +record_run "install.sh end: all OK" echo -e "${GREEN}Done. A logout/reboot is recommended (groups, theme, compositor, shell all benefit from a fresh session).${NC}" \ No newline at end of file diff --git a/scripts/05-cinnamonSetup.sh b/scripts/05-cinnamonSetup.sh index dd3dcac..cc0eac0 100644 --- a/scripts/05-cinnamonSetup.sh +++ b/scripts/05-cinnamonSetup.sh @@ -55,7 +55,7 @@ remove_extension() { # from org.cinnamon enabled-extensions (idempotent). local uuid="$1" label="$2" if [ -d "$EXT_DIR/$uuid" ]; then - rm -rf "$EXT_DIR/$uuid" + rm -rf "${EXT_DIR:?}/${uuid:?}" log_ok "$label removed." else log_info "$label not present - nothing to remove." diff --git a/scripts/systemUpdate.sh b/scripts/systemUpdate.sh index a88002d..cf2f0f7 100644 --- a/scripts/systemUpdate.sh +++ b/scripts/systemUpdate.sh @@ -4,7 +4,7 @@ # ------------------------------------------------------- # The "update everything before you start" step the essentials video # opens with. Deliberately its own script rather than baked silently -# into run.sh's startup, so it's still just an ordinary y/N step you can +# into install.sh's startup, so it's still just an ordinary y/N step you can # skip if you'd rather update later or on your own schedule. # ======================================================= set -uo pipefail diff --git a/scripts/verifySetup.sh b/scripts/verifySetup.sh index a146994..7d15bc1 100644 --- a/scripts/verifySetup.sh +++ b/scripts/verifySetup.sh @@ -6,7 +6,7 @@ # group membership, key packages, fonts, Firefox user.js, # enabled services, the Cinnamon spices this kit installs, # and the persistent palette marker. Designed to be run from -# run.sh --verify after a run, or standalone at any time. +# install.sh --verify after a run, or standalone at any time. # # Prints PASS/FAIL/WARN lines and exits non-zero if any # critical check failed, so it can gate CI/ISO validation. diff --git a/skills/devuan-cinnamon-SKILL.md b/skills/devuan-cinnamon-SKILL.md index d369d19..573bb23 100644 --- a/skills/devuan-cinnamon-SKILL.md +++ b/skills/devuan-cinnamon-SKILL.md @@ -83,7 +83,7 @@ following in mind for any system-level help you give: ``` devuan-cinnamon-setup/ ├── install.sh # one-command unattended installer (runs --verify at the end) -├── run.sh # ordered runner: --list / --only N / --yes / --no-update / --verify / --backup +├── install.sh # ordered runner: --list / --only N / --yes / --no-update / --verify / --backup ├── lib/ # shared helpers (see "Init system" + "DEBSWAY_*" vars) │ ├── common.sh # ask/log/apt_update/service/power/gsettings helpers (+ cinnamon_custom_binding) │ ├── theme-apply.sh # palette-driven app-theme appliers @@ -98,8 +98,8 @@ devuan-cinnamon-setup/ ├── config/ # palette, templates, eza/bat themes, menu app ├── scripts/ # ten numbered, independently runnable steps │ ├── 01-systemSetup.sh ... 10-aiAgents.sh -│ ├── verifySetup.sh # end-state audit (run.sh --verify) -│ ├── configBackup.sh # snapshot/restore per-user config (run.sh --backup) +│ ├── verifySetup.sh # end-state audit (install.sh --verify) +│ ├── configBackup.sh # snapshot/restore per-user config (install.sh --backup) │ └── policies.json # Firefox enterprise policy used by 08 ├── skills/ # this file └── butterbash/ # bundled shell QoL layer