diff --git a/install.sh b/install.sh index 712b86f..eb4aba8 100755 --- a/install.sh +++ b/install.sh @@ -133,19 +133,19 @@ print_header() { local hostname="${HOSTNAME:-$(hostname -s 2>/dev/null)}" local script_name="install.sh" local datetime=$(date '+%a %b %d %H:%M') - + # Colors local _M_RESET=$'\033[0m' local _M_BOLD=$'\033[1m' local _M_DIM=$'\033[2m' local _M_BLUE=$'\033[38;5;39m' local _M_GREY=$'\033[38;5;242m' - + # Build horizontal line local hline="" for ((i=0; i<_M_WIDTH; i++)); do hline+="═"; done local inner=$((_M_WIDTH - 2)) - + # Header content local h_left="✦ ${user}@${hostname}" local h_center="${script_name}" @@ -153,7 +153,7 @@ print_header() { local h_pad=$(((inner - ${#h_left} - ${#h_center} - ${#h_right}) / 2)) local h_spaces="" for ((i=0; i/dev/null && HAS_GUM=true - -wizard_confirm() { - local prompt="$1" - local default="${2:-yes}" - - if [[ "$HAS_GUM" == true ]]; then - if [[ "$default" == "yes" ]]; then - gum confirm --default=yes "$prompt" - else - gum confirm --default=no "$prompt" - fi - else - local yn_prompt="[Y/n]" - [[ "$default" == "no" ]] && yn_prompt="[y/N]" - read -p "$prompt $yn_prompt: " response - response=${response:-${default:0:1}} - [[ "$response" =~ ^[Yy] ]] - fi -} - -wizard_input() { - local prompt="$1" - local default="$2" - - if [[ "$HAS_GUM" == true ]]; then - gum input --placeholder "$default" --value "$default" --prompt "$prompt: " - else - read -p "$prompt [$default]: " response - echo "${response:-$default}" - fi -} - -wizard_choose() { - local prompt="$1" - shift - local options=("$@") - - if [[ "$HAS_GUM" == true ]]; then - printf '%s\n' "${options[@]}" | gum choose --header "$prompt" - else - echo "$prompt" - local i=1 - for opt in "${options[@]}"; do - echo " $i) $opt" - ((i++)) - done - read -p "Choice [1]: " choice - choice=${choice:-1} - echo "${options[$((choice-1))]}" - fi -} - -# ============================================================================ -# Wizard Steps -# ============================================================================ - -step_welcome() { - clear - df_print_header "setup-wizard" - - echo -e "${DF_BOLD}Welcome to Dotfiles Setup Wizard${DF_NC}" - echo -e "${DF_DIM}Version: $DOTFILES_VERSION | Display Width: $DF_WIDTH${DF_NC}" - echo "" - - wizard_confirm "Ready to begin?" || { - echo "Setup cancelled." - exit 0 - } -} - -step_user_info() { - echo "" - echo -e "${DF_BLUE}▶${DF_NC} Personal Information" - echo "" - - USER_FULLNAME=$(wizard_input "Full Name" "${USER_FULLNAME:-}") - USER_EMAIL=$(wizard_input "Email" "${USER_EMAIL:-}") - USER_GITHUB=$(wizard_input "GitHub Username" "${USER_GITHUB:-}") -} - -step_features() { - echo "" - echo -e "${DF_BLUE}▶${DF_NC} Feature Selection" - echo "" - - MOTD_STYLE=$(wizard_choose "MOTD Style:" "compact" "mini" "full" "none") - - wizard_confirm "Enable smart suggestions (typo correction)?" && ENABLE_SMART_SUGGESTIONS="true" || ENABLE_SMART_SUGGESTIONS="false" - wizard_confirm "Enable command palette (Ctrl+Space)?" && ENABLE_COMMAND_PALETTE="true" || ENABLE_COMMAND_PALETTE="false" -} - -step_summary() { - echo "" - echo -e "${DF_GREEN}✓${DF_NC} Configuration Summary" - echo "" - echo " Name: $USER_FULLNAME" - echo " Email: $USER_EMAIL" - echo " GitHub: $USER_GITHUB" - echo " MOTD Style: $MOTD_STYLE" - echo " Smart Suggestions: $ENABLE_SMART_SUGGESTIONS" - echo " Command Palette: $ENABLE_COMMAND_PALETTE" - echo "" - - if wizard_confirm "Save this configuration?"; then - save_config - df_print_success "Configuration saved!" - else - echo "Configuration not saved." - fi -} - -save_config() { - local config_file="$DOTFILES_HOME/dotfiles.conf" - - # Update values in config file - if [[ -f "$config_file" ]]; then - sed -i "s/^USER_FULLNAME=.*/USER_FULLNAME=\"$USER_FULLNAME\"/" "$config_file" - sed -i "s/^USER_EMAIL=.*/USER_EMAIL=\"$USER_EMAIL\"/" "$config_file" - sed -i "s/^USER_GITHUB=.*/USER_GITHUB=\"$USER_GITHUB\"/" "$config_file" - sed -i "s/^MOTD_STYLE=.*/MOTD_STYLE=\"$MOTD_STYLE\"/" "$config_file" - sed -i "s/^ENABLE_SMART_SUGGESTIONS=.*/ENABLE_SMART_SUGGESTIONS=\"$ENABLE_SMART_SUGGESTIONS\"/" "$config_file" - sed -i "s/^ENABLE_COMMAND_PALETTE=.*/ENABLE_COMMAND_PALETTE=\"$ENABLE_COMMAND_PALETTE\"/" "$config_file" - fi -} - -step_next() { - echo "" - df_print_success "Setup Complete!" - echo "" - echo -e "${DF_DIM}Next steps:${DF_NC}" - echo " 1. Reload your shell: source ~/.zshrc" - echo " 2. Run health check: dfd" - echo " 3. Explore commands: dotfiles-cli help" - echo "" -} - -# ============================================================================ -# Main -# ============================================================================ - -main() { - step_welcome - step_user_info - step_features - step_summary - step_next -} - -# Only run if executed directly (not sourced) -[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" diff --git a/zsh/.zshrc b/zsh/.zshrc index d77513d..18d6343 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -278,6 +278,13 @@ _deferred_load() { # Setup FZF _has_cmd fzf && _setup_fzf + # ----------------------------------------------------------------------- + # Load machine-specific configuration + # This must be loaded early so machine configs can override other settings + # ----------------------------------------------------------------------- + local machines_lib="$_dotfiles_dir/zsh/lib/machines.zsh" + [[ -f "$machines_lib" ]] && source "$machines_lib" + # ----------------------------------------------------------------------- # Load all function files from functions directory # Excludes command-palette.zsh (already loaded) and motd.zsh (loaded separately) diff --git a/zsh/lib/bootstrap.zsh.zwc b/zsh/lib/bootstrap.zsh.zwc deleted file mode 100644 index 9f33488..0000000 Binary files a/zsh/lib/bootstrap.zsh.zwc and /dev/null differ diff --git a/zsh/lib/colors.zsh.zwc b/zsh/lib/colors.zsh.zwc deleted file mode 100644 index b9689d4..0000000 Binary files a/zsh/lib/colors.zsh.zwc and /dev/null differ diff --git a/zsh/lib/config.zsh.zwc b/zsh/lib/config.zsh.zwc deleted file mode 100644 index 8566693..0000000 Binary files a/zsh/lib/config.zsh.zwc and /dev/null differ diff --git a/zsh/lib/machines.zsh.zwc b/zsh/lib/machines.zsh.zwc deleted file mode 100644 index 1bf4ac5..0000000 Binary files a/zsh/lib/machines.zsh.zwc and /dev/null differ diff --git a/zsh/lib/plugins.zsh.zwc b/zsh/lib/plugins.zsh.zwc deleted file mode 100644 index 5e59f1d..0000000 Binary files a/zsh/lib/plugins.zsh.zwc and /dev/null differ diff --git a/zsh/lib/utils.zsh.zwc b/zsh/lib/utils.zsh.zwc deleted file mode 100644 index 7054044..0000000 Binary files a/zsh/lib/utils.zsh.zwc and /dev/null differ