Unify installer colors with vim/shell palette and clean up output
- Replace BLUE/CYAN/CYAN_BOLD with TEAL/TEAL_BOLD (#2CB494) to match the primary accent used across vim, zsh prompt, tmux, and fzf - Update BLUE (#0C48CC -> #4068D4) then merge into TEAL - Update RED (#F40404 -> #F88C14) to match vim/shell error orange - Rename GREEN to grey-blue (#7290B8) for [PASS] messages - Format all raw echo output with log functions or log_quote - Suppress sudo prompt when credentials are already cached - Add missing log_pass to 22-zsh.sh and 23-stow.sh - Convert raw 'already installed' echos to log_skip (7 scripts) - Pipe SSH key and mise output through log_quote - Suppress noisy bat cache and mise WARN output - Match fastfetch colors to palette (teal logo, grey-blue keys) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -9,11 +9,11 @@
|
|||||||
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
|
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
|
||||||
|
|
||||||
if ! command -v brew &> /dev/null; then
|
if ! command -v brew &> /dev/null; then
|
||||||
echo "Installing Homebrew..."
|
log_info "Installing Homebrew..."
|
||||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
else
|
else
|
||||||
echo "Homebrew is already installed."
|
log_skip "Homebrew already installed"
|
||||||
fi
|
fi
|
||||||
brew --version | log_quote
|
brew --version | log_quote
|
||||||
log_pass "Homebrew installed"
|
log_pass "Homebrew installed"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if [ ! -f "$ssh_key" ]; then
|
|||||||
-C "$(whoami)@$(hostname)-$(date -I)"
|
-C "$(whoami)@$(hostname)-$(date -I)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat "$ssh_pub"
|
cat "$ssh_pub" | log_quote
|
||||||
|
|
||||||
unset ssh_method ssh_target ssh_key ssh_pub
|
unset ssh_method ssh_target ssh_key ssh_pub
|
||||||
log_pass "SSH key configured"
|
log_pass "SSH key configured"
|
||||||
|
|||||||
@@ -50,3 +50,5 @@ if [[ "$SHELL" != *zsh ]]; then
|
|||||||
sudo usermod -s "$(command -v zsh)" "$(whoami)"
|
sudo usermod -s "$(command -v zsh)" "$(whoami)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log_pass "zsh configured"
|
||||||
|
|
||||||
|
|||||||
@@ -49,3 +49,5 @@ fi
|
|||||||
# Bust PATH cache to force rebuild with new profile
|
# Bust PATH cache to force rebuild with new profile
|
||||||
rm -f "${XDG_CACHE_HOME:-$HOME/.cache}/dots/path"
|
rm -f "${XDG_CACHE_HOME:-$HOME/.cache}/dots/path"
|
||||||
|
|
||||||
|
log_pass "stow linked"
|
||||||
|
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ fi
|
|||||||
|
|
||||||
bat --version | log_quote
|
bat --version | log_quote
|
||||||
|
|
||||||
bat cache --build 2>/dev/null
|
bat cache --build &>/dev/null
|
||||||
log_pass "bat theme cache built"
|
log_pass "bat theme cache built"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if ! command -v mise &>/dev/null; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "mise $(mise --version)" | log_quote
|
echo "mise $(MISE_QUIET=1 mise --version)" | log_quote
|
||||||
|
|
||||||
# Skip runtimes in Codespaces (use pre-installed versions)
|
# Skip runtimes in Codespaces (use pre-installed versions)
|
||||||
if [[ "$DOTS_ENV" != "codespaces" ]]; then
|
if [[ "$DOTS_ENV" != "codespaces" ]]; then
|
||||||
@@ -46,9 +46,9 @@ if [[ "$DOTS_ENV" != "codespaces" ]]; then
|
|||||||
)
|
)
|
||||||
|
|
||||||
log_info "Installing runtimes..."
|
log_info "Installing runtimes..."
|
||||||
mise install "${MISE_RUNTIMES[@]}"
|
MISE_QUIET=1 mise install "${MISE_RUNTIMES[@]}" 2>&1 | log_quote
|
||||||
for tool in "${MISE_RUNTIMES[@]}"; do
|
for tool in "${MISE_RUNTIMES[@]}"; do
|
||||||
mise use -g "$tool"
|
MISE_QUIET=1 mise use -g "$tool" 2>&1 | log_quote
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -76,11 +76,11 @@ fi
|
|||||||
|
|
||||||
log_info "Installing apps..."
|
log_info "Installing apps..."
|
||||||
for tool in "${MISE_APPS[@]}"; do
|
for tool in "${MISE_APPS[@]}"; do
|
||||||
mise use -g "$tool"
|
MISE_QUIET=1 mise use -g "$tool" 2>&1 | log_quote
|
||||||
done
|
done
|
||||||
|
|
||||||
# Rebuild bat theme cache with mise-installed bat (must match delta's syntect version)
|
# Rebuild bat theme cache with mise-installed bat (must match delta's syntect version)
|
||||||
bat cache --build 2>/dev/null
|
bat cache --build &>/dev/null
|
||||||
|
|
||||||
if [[ "$DOTS_ENV" != "codespaces" ]]; then
|
if [[ "$DOTS_ENV" != "codespaces" ]]; then
|
||||||
# Setup Poetry ZSH completions (XDG compliant)
|
# Setup Poetry ZSH completions (XDG compliant)
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_CASKS" | grep -q "^colour-contrast-analyser$"; then
|
if ! echo "$BREW_CASKS" | grep -q "^colour-contrast-analyser$"; then
|
||||||
brew install --cask colour-contrast-analyser
|
brew install --cask colour-contrast-analyser
|
||||||
else
|
else
|
||||||
echo "Colour Contrast Analyser (CCA) is already installed."
|
log_skip "CCA already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "CCA installed"
|
log_pass "CCA installed"
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_CASKS" | grep -q "^rectangle$"; then
|
if ! echo "$BREW_CASKS" | grep -q "^rectangle$"; then
|
||||||
brew install --cask rectangle
|
brew install --cask rectangle
|
||||||
else
|
else
|
||||||
echo "Rectangle is already installed."
|
log_skip "Rectangle already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "Rectangle installed"
|
log_pass "Rectangle installed"
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_CASKS" | grep -q "^meetingbar$"; then
|
if ! echo "$BREW_CASKS" | grep -q "^meetingbar$"; then
|
||||||
brew install --cask meetingbar
|
brew install --cask meetingbar
|
||||||
else
|
else
|
||||||
echo "MeetingBar is already installed."
|
log_skip "MeetingBar already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "MeetingBar installed"
|
log_pass "MeetingBar installed"
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_CASKS" | grep -q "^betterdisplay$"; then
|
if ! echo "$BREW_CASKS" | grep -q "^betterdisplay$"; then
|
||||||
brew install --cask betterdisplay
|
brew install --cask betterdisplay
|
||||||
else
|
else
|
||||||
echo "BetterDisplay is already installed."
|
log_skip "BetterDisplay already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "BetterDisplay installed"
|
log_pass "BetterDisplay installed"
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_FORMULAE" | grep -q "^dockutil$"; then
|
if ! echo "$BREW_FORMULAE" | grep -q "^dockutil$"; then
|
||||||
brew install dockutil
|
brew install dockutil
|
||||||
else
|
else
|
||||||
echo "dockutil is already installed."
|
log_skip "dockutil already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "dockutil installed"
|
log_pass "dockutil installed"
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
if ! echo "$BREW_CASKS" | grep -q "^wispr-flow$"; then
|
if ! echo "$BREW_CASKS" | grep -q "^wispr-flow$"; then
|
||||||
brew install --cask wispr-flow
|
brew install --cask wispr-flow
|
||||||
else
|
else
|
||||||
echo "Wispr Flow is already installed."
|
log_skip "Wispr Flow already installed"
|
||||||
fi
|
fi
|
||||||
log_pass "Wispr Flow installed"
|
log_pass "Wispr Flow installed"
|
||||||
|
|||||||
@@ -8,5 +8,9 @@
|
|||||||
# Skip in Codespaces (cosmetic only)
|
# Skip in Codespaces (cosmetic only)
|
||||||
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
|
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
|
||||||
|
|
||||||
fastfetch --pipe false
|
fastfetch --pipe false \
|
||||||
|
--logo-color-1 "38;2;44;180;148" \
|
||||||
|
--color-title "38;2;44;180;148" \
|
||||||
|
--color-keys "38;2;114;144;184" \
|
||||||
|
--color-separator "38;2;128;128;128"
|
||||||
|
|
||||||
|
|||||||
@@ -6,18 +6,16 @@ set -eo pipefail
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [[ -t 1 && -n "$TERM" && "$TERM" != "dumb" ]]; then
|
if [[ -t 1 && -n "$TERM" && "$TERM" != "dumb" ]]; then
|
||||||
BLUE=$'\033[38;2;12;72;204m'
|
TEAL=$'\033[38;2;44;180;148m'
|
||||||
CYAN=$'\033[38;2;0;228;252m'
|
TEAL_BOLD=$'\033[1;38;2;44;180;148m'
|
||||||
CYAN_BOLD=$'\033[1;38;2;0;228;252m'
|
RED=$'\033[38;2;248;140;20m'
|
||||||
RED=$'\033[38;2;244;4;4m'
|
GREEN=$'\033[38;2;114;144;184m'
|
||||||
GREEN=$'\033[38;2;44;180;148m'
|
|
||||||
YELLOW=$'\033[38;2;252;252;56m'
|
YELLOW=$'\033[38;2;252;252;56m'
|
||||||
GREY=$'\033[38;2;128;128;128m'
|
GREY=$'\033[38;2;128;128;128m'
|
||||||
NC=$'\033[0m'
|
NC=$'\033[0m'
|
||||||
else
|
else
|
||||||
BLUE=""
|
TEAL=""
|
||||||
CYAN=""
|
TEAL_BOLD=""
|
||||||
CYAN_BOLD=""
|
|
||||||
RED=""
|
RED=""
|
||||||
GREEN=""
|
GREEN=""
|
||||||
YELLOW=""
|
YELLOW=""
|
||||||
@@ -26,18 +24,18 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Log functions
|
# Log functions
|
||||||
log_info() { echo -e "${BLUE}[INFO]${NC} $*"; }
|
log_info() { echo -e "${TEAL}[INFO]${NC} $*"; }
|
||||||
log_pass() { echo -e "${GREEN}[PASS]${NC} $*"; }
|
log_pass() { echo -e "${GREEN}[PASS]${NC} $*"; }
|
||||||
log_skip() { echo -e "${GREY}[SKIP]${NC} $*"; }
|
log_skip() { echo -e "${GREY}[SKIP]${NC} $*"; }
|
||||||
log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
|
||||||
log_error() { echo -e "${RED}[FAIL]${NC} $*"; }
|
log_error() { echo -e "${RED}[FAIL]${NC} $*"; }
|
||||||
log_debug() { echo -e "${CYAN}$*${NC}"; }
|
log_debug() { echo -e "${TEAL}$*${NC}"; }
|
||||||
log_quote() { sed "s/^/ ${GREY}│ /" | sed "s/$/${NC}/"; }
|
log_quote() { sed "s/^/ ${GREY}│ /" | sed "s/$/${NC}/"; }
|
||||||
|
|
||||||
# Export log functions
|
# Export log functions
|
||||||
export -f log_info log_pass log_skip log_warn log_error log_debug log_quote
|
export -f log_info log_pass log_skip log_warn log_error log_debug log_quote
|
||||||
|
|
||||||
printf "\n\t${CYAN} <<< ${CYAN_BOLD}dots${CYAN} >>> ${NC}\n"
|
printf "\n\t${TEAL} <<< ${TEAL_BOLD}dots${TEAL} >>> ${NC}\n"
|
||||||
printf "\t${GREY}==============${NC}\n\n"
|
printf "\t${GREY}==============${NC}\n\n"
|
||||||
|
|
||||||
# High-resolution time helpers
|
# High-resolution time helpers
|
||||||
@@ -55,8 +53,10 @@ fi
|
|||||||
|
|
||||||
# Ensure sudo credentials are cached
|
# Ensure sudo credentials are cached
|
||||||
if [[ -z "$SKIP_SUDO_CHECK" ]]; then
|
if [[ -z "$SKIP_SUDO_CHECK" ]]; then
|
||||||
echo -e "${YELLOW}Checking sudo credentials...${NC}"
|
if ! sudo -n true 2>/dev/null; then
|
||||||
sudo -v
|
log_warn "Requesting sudo authentication..."
|
||||||
|
sudo -v
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up environment
|
# Set up environment
|
||||||
@@ -127,13 +127,15 @@ targets=($@)
|
|||||||
|
|
||||||
# Run install scripts
|
# Run install scripts
|
||||||
run() {
|
run() {
|
||||||
echo -e "Running \"$(basename "$0")\" at \"$(date)\""
|
{
|
||||||
echo -e "Running as \"$(whoami)\" on \"$(hostname)\""
|
echo "Running \"$(basename "$0")\" at \"$(date)\""
|
||||||
if [[ -n "$targets" ]]; then
|
echo "Running as \"$(whoami)\" on \"$(hostname)\""
|
||||||
echo -e "Running ${YELLOW}${#targets[@]}${NC} install target(s): ${YELLOW}${targets[@]}${NC}"
|
if [[ -n "$targets" ]]; then
|
||||||
else
|
echo "Running ${#targets[@]} install target(s): ${targets[*]}"
|
||||||
echo -e "Running all install targets"
|
else
|
||||||
fi
|
echo "Running all install targets"
|
||||||
|
fi
|
||||||
|
} | log_quote
|
||||||
|
|
||||||
scripts=("$install_dir"/*.sh)
|
scripts=("$install_dir"/*.sh)
|
||||||
for script in "${scripts[@]}"; do
|
for script in "${scripts[@]}"; do
|
||||||
@@ -147,7 +149,7 @@ run() {
|
|||||||
|
|
||||||
local script_name=$(basename "$script")
|
local script_name=$(basename "$script")
|
||||||
|
|
||||||
printf "\n\n${CYAN}<<< ${CYAN_BOLD}$script_name:${NC}\n"
|
printf "\n\n${TEAL}<<< ${TEAL_BOLD}$script_name:${NC}\n"
|
||||||
local start_ns=$(now_ns)
|
local start_ns=$(now_ns)
|
||||||
source "$script"
|
source "$script"
|
||||||
local end_ns=$(now_ns)
|
local end_ns=$(now_ns)
|
||||||
@@ -161,11 +163,11 @@ run() {
|
|||||||
else
|
else
|
||||||
time_color="$RED"
|
time_color="$RED"
|
||||||
fi
|
fi
|
||||||
printf "${CYAN}>>> ${CYAN_BOLD}${script_name}, ${NC}"
|
printf "${TEAL}>>> ${TEAL_BOLD}${script_name}, ${NC}"
|
||||||
printf "completed in ${time_color}${execution_ms_formatted}ms${NC}\n"
|
printf "completed in ${time_color}${execution_ms_formatted}ms${NC}\n"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
echo -e "\ninstall: Logging to \"$log_abs_target\""
|
echo -e "\n${GREY}Logging to \"$log_abs_target\"${NC}"
|
||||||
total_start_ns=$(now_ns)
|
total_start_ns=$(now_ns)
|
||||||
run 2>&1 | tee "$log_abs_target"
|
run 2>&1 | tee "$log_abs_target"
|
||||||
total_end_ns=$(now_ns)
|
total_end_ns=$(now_ns)
|
||||||
@@ -173,5 +175,5 @@ total_end_ns=$(now_ns)
|
|||||||
total_ms=$(( (total_end_ns - total_start_ns) / 1000000 ))
|
total_ms=$(( (total_end_ns - total_start_ns) / 1000000 ))
|
||||||
total_s=$(( total_ms / 1000 ))
|
total_s=$(( total_ms / 1000 ))
|
||||||
total_ms_rem=$(( total_ms % 1000 ))
|
total_ms_rem=$(( total_ms % 1000 ))
|
||||||
echo -e "\nThank you!"
|
printf "\n${TEAL}Thank you!${NC}\n"
|
||||||
printf "Total time: ${GREEN}%d.%03ds${NC}\n\n" "$total_s" "$total_ms_rem"
|
printf "Total time: ${GREEN}%d.%03ds${NC}\n\n" "$total_s" "$total_ms_rem"
|
||||||
|
|||||||
Reference in New Issue
Block a user