diff --git a/home/.vimrc b/home/.vimrc index 5c0923f..a5ccb7a 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -55,6 +55,8 @@ let g:netrw_browse_split = 4 set background=dark if has('termguicolors') && ($COLORTERM ==# 'truecolor' || $COLORTERM ==# '24bit') + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors endif diff --git a/home/.zshrc b/home/.zshrc index 2d41306..4dbeb7d 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -1,6 +1,9 @@ # Profiling: ZSH_BENCH=1 zsh [[ -n "$ZSH_BENCH" ]] && zmodload zsh/zprof +# Upgrade xterm-color to xterm-256color (gh cs ssh sets the weaker value) +[[ "$TERM" == "xterm-color" ]] && export TERM=xterm-256color + # Assume truecolor support if terminal advertises 256color (covers SSH, tmux) [[ -z "$COLORTERM" && "$TERM" == *256color* ]] && export COLORTERM=truecolor diff --git a/install.d/00-os.sh b/install.d/00-os.sh index d11a47f..7bf0f18 100755 --- a/install.d/00-os.sh +++ b/install.d/00-os.sh @@ -8,10 +8,10 @@ log_info "Environment: DOTS_OS=$DOTS_OS, DOTS_PKG=$DOTS_PKG, DOTS_ENV=$DOTS_ENV" if [[ "$DOTS_OS" == "macos" ]]; then - sw_vers + sw_vers 2>&1 | log_quote elif [[ "$DOTS_OS" == "linux" ]]; then if [[ -r /etc/os-release ]]; then - cat /etc/os-release + log_quote < /etc/os-release fi if [[ -z "$DOTS_PKG" ]]; then diff --git a/install.d/10-brew.sh b/install.d/10-brew.sh index ff3a9f0..1524b76 100755 --- a/install.d/10-brew.sh +++ b/install.d/10-brew.sh @@ -15,5 +15,5 @@ if ! command -v brew &> /dev/null; then else echo "Homebrew is already installed." fi -brew --version +brew --version | log_quote log_pass "Homebrew installed" diff --git a/install.d/11-apt.sh b/install.d/11-apt.sh index d523d5e..21f341a 100755 --- a/install.d/11-apt.sh +++ b/install.d/11-apt.sh @@ -17,10 +17,17 @@ apt_packages=( wget ) +# Skip if all packages already installed +if dpkg -s "${apt_packages[@]}" &>/dev/null; then + apt --version | log_quote + return 0 +fi + sudo apt-get update -qq sudo apt-get install -qq "${apt_packages[@]}" unset apt_packages -apt --version +apt --version | log_quote log_pass "apt packages installed" + diff --git a/install.d/12-pacman.sh b/install.d/12-pacman.sh index a4148d9..6c97fe3 100755 --- a/install.d/12-pacman.sh +++ b/install.d/12-pacman.sh @@ -30,6 +30,6 @@ if ! command -v yay &>/dev/null; then rm -rf /tmp/yay fi -pacman --version -yay --version +pacman --version | log_quote +yay --version | log_quote log_pass "pacman packages installed" diff --git a/install.d/21-git.sh b/install.d/21-git.sh index cbf9f04..23d13f8 100755 --- a/install.d/21-git.sh +++ b/install.d/21-git.sh @@ -6,7 +6,7 @@ # # Skip in Codespaces (pre-installed in universal image) -[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; git --version; return 0; } +[[ "$DOTS_ENV" == "codespaces" ]] && { git --version | log_quote; return 0; } if ! command -v git &> /dev/null; then case "$DOTS_PKG" in @@ -26,5 +26,5 @@ if ! command -v git &> /dev/null; then esac fi -git --version +git --version | log_quote log_pass "git configured" diff --git a/install.d/22-zsh.sh b/install.d/22-zsh.sh index ab81a3d..40884d2 100755 --- a/install.d/22-zsh.sh +++ b/install.d/22-zsh.sh @@ -24,7 +24,7 @@ if ! command -v zsh &> /dev/null; then esac fi -zsh --version +zsh --version | log_quote # plugin directory (XDG compliant) PLUGIN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins" @@ -50,4 +50,3 @@ if [[ "$SHELL" != *zsh ]]; then sudo usermod -s "$(command -v zsh)" "$(whoami)" fi -log_pass "zsh configured" diff --git a/install.d/23-stow.sh b/install.d/23-stow.sh index 8e00c67..414513e 100755 --- a/install.d/23-stow.sh +++ b/install.d/23-stow.sh @@ -23,7 +23,7 @@ if ! command -v stow &> /dev/null; then esac fi -stow --version +stow --version | log_quote root_dir=${DOTFILES:-$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")} @@ -43,4 +43,3 @@ stow --dir="$root_dir" --target="$HOME" home # Bust PATH cache to force regeneration with new profile rm -f "${XDG_CACHE_HOME:-$HOME/.cache}/dots/path" -log_pass "stow linked" diff --git a/install.d/24-tmux.sh b/install.d/24-tmux.sh index 746026a..097432c 100644 --- a/install.d/24-tmux.sh +++ b/install.d/24-tmux.sh @@ -23,5 +23,5 @@ if ! command -v tmux &> /dev/null; then esac fi -tmux -V -log_pass "tmux installed" +tmux -V | log_quote + diff --git a/install.d/30-mise.sh b/install.d/30-mise.sh index 713061b..a365819 100755 --- a/install.d/30-mise.sh +++ b/install.d/30-mise.sh @@ -15,6 +15,7 @@ if ! command -v mise &>/dev/null; then ;; apt) # https://mise.jdx.dev/getting-started.html#apt-debian-ubuntu + sudo install -dm 755 /etc/apt/keyrings wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | \ sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | \ @@ -35,7 +36,7 @@ if ! command -v mise &>/dev/null; then esac fi -mise --version +echo "mise $(mise --version)" | log_quote # Skip runtimes in Codespaces (use pre-installed versions) if [[ "$DOTS_ENV" != "codespaces" ]]; then @@ -73,7 +74,6 @@ if [[ "$DOTS_ENV" != "codespaces" ]]; then fi log_info "Installing apps..." -mise install "${MISE_APPS[@]}" for tool in "${MISE_APPS[@]}"; do mise use -g "$tool" done @@ -89,18 +89,20 @@ fi # Verify installations log_info "Verifying installations..." -if [[ "$DOTS_ENV" != "codespaces" ]]; then - mise exec -- python --version - mise exec -- poetry --version - echo "node $(mise exec -- node --version)" - echo "npm $(mise exec -- npm --version)" - mise exec -- gh --version - mise exec -- terraform --version | head -1 - echo "firebase: $(mise exec -- firebase --version)" - echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | head -1)" -fi -fzf --version -zoxide --version -rg --version | head -1 -delta --version | head -1 +{ + if [[ "$DOTS_ENV" != "codespaces" ]]; then + mise exec -- python --version + mise exec -- poetry --version + echo "node $(mise exec -- node --version)" + echo "npm $(mise exec -- npm --version)" + mise exec -- gh --version + mise exec -- terraform --version | head -1 + echo "firebase: $(mise exec -- firebase --version)" + echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | head -1)" + fi + echo "fzf $(fzf --version)" + zoxide --version + rg --version | head -1 + delta --version | head -1 +} | log_quote log_pass "mise tools installed" diff --git a/install.d/41-docker.sh b/install.d/41-docker.sh index d143551..91bff5c 100755 --- a/install.d/41-docker.sh +++ b/install.d/41-docker.sh @@ -56,5 +56,5 @@ if ! groups "$USER" | grep -q "\b$docker_group\b"; then sudo usermod -aG docker "$USER" fi -docker --version +docker --version | log_quote log_pass "Docker configured" diff --git a/install.d/42-azure.sh b/install.d/42-azure.sh index 8be7d92..1391d39 100755 --- a/install.d/42-azure.sh +++ b/install.d/42-azure.sh @@ -26,5 +26,5 @@ if ! command -v az &>/dev/null; then esac fi -az --version +az --version | log_quote log_pass "Azure CLI installed" diff --git a/install.d/50-redis.sh b/install.d/50-redis.sh index 98d9a8c..50026fb 100755 --- a/install.d/50-redis.sh +++ b/install.d/50-redis.sh @@ -31,5 +31,5 @@ if ! command -v redis-cli &>/dev/null; then esac fi -redis-cli --version +redis-cli --version | log_quote log_pass "Redis installed" diff --git a/script/install b/script/install index 5b81d30..74b75a2 100755 --- a/script/install +++ b/script/install @@ -32,9 +32,10 @@ log_skip() { echo -e "${GREY}[SKIP]${NC} $*"; } log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; } log_error() { echo -e "${RED}[FAIL]${NC} $*"; } log_debug() { echo -e "${CYAN}$*${NC}"; } +log_quote() { sed "s/^/ ${GREY}│ /" | sed "s/$/${NC}/"; } # Export log functions -export -f log_info log_pass log_skip log_warn log_error log_debug +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 "\t${GREY}==============${NC}\n\n"