feat(post-boot): add cli-tools and Dank Linux opt-in scripts, wire into first-boot
- commit
- 1553a956b0d8c33df7ff7a2e38b6d7a7decf5d97
- author
- bnema · · 2026-02-26 21:11 UTC
- committer
- bnema · · 2026-02-26 21:14 UTC
- parent
- 95606ea
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +145 -0
M install/mandatory/post-boot/all.sh +15 -0
| @@ -68,6 +68,21 @@ if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then | |||
| 68 | 68 | fi | |
| 69 | 69 | fi | |
| 70 | 70 | ||
| 71 | + | # Install modern CLI toolkit | |
| 72 | + | if [ -f /usr/local/share/archup/post-boot/cli-tools.sh ]; then | |
| 73 | + | echo "Installing modern CLI toolkit..." | tee -a "$LOG_FILE" | |
| 74 | + | if bash /usr/local/share/archup/post-boot/cli-tools.sh >> "$LOG_FILE" 2>&1; then | |
| 75 | + | echo "[OK] CLI tools installed" | tee -a "$LOG_FILE" | |
| 76 | + | else | |
| 77 | + | echo "[KO] CLI tools installation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 78 | + | fi | |
| 79 | + | fi | |
| 80 | + | ||
| 81 | + | # Optional Dank Linux installation (interactive — do NOT pipe stdin) | |
| 82 | + | if [ -f /usr/local/share/archup/post-boot/dms-opt-in.sh ]; then | |
| 83 | + | bash /usr/local/share/archup/post-boot/dms-opt-in.sh || true | |
| 84 | + | fi | |
| 85 | + | ||
| 71 | 86 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | |
| 72 | 87 | ||
| 73 | 88 | # Disable this service after first run | |
| @@ -68,6 +68,21 @@ if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then | |||||
| 68 | fi | 68 | fi | ||
| 69 | fi | 69 | fi | ||
| 70 | 70 | ||||
| 71 | + | # Install modern CLI toolkit | |||
| 72 | + | if [ -f /usr/local/share/archup/post-boot/cli-tools.sh ]; then | |||
| 73 | + | echo "Installing modern CLI toolkit..." | tee -a "$LOG_FILE" | |||
| 74 | + | if bash /usr/local/share/archup/post-boot/cli-tools.sh >> "$LOG_FILE" 2>&1; then | |||
| 75 | + | echo "[OK] CLI tools installed" | tee -a "$LOG_FILE" | |||
| 76 | + | else | |||
| 77 | + | echo "[KO] CLI tools installation failed (non-critical)" | tee -a "$LOG_FILE" | |||
| 78 | + | fi | |||
| 79 | + | fi | |||
| 80 | + | ||||
| 81 | + | # Optional Dank Linux installation (interactive — do NOT pipe stdin) | |||
| 82 | + | if [ -f /usr/local/share/archup/post-boot/dms-opt-in.sh ]; then | |||
| 83 | + | bash /usr/local/share/archup/post-boot/dms-opt-in.sh || true | |||
| 84 | + | fi | |||
| 85 | + | ||||
| 71 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | 86 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | ||
| 72 | 87 | ||||
| 73 | # Disable this service after first run | 88 | # Disable this service after first run | ||
A install/mandatory/post-boot/cli-tools.sh +81 -0
| @@ -0,0 +1,81 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # cli-tools.sh — Install modern CLI toolkit (barebone, no DE or theme) | |
| 3 | + | set -euo pipefail | |
| 4 | + | ||
| 5 | + | LOG_FILE="/var/log/archup-first-boot.log" | |
| 6 | + | USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 {print $1; exit}') | |
| 7 | + | USER_HOME="/home/$USERNAME" | |
| 8 | + | ||
| 9 | + | log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; } | |
| 10 | + | ||
| 11 | + | if [[ -z "$USERNAME" ]]; then | |
| 12 | + | log "ERROR: Could not detect user in /home" | |
| 13 | + | exit 1 | |
| 14 | + | fi | |
| 15 | + | ||
| 16 | + | log "Installing modern CLI toolkit for $USERNAME..." | |
| 17 | + | ||
| 18 | + | pacman -S --needed --noconfirm \ | |
| 19 | + | eza bat fd ripgrep fzf zoxide starship \ | |
| 20 | + | btop yazi git-delta gdu procs tealdeer \ | |
| 21 | + | lazygit atuin man-db neovim wget curl git | |
| 22 | + | ||
| 23 | + | log "Writing ~/.bashrc for $USERNAME..." | |
| 24 | + | ||
| 25 | + | # Back up existing .bashrc if present | |
| 26 | + | if [ -f "$USER_HOME/.bashrc" ]; then | |
| 27 | + | cp "$USER_HOME/.bashrc" "$USER_HOME/.bashrc.bak" | |
| 28 | + | log "Backed up existing .bashrc to .bashrc.bak" | |
| 29 | + | fi | |
| 30 | + | ||
| 31 | + | cat > "$USER_HOME/.bashrc" << 'BASHRC' | |
| 32 | + | # ArchUp barebone bash — modern CLI tools | |
| 33 | + | # Aliases | |
| 34 | + | alias ls='eza --icons' | |
| 35 | + | alias ll='eza -la --icons --git' | |
| 36 | + | alias la='eza -a --icons' | |
| 37 | + | alias lt='eza --tree --icons' | |
| 38 | + | alias cat='bat' | |
| 39 | + | alias grep='rg' | |
| 40 | + | alias find='fd' | |
| 41 | + | alias top='btop' | |
| 42 | + | alias vim='nvim' | |
| 43 | + | alias vi='nvim' | |
| 44 | + | ||
| 45 | + | # Git delta pager | |
| 46 | + | export GIT_PAGER='delta' | |
| 47 | + | ||
| 48 | + | # Man pages rendered with bat | |
| 49 | + | export MANPAGER="sh -c 'col -bx | bat -l man -p'" | |
| 50 | + | ||
| 51 | + | # fzf key bindings and fuzzy completion | |
| 52 | + | source <(fzf --bash) 2>/dev/null || true | |
| 53 | + | ||
| 54 | + | # zoxide (smart cd with frecency) | |
| 55 | + | eval "$(zoxide init bash)" | |
| 56 | + | [[ $- == *i* ]] && alias cd='z' | |
| 57 | + | ||
| 58 | + | # atuin (shell history search) | |
| 59 | + | eval "$(atuin init bash)" 2>/dev/null || true | |
| 60 | + | ||
| 61 | + | # starship prompt (no custom theme — uses default) | |
| 62 | + | eval "$(starship init bash)" | |
| 63 | + | ||
| 64 | + | # ble.sh (Bash Line Editor) — must be sourced last | |
| 65 | + | [[ $- == *i* ]] && source -- ~/.local/share/blesh/ble.sh 2>/dev/null || true | |
| 66 | + | BASHRC | |
| 67 | + | ||
| 68 | + | chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc" | |
| 69 | + | ||
| 70 | + | # Update tldr cache | |
| 71 | + | sudo -u "$USERNAME" tldr --update 2>/dev/null || true | |
| 72 | + | ||
| 73 | + | # git delta global config | |
| 74 | + | sudo -u "$USERNAME" git config --global core.pager delta | |
| 75 | + | sudo -u "$USERNAME" git config --global interactive.diffFilter "delta --color-only" | |
| 76 | + | sudo -u "$USERNAME" git config --global delta.navigate true | |
| 77 | + | sudo -u "$USERNAME" git config --global delta.side-by-side true | |
| 78 | + | sudo -u "$USERNAME" git config --global merge.conflictstyle diff3 | |
| 79 | + | sudo -u "$USERNAME" git config --global diff.colorMoved default | |
| 80 | + | ||
| 81 | + | log "CLI toolkit installed successfully." | |
| @@ -0,0 +1,81 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # cli-tools.sh — Install modern CLI toolkit (barebone, no DE or theme) | |||
| 3 | + | set -euo pipefail | |||
| 4 | + | ||||
| 5 | + | LOG_FILE="/var/log/archup-first-boot.log" | |||
| 6 | + | USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 {print $1; exit}') | |||
| 7 | + | USER_HOME="/home/$USERNAME" | |||
| 8 | + | ||||
| 9 | + | log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; } | |||
| 10 | + | ||||
| 11 | + | if [[ -z "$USERNAME" ]]; then | |||
| 12 | + | log "ERROR: Could not detect user in /home" | |||
| 13 | + | exit 1 | |||
| 14 | + | fi | |||
| 15 | + | ||||
| 16 | + | log "Installing modern CLI toolkit for $USERNAME..." | |||
| 17 | + | ||||
| 18 | + | pacman -S --needed --noconfirm \ | |||
| 19 | + | eza bat fd ripgrep fzf zoxide starship \ | |||
| 20 | + | btop yazi git-delta gdu procs tealdeer \ | |||
| 21 | + | lazygit atuin man-db neovim wget curl git | |||
| 22 | + | ||||
| 23 | + | log "Writing ~/.bashrc for $USERNAME..." | |||
| 24 | + | ||||
| 25 | + | # Back up existing .bashrc if present | |||
| 26 | + | if [ -f "$USER_HOME/.bashrc" ]; then | |||
| 27 | + | cp "$USER_HOME/.bashrc" "$USER_HOME/.bashrc.bak" | |||
| 28 | + | log "Backed up existing .bashrc to .bashrc.bak" | |||
| 29 | + | fi | |||
| 30 | + | ||||
| 31 | + | cat > "$USER_HOME/.bashrc" << 'BASHRC' | |||
| 32 | + | # ArchUp barebone bash — modern CLI tools | |||
| 33 | + | # Aliases | |||
| 34 | + | alias ls='eza --icons' | |||
| 35 | + | alias ll='eza -la --icons --git' | |||
| 36 | + | alias la='eza -a --icons' | |||
| 37 | + | alias lt='eza --tree --icons' | |||
| 38 | + | alias cat='bat' | |||
| 39 | + | alias grep='rg' | |||
| 40 | + | alias find='fd' | |||
| 41 | + | alias top='btop' | |||
| 42 | + | alias vim='nvim' | |||
| 43 | + | alias vi='nvim' | |||
| 44 | + | ||||
| 45 | + | # Git delta pager | |||
| 46 | + | export GIT_PAGER='delta' | |||
| 47 | + | ||||
| 48 | + | # Man pages rendered with bat | |||
| 49 | + | export MANPAGER="sh -c 'col -bx | bat -l man -p'" | |||
| 50 | + | ||||
| 51 | + | # fzf key bindings and fuzzy completion | |||
| 52 | + | source <(fzf --bash) 2>/dev/null || true | |||
| 53 | + | ||||
| 54 | + | # zoxide (smart cd with frecency) | |||
| 55 | + | eval "$(zoxide init bash)" | |||
| 56 | + | [[ $- == *i* ]] && alias cd='z' | |||
| 57 | + | ||||
| 58 | + | # atuin (shell history search) | |||
| 59 | + | eval "$(atuin init bash)" 2>/dev/null || true | |||
| 60 | + | ||||
| 61 | + | # starship prompt (no custom theme — uses default) | |||
| 62 | + | eval "$(starship init bash)" | |||
| 63 | + | ||||
| 64 | + | # ble.sh (Bash Line Editor) — must be sourced last | |||
| 65 | + | [[ $- == *i* ]] && source -- ~/.local/share/blesh/ble.sh 2>/dev/null || true | |||
| 66 | + | BASHRC | |||
| 67 | + | ||||
| 68 | + | chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc" | |||
| 69 | + | ||||
| 70 | + | # Update tldr cache | |||
| 71 | + | sudo -u "$USERNAME" tldr --update 2>/dev/null || true | |||
| 72 | + | ||||
| 73 | + | # git delta global config | |||
| 74 | + | sudo -u "$USERNAME" git config --global core.pager delta | |||
| 75 | + | sudo -u "$USERNAME" git config --global interactive.diffFilter "delta --color-only" | |||
| 76 | + | sudo -u "$USERNAME" git config --global delta.navigate true | |||
| 77 | + | sudo -u "$USERNAME" git config --global delta.side-by-side true | |||
| 78 | + | sudo -u "$USERNAME" git config --global merge.conflictstyle diff3 | |||
| 79 | + | sudo -u "$USERNAME" git config --global diff.colorMoved default | |||
| 80 | + | ||||
| 81 | + | log "CLI toolkit installed successfully." | |||
A install/mandatory/post-boot/dms-opt-in.sh +49 -0
| @@ -0,0 +1,49 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # dms-opt-in.sh — Optional Dank Linux full suite installation prompt | |
| 3 | + | # Runs at end of first-boot setup. Asks user if they want the full | |
| 4 | + | # Dank Linux desktop (compositor + DMS shell + terminal + all tools). | |
| 5 | + | set -euo pipefail | |
| 6 | + | ||
| 7 | + | LOG_FILE="/var/log/archup-first-boot.log" | |
| 8 | + | ||
| 9 | + | log() { echo "[dms-opt-in] $*" | tee -a "$LOG_FILE"; } | |
| 10 | + | ||
| 11 | + | # Skip if not running in an interactive terminal | |
| 12 | + | if [ ! -t 0 ]; then | |
| 13 | + | log "Not running in interactive terminal — skipping Dank Linux opt-in." | |
| 14 | + | exit 0 | |
| 15 | + | fi | |
| 16 | + | ||
| 17 | + | echo "" | |
| 18 | + | echo "==============================================" | |
| 19 | + | echo " Dank Linux — Optional Install" | |
| 20 | + | echo "==============================================" | |
| 21 | + | echo "" | |
| 22 | + | echo " Dank Linux is a full Wayland desktop suite:" | |
| 23 | + | echo " - Compositor: niri or Hyprland (your choice)" | |
| 24 | + | echo " - Shell: DankMaterialShell (Quickshell/Go)" | |
| 25 | + | echo " - Terminal: Ghostty" | |
| 26 | + | echo " - Auto-theming, notifications, app launcher," | |
| 27 | + | echo " lock screen, system tray, search — all" | |
| 28 | + | echo " integrated. One install. Everything works." | |
| 29 | + | echo "" | |
| 30 | + | echo " Install: curl -fsSL https://install.danklinux.com | sh" | |
| 31 | + | echo "" | |
| 32 | + | ||
| 33 | + | read -r -p " Do you want to run the Dank Linux installer? [y/N] " REPLY || true | |
| 34 | + | echo "" | |
| 35 | + | ||
| 36 | + | case "$REPLY" in | |
| 37 | + | [yY][eE][sS]|[yY]) | |
| 38 | + | log "User opted in — starting Dank Linux installer." | |
| 39 | + | echo "Starting Dank Linux installer..." | |
| 40 | + | curl -fsSL https://install.danklinux.com | sh | |
| 41 | + | log "Dank Linux installation complete." | |
| 42 | + | ;; | |
| 43 | + | *) | |
| 44 | + | log "User skipped Dank Linux installation." | |
| 45 | + | echo "Skipping. Install later with:" | |
| 46 | + | echo " curl -fsSL https://install.danklinux.com | sh" | |
| 47 | + | echo "" | |
| 48 | + | ;; | |
| 49 | + | esac | |
| @@ -0,0 +1,49 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # dms-opt-in.sh — Optional Dank Linux full suite installation prompt | |||
| 3 | + | # Runs at end of first-boot setup. Asks user if they want the full | |||
| 4 | + | # Dank Linux desktop (compositor + DMS shell + terminal + all tools). | |||
| 5 | + | set -euo pipefail | |||
| 6 | + | ||||
| 7 | + | LOG_FILE="/var/log/archup-first-boot.log" | |||
| 8 | + | ||||
| 9 | + | log() { echo "[dms-opt-in] $*" | tee -a "$LOG_FILE"; } | |||
| 10 | + | ||||
| 11 | + | # Skip if not running in an interactive terminal | |||
| 12 | + | if [ ! -t 0 ]; then | |||
| 13 | + | log "Not running in interactive terminal — skipping Dank Linux opt-in." | |||
| 14 | + | exit 0 | |||
| 15 | + | fi | |||
| 16 | + | ||||
| 17 | + | echo "" | |||
| 18 | + | echo "==============================================" | |||
| 19 | + | echo " Dank Linux — Optional Install" | |||
| 20 | + | echo "==============================================" | |||
| 21 | + | echo "" | |||
| 22 | + | echo " Dank Linux is a full Wayland desktop suite:" | |||
| 23 | + | echo " - Compositor: niri or Hyprland (your choice)" | |||
| 24 | + | echo " - Shell: DankMaterialShell (Quickshell/Go)" | |||
| 25 | + | echo " - Terminal: Ghostty" | |||
| 26 | + | echo " - Auto-theming, notifications, app launcher," | |||
| 27 | + | echo " lock screen, system tray, search — all" | |||
| 28 | + | echo " integrated. One install. Everything works." | |||
| 29 | + | echo "" | |||
| 30 | + | echo " Install: curl -fsSL https://install.danklinux.com | sh" | |||
| 31 | + | echo "" | |||
| 32 | + | ||||
| 33 | + | read -r -p " Do you want to run the Dank Linux installer? [y/N] " REPLY || true | |||
| 34 | + | echo "" | |||
| 35 | + | ||||
| 36 | + | case "$REPLY" in | |||
| 37 | + | [yY][eE][sS]|[yY]) | |||
| 38 | + | log "User opted in — starting Dank Linux installer." | |||
| 39 | + | echo "Starting Dank Linux installer..." | |||
| 40 | + | curl -fsSL https://install.danklinux.com | sh | |||
| 41 | + | log "Dank Linux installation complete." | |||
| 42 | + | ;; | |||
| 43 | + | *) | |||
| 44 | + | log "User skipped Dank Linux installation." | |||
| 45 | + | echo "Skipping. Install later with:" | |||
| 46 | + | echo " curl -fsSL https://install.danklinux.com | sh" | |||
| 47 | + | echo "" | |||
| 48 | + | ;; | |||
| 49 | + | esac | |||