From 6a206d235b0b523c68c4914f18a05cdb7a776aff Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 22 Jul 2026 03:42:03 -0400 Subject: Upd copy.sh to preserve existing user files Also removed manual restore for kitty/ghossty since they are UserConfigs now copy.sh will seed the new kitty/ghostty/hyprview layout selector if not there during first upgrade Signed-off-by: Don Williams Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit. On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_copy.sh --- copy.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index a80416ed..3f1b88e0 100755 --- a/copy.sh +++ b/copy.sh @@ -503,6 +503,8 @@ if [ ! -d "${XDG_CONFIG_HOME:-$HOME/.config}" ]; then echo "${ERROR} - ${XDG_CONFIG_HOME:-$HOME/.config} directory does not exist. Creating it now." mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}" && echo "Directory created successfully." || echo "Failed to create directory." fi +seed_upgrade_userconfigs "$LOG" +capture_upgrade_runtime_selection_state printf "${INFO} - copying dotfiles ${SKY_BLUE}first${RESET} part\n" copy_phase1 "$LOG" "$RUN_MODE" @@ -693,8 +695,6 @@ printf "\\n%.0s" {1..1} restore_user_scripts "$LOG" "$EXPRESS_MODE" printf "\n%.0s" {1..1} -restore_terminal_configs "$LOG" "$EXPRESS_MODE" -printf "\\n%.0s" {1..1} restore_hypr_files "$LOG" "$EXPRESS_MODE" printf "\n%.0s" {1..1} @@ -769,17 +769,21 @@ fi # - If the symlink points somewhere else (or is broken), reset it to the new default. WAYBAR_CONFIG_LINK="${XDG_CONFIG_HOME:-$HOME/.config}/waybar/config" WAYBAR_CONFIG_TARGET="$config_file" -if [ -e "$WAYBAR_CONFIG_TARGET" ]; then - if [ -L "$WAYBAR_CONFIG_LINK" ]; then - current_target=$(readlink "$WAYBAR_CONFIG_LINK" || true) - if [ "$current_target" != "$WAYBAR_CONFIG_TARGET" ] || [ ! -e "$WAYBAR_CONFIG_LINK" ]; then +if [ "$RUN_MODE" = "install" ]; then + if [ -e "$WAYBAR_CONFIG_TARGET" ]; then + if [ -L "$WAYBAR_CONFIG_LINK" ]; then + current_target=$(readlink "$WAYBAR_CONFIG_LINK" || true) + if [ "$current_target" != "$WAYBAR_CONFIG_TARGET" ] || [ ! -e "$WAYBAR_CONFIG_LINK" ]; then + ln -sf "$WAYBAR_CONFIG_TARGET" "$WAYBAR_CONFIG_LINK" 2>&1 | tee -a "$LOG" + fi + else ln -sf "$WAYBAR_CONFIG_TARGET" "$WAYBAR_CONFIG_LINK" 2>&1 | tee -a "$LOG" fi else - ln -sf "$WAYBAR_CONFIG_TARGET" "$WAYBAR_CONFIG_LINK" 2>&1 | tee -a "$LOG" + echo "${WARN} Waybar default config target not found at $WAYBAR_CONFIG_TARGET; leaving $WAYBAR_CONFIG_LINK as-is." 2>&1 | tee -a "$LOG" fi else - echo "${WARN} Waybar default config target not found at $WAYBAR_CONFIG_TARGET; leaving $WAYBAR_CONFIG_LINK as-is." 2>&1 | tee -a "$LOG" + restore_upgrade_runtime_selection_state "$LOG" fi # Remove inappropriate waybar configs @@ -858,17 +862,19 @@ fi # - If the symlink points somewhere else (or is broken), reset it to the new default. WAYBAR_STYLE_LINK="${XDG_CONFIG_HOME:-$HOME/.config}/waybar/style.css" WAYBAR_STYLE_TARGET="$waybar_style" -if [ -e "$WAYBAR_STYLE_TARGET" ]; then - if [ -L "$WAYBAR_STYLE_LINK" ]; then - current_target=$(readlink "$WAYBAR_STYLE_LINK" || true) - if [ "$current_target" != "$WAYBAR_STYLE_TARGET" ] || [ ! -e "$WAYBAR_STYLE_LINK" ]; then +if [ "$RUN_MODE" = "install" ]; then + if [ -e "$WAYBAR_STYLE_TARGET" ]; then + if [ -L "$WAYBAR_STYLE_LINK" ]; then + current_target=$(readlink "$WAYBAR_STYLE_LINK" || true) + if [ "$current_target" != "$WAYBAR_STYLE_TARGET" ] || [ ! -e "$WAYBAR_STYLE_LINK" ]; then + ln -sf "$WAYBAR_STYLE_TARGET" "$WAYBAR_STYLE_LINK" 2>&1 | tee -a "$LOG" + fi + else ln -sf "$WAYBAR_STYLE_TARGET" "$WAYBAR_STYLE_LINK" 2>&1 | tee -a "$LOG" fi else - ln -sf "$WAYBAR_STYLE_TARGET" "$WAYBAR_STYLE_LINK" 2>&1 | tee -a "$LOG" + echo "${WARN} Waybar default style target not found at $WAYBAR_STYLE_TARGET; leaving $WAYBAR_STYLE_LINK as-is." 2>&1 | tee -a "$LOG" fi -else - echo "${WARN} Waybar default style target not found at $WAYBAR_STYLE_TARGET; leaving $WAYBAR_STYLE_LINK as-is." 2>&1 | tee -a "$LOG" fi printf "\n%.0s" {1..1} -- cgit v1.2.3