From c87b5e32d000d9462d9f5b4057bc21051720ca09 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 30 Jan 2026 00:20:36 -0500 Subject: Added install for waybar-weather bindary (gzip'd in repo) New function `install_waybar_weather_binary` copied to /usr/bin Arch has AUR package, fallback is copy binary On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_apps.sh --- scripts/lib_apps.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'scripts') diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index 562e5c5b..594967db 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -114,3 +114,73 @@ choose_default_editor() { fi fi } + +# Install waybar-weather: prefer Arch AUR, otherwise copy prebuilt asset to /usr/bin +install_waybar_weather_binary() { + local log="$1" + local APP_NAME="waybar-weather" + local INSTALL_PATH="/usr/bin/${APP_NAME}" + local ASSET="${SCRIPT_DIR:-.}/assets/${APP_NAME}.gz" + + # Helper: log wrappers may not be defined here; reuse INFO/WARN/ERROR if available + _log() { echo "[${APP_NAME}] $*" 2>&1 | tee -a "$log"; } + _warn() { echo "[${APP_NAME}] WARN: $*" 1>&2 | tee -a "$log"; } + _err() { echo "[${APP_NAME}] ERROR: $*" 1>&2 | tee -a "$log"; } + + # Distro detection + if grep -qi '^ID=nixos' /etc/os-release 2>/dev/null; then + _warn "NixOS detected. Skipping ${APP_NAME} install in this script." + return 0 + fi + + if grep -qi '^ID=arch' /etc/os-release 2>/dev/null; then + if command -v pacman >/dev/null 2>&1 && pacman -Qi weather-waybar >/dev/null 2>&1; then + _log "weather-waybar already installed via pacman." + return 0 + fi + if command -v yay >/dev/null 2>&1; then + _log "Attempting to install AUR package 'weather-waybar' via yay" + if yay -S --noconfirm weather-waybar; then + _log "AUR install succeeded." + return 0 + else + _warn "AUR install failed; will fall back to bundled asset." + fi + else + _warn "yay not found on Arch; falling back to bundled asset." + fi + fi + + # Asset path validation + if [[ ! -f "$ASSET" ]]; then + _err "Asset not found: $ASSET" + return 1 + fi + if ! command -v gzip >/dev/null 2>&1; then + _err "Missing required command: gzip" + return 1 + fi + + # Sudo handling for /usr/bin + local SUDO="" + if [[ $EUID -ne 0 ]]; then + if command -v sudo >/dev/null 2>&1; then + SUDO="sudo" + else + _err "sudo not available; cannot write to ${INSTALL_PATH} as non-root" + return 1 + fi + fi + + _log "Installing prebuilt binary to ${INSTALL_PATH} from ${ASSET}" + if ${SUDO} sh -c "gzip -dc '$ASSET' > '${INSTALL_PATH}'" && ${SUDO} chmod 0755 "${INSTALL_PATH}"; then + if "${INSTALL_PATH}" -h >/dev/null 2>&1; then + _log "Installed ${APP_NAME} successfully." + else + _warn "${APP_NAME} installed, but a basic self-check did not run." + fi + else + _err "Failed to install ${APP_NAME} to ${INSTALL_PATH}" + return 1 + fi +} -- cgit v1.2.3 From 94aba84549fb404dbfd3b19bbd7b5287b40c583e Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 30 Jan 2026 01:15:16 -0500 Subject: Added waybar-weather install for NixOS Helper script now handles all OS's On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_apps.sh --- copy.sh | 2 +- scripts/lib_apps.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/copy.sh b/copy.sh index c0d54dfb..c1752f9d 100755 --- a/copy.sh +++ b/copy.sh @@ -321,7 +321,7 @@ enable_blueman "$LOG" enable_ags "$LOG" enable_quickshell "$LOG" ensure_keybinds_init "$LOG" -install_waybar_weather_binary "$LOG" +install_waybar_weather "$LOG" printf "\n%.0s" {1..1} choose_default_editor "$LOG" diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index 594967db..dd918b02 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -115,7 +115,7 @@ choose_default_editor() { fi } -# Install waybar-weather: prefer Arch AUR, otherwise copy prebuilt asset to /usr/bin +# Install waybar-weather on non-NixOS: prefer Arch AUR, otherwise copy prebuilt asset to /usr/bin install_waybar_weather_binary() { local log="$1" local APP_NAME="waybar-weather" @@ -127,9 +127,9 @@ install_waybar_weather_binary() { _warn() { echo "[${APP_NAME}] WARN: $*" 1>&2 | tee -a "$log"; } _err() { echo "[${APP_NAME}] ERROR: $*" 1>&2 | tee -a "$log"; } - # Distro detection + # NixOS handled by a separate helper if grep -qi '^ID=nixos' /etc/os-release 2>/dev/null; then - _warn "NixOS detected. Skipping ${APP_NAME} install in this script." + _warn "NixOS detected. Use install_waybar_weather_nixos instead." return 0 fi @@ -184,3 +184,72 @@ install_waybar_weather_binary() { return 1 fi } + +# Install waybar-weather on NixOS using Go from the system (no version checks) +install_waybar_weather_nixos() { + local log="$1" + local APP_NAME="waybar-weather" + local DEST="$HOME/.local/bin/${APP_NAME}" + + _log() { echo "[${APP_NAME}] $*" 2>&1 | tee -a "$log"; } + _warn() { echo "[${APP_NAME}] WARN: $*" 1>&2 | tee -a "$log"; } + _err() { echo "[${APP_NAME}] ERROR: $*" 1>&2 | tee -a "$log"; } + + if ! grep -qi '^ID=nixos' /etc/os-release 2>/dev/null; then + _warn "Not NixOS; skipping NixOS-specific build." + return 0 + fi + + if ! command -v go >/dev/null 2>&1; then + _err "Go toolchain not found in PATH. Ensure NixOS-Hyprland provides go, then re-run." + return 1 + fi + if ! command -v git >/dev/null 2>&1; then + _err "git not found; install git and retry." + return 1 + fi + + local tmp + tmp=$(mktemp -d) + trap 'rm -rf "${tmp}"' RETURN + + _log "Cloning waybar-weather source" + if ! git clone --depth 1 https://github.com/wneessen/waybar-weather.git "${tmp}/src" >/dev/null 2>&1; then + _err "git clone failed" + return 1 + fi + + cd "${tmp}/src" || { _err "cd failed"; return 1; } + _log "Fetching modules" + go mod download >/dev/null 2>&1 || _warn "go mod download returned non-zero; continuing" + _log "Building ${APP_NAME}" + if ! CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o "${APP_NAME}" ./cmd/${APP_NAME}; then + _err "go build failed" + return 1 + fi + + mkdir -p "$HOME/.local/bin" + install -m 0755 "${APP_NAME}" "${DEST}" || { _err "install to ${DEST} failed"; return 1; } + + if printf '%s' "$PATH" | grep -q "$HOME/.local/bin"; then + : + else + _warn "~/.local/bin is not in PATH; add it so Waybar can find ${APP_NAME}." + fi + + if "${DEST}" -h >/dev/null 2>&1; then + _log "Installed ${APP_NAME} to ${DEST}" + else + _warn "${APP_NAME} installed, but a basic self-check did not run." + fi +} + +# Wrapper: choose NixOS builder or non-NixOS installer automatically +install_waybar_weather() { + local log="$1" + if grep -qi '^ID=nixos' /etc/os-release 2>/dev/null; then + install_waybar_weather_nixos "$log" + else + install_waybar_weather_binary "$log" + fi +} -- cgit v1.2.3 From 949fd81f3f6fe89b297261b9d3c839423d172ba5 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 30 Jan 2026 08:07:08 -0500 Subject: NixOS relative pathing wasn't working `cwd` issues ``` [OK] You have chosen < 1440p resolution. sed: can't read config/kitty/kitty.conf: No such file or directory [NOTE] By default, KooL's Dots are configured in 24H clock format. [ACTION] Do you want to change to 12H (AM/PM) clock format? (y/n): y sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory sed: can't read config/waybar/Modules: No such file or directory [WARN] hyprlock template not found; skipping 12H lock format edits [NOTE] Express mode: skipping SDDM 12H edits to avoid sudo prompts. [OK] 12H format set on waybar clocks succesfully. [INFO] - copying dotfiles first part cp: cannot stat 'config/fastfetch': No such file or directory [OK] - Copy completed for fastfetch [INFO] Found kitty config found in ~/.config/ [ACTION] Do you want to replace kitty config? (y/n): y [NOTE] - Backed up kitty to /home/dwilliams/.config/kitty-backup-back-up_0130_0800. cp: cannot stat 'config/kitty': No such file or directory [OK] - Replaced kitty with new configuration. [INFO] Found rofi config found in ~/.config/ [ACTION] Do you want to replace rofi config? (y/n): y [NOTE] - Backed up rofi to /home/dwilliams/.config/rofi-backup-back-up_0130_0800. cp: cannot stat 'config/rofi': No such file or directory [OK] - Replaced rofi with new configuration. ``` On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_apps.sh modified: scripts/lib_copy.sh modified: scripts/lib_prompts.sh --- copy.sh | 5 +++++ scripts/lib_apps.sh | 31 +++++++++++++++++++------------ scripts/lib_copy.sh | 15 +++++++++------ scripts/lib_prompts.sh | 34 ++++++++++++++++++---------------- 4 files changed, 51 insertions(+), 34 deletions(-) (limited to 'scripts') diff --git a/copy.sh b/copy.sh index e9b09e9e..fc3f38b8 100755 --- a/copy.sh +++ b/copy.sh @@ -53,6 +53,8 @@ SKY_BLUE="$(tput setaf 6)" RESET="$(tput sgr0)" MIN_EXPRESS_VERSION="2.3.18" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DOTFILES_DIR="$SCRIPT_DIR" +export DOTFILES_DIR MENU_HELPER="$SCRIPT_DIR/scripts/copy_menu.sh" BACKUP_HELPER="$SCRIPT_DIR/scripts/lib_backup.sh" DETECT_HELPER="$SCRIPT_DIR/scripts/lib_detect.sh" @@ -107,6 +109,9 @@ else exit 1 fi +# Ensure we operate from the dotfiles root so relative paths resolve. +cd "$SCRIPT_DIR" || { echo "${ERROR} Failed to cd to $SCRIPT_DIR"; exit 1; } + version_gte() { [ "$1" = "$(echo -e "$1\n$2" | sort -V | tail -n1)" ] } diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index dd918b02..900ca801 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -3,8 +3,9 @@ enable_asusctl() { local log="$1" + local base="${DOTFILES_DIR:-.}" if command -v asusctl >/dev/null 2>&1; then - local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + local OVERLAY_SA="$base/config/hypr/configs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = rog-control-center' "$OVERLAY_SA" || echo 'exec-once = rog-control-center' >>"$OVERLAY_SA" @@ -13,8 +14,9 @@ enable_asusctl() { enable_blueman() { local log="$1" + local base="${DOTFILES_DIR:-.}" if command -v blueman-applet >/dev/null 2>&1; then - local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + local OVERLAY_SA="$base/config/hypr/configs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = blueman-applet' "$OVERLAY_SA" || echo 'exec-once = blueman-applet' >>"$OVERLAY_SA" @@ -23,33 +25,36 @@ enable_blueman() { enable_ags() { local log="$1" + local base="${DOTFILES_DIR:-.}" if command -v ags >/dev/null 2>&1; then echo "${INFO:-[INFO]} AGS detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$log" - local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + local OVERLAY_SA="$base/config/hypr/configs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = ags' "$OVERLAY_SA" || echo 'exec-once = ags' >>"$OVERLAY_SA" - sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh - sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh + sed -i '/#ags -q && ags &/s/^#//' "$base/config/hypr/scripts/RefreshNoWaybar.sh" + sed -i '/#ags -q && ags &/s/^#//' "$base/config/hypr/scripts/Refresh.sh" fi } enable_quickshell() { local log="$1" + local base="${DOTFILES_DIR:-.}" if command -v qs >/dev/null 2>&1; then echo "${INFO:-[INFO]} Quickshell detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$log" - local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + local OVERLAY_SA="$base/config/hypr/configs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = qs' "$OVERLAY_SA" || echo 'exec-once = qs' >>"$OVERLAY_SA" - sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh - sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh + sed -i '/#pkill qs && qs &/s/^#//' "$base/config/hypr/scripts/RefreshNoWaybar.sh" + sed -i '/#pkill qs && qs &/s/^#//' "$base/config/hypr/scripts/Refresh.sh" fi } ensure_keybinds_init() { local log="$1" - local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + local base="${DOTFILES_DIR:-.}" + local OVERLAY_SA="$base/config/hypr/configs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" if ! grep -qx 'exec-once = \$scriptsDir/KeybindsLayoutInit.sh' "$OVERLAY_SA"; then echo 'exec-once = $scriptsDir/KeybindsLayoutInit.sh' >>"$OVERLAY_SA" @@ -59,9 +64,10 @@ ensure_keybinds_init() { install_terminal_configs() { local log="$1" + local base="${DOTFILES_DIR:-.}" # Ghostty - local GHOSTTY_SRC="config/ghostty/ghostty.config" + local GHOSTTY_SRC="$base/config/ghostty/ghostty.config" local GHOSTTY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ghostty" local GHOSTTY_DEST="$GHOSTTY_DIR/config" if [ -f "$GHOSTTY_SRC" ]; then @@ -75,7 +81,7 @@ install_terminal_configs() { fi # WezTerm - local WEZTERM_SRC="config/wezterm/wezterm.lua" + local WEZTERM_SRC="$base/config/wezterm/wezterm.lua" local WEZTERM_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/wezterm" local WEZTERM_DEST="$WEZTERM_DIR/wezterm.lua" if [ -f "$WEZTERM_SRC" ]; then @@ -88,10 +94,11 @@ install_terminal_configs() { choose_default_editor() { local log="$1" + local base="${DOTFILES_DIR:-.}" local editor_set=0 update_editor() { local editor=$1 - sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" config/hypr/UserConfigs/01-UserDefaults.conf + sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" "$base/config/hypr/UserConfigs/01-UserDefaults.conf" echo "${OK:-[OK]} Default editor set to ${MAGENTA:-}$editor${RESET:-}." 2>&1 | tee -a "$log" } if command -v nvim &>/dev/null; then diff --git a/scripts/lib_copy.sh b/scripts/lib_copy.sh index 331c6906..dd83007e 100644 --- a/scripts/lib_copy.sh +++ b/scripts/lib_copy.sh @@ -3,6 +3,7 @@ copy_phase1() { local log="$1" + local base="${DOTFILES_DIR:-.}" local dirs="fastfetch kitty rofi swaync" for DIR2 in $dirs; do local DIRPATH="$HOME/.config/$DIR2" @@ -16,7 +17,7 @@ copy_phase1() { BACKUP_DIR=$(get_backup_dirname) mv "$DIRPATH" "$DIRPATH-backup-$BACKUP_DIR" 2>&1 | tee -a "$log" echo -e "${NOTE:-[NOTE]} - Backed up $DIR2 to $DIRPATH-backup-$BACKUP_DIR." 2>&1 | tee -a "$log" - cp -r "config/$DIR2" "$HOME/.config/$DIR2" 2>&1 | tee -a "$log" + cp -r "$base/config/$DIR2" "$HOME/.config/$DIR2" 2>&1 | tee -a "$log" echo -e "${OK:-[OK]} - Replaced $DIR2 with new configuration." 2>&1 | tee -a "$log" if [ "$DIR2" = "rofi" ]; then if [ -d "$DIRPATH-backup-$BACKUP_DIR/themes" ]; then @@ -39,7 +40,7 @@ copy_phase1() { esac done else - cp -r "config/$DIR2" "$HOME/.config/$DIR2" 2>&1 | tee -a "$log" + cp -r "$base/config/$DIR2" "$HOME/.config/$DIR2" 2>&1 | tee -a "$log" echo -e "${OK:-[OK]} - Copy completed for ${YELLOW:-}$DIR2${RESET:-}" 2>&1 | tee -a "$log" fi done @@ -47,6 +48,7 @@ copy_phase1() { copy_waybar() { local log="$1" + local base="${DOTFILES_DIR:-.}" local DIRW="waybar" local DIRPATHw="$HOME/.config/$DIRW" if [ -d "$DIRPATHw" ]; then @@ -58,7 +60,7 @@ copy_waybar() { BACKUP_DIR=$(get_backup_dirname) cp -r "$DIRPATHw" "$DIRPATHw-backup-$BACKUP_DIR" 2>&1 | tee -a "$log" echo -e "${NOTE:-[NOTE]} - Backed up $DIRW to $DIRPATHw-backup-$BACKUP_DIR." 2>&1 | tee -a "$log" - rm -rf "$DIRPATHw" && cp -r "config/$DIRW" "$DIRPATHw" 2>&1 | tee -a "$log" + rm -rf "$DIRPATHw" && cp -r "$base/config/$DIRW" "$DIRPATHw" 2>&1 | tee -a "$log" for file in "config" "style.css"; do symlink="$DIRPATHw-backup-$BACKUP_DIR/$file" target_file="$DIRPATHw/$file" @@ -103,13 +105,14 @@ copy_waybar() { esac done else - cp -r "config/$DIRW" "$DIRPATHw" 2>&1 | tee -a "$log" + cp -r "$base/config/$DIRW" "$DIRPATHw" 2>&1 | tee -a "$log" echo -e "${OK:-[OK]} - Copy completed for ${YELLOW:-}$DIRW${RESET:-}" 2>&1 | tee -a "$log" fi } copy_phase2() { local log="$1" + local base="${DOTFILES_DIR:-.}" local DIR="btop cava hypr Kvantum qt5ct qt6ct swappy wallust wlogout" for DIR_NAME in $DIR; do local DIRPATH="$HOME/.config/$DIR_NAME" @@ -118,8 +121,8 @@ copy_phase2() { BACKUP_DIR=$(get_backup_dirname) mv "$DIRPATH" "$DIRPATH-backup-$BACKUP_DIR" 2>&1 | tee -a "$log" fi - if [ -d "config/$DIR_NAME" ]; then - cp -r "config/$DIR_NAME/" "$HOME/.config/$DIR_NAME" 2>&1 | tee -a "$log" + if [ -d "$base/config/$DIR_NAME" ]; then + cp -r "$base/config/$DIR_NAME/" "$HOME/.config/$DIR_NAME" 2>&1 | tee -a "$log" echo "${OK:-[OK]} - Copy of config for ${YELLOW:-}$DIR_NAME${RESET:-} completed!" 2>&1 | tee -a "$log" else echo "${ERROR:-[ERROR]} - Directory config/$DIR_NAME does not exist to copy." 2>&1 | tee -a "$log" diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index bf6fafd7..6475e54d 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -21,6 +21,7 @@ prompt_detect_layout() { prompt_keyboard_layout() { local layout="$1" local log="$2" + local base="${DOTFILES_DIR:-.}" if [ "$layout" = "(unset)" ]; then while true; do @@ -65,8 +66,8 @@ ${MAGENTA} NOTE:${RESET} read keyboard_layout case $keyboard_layout in [yY]) - awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' config/hypr/configs/SystemSettings.conf >temp.conf - mv temp.conf config/hypr/configs/SystemSettings.conf + awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' "$base/config/hypr/configs/SystemSettings.conf" >temp.conf + mv temp.conf "$base/config/hypr/configs/SystemSettings.conf" echo "${NOTE} kb_layout ${MAGENTA}$layout${RESET} configured in settings." 2>&1 | tee -a "$log" break ;; @@ -95,8 +96,8 @@ ${MAGENTA} NOTE:${RESET} printf "\n%.0s" {1..1} echo -n "${CAT} - Please enter the correct keyboard layout: " read new_layout - awk -v new_layout="$new_layout" '/kb_layout/ {$0 = " kb_layout = " new_layout} 1' config/hypr/configs/SystemSettings.conf >temp.conf - mv temp.conf config/hypr/configs/SystemSettings.conf + awk -v new_layout="$new_layout" '/kb_layout/ {$0 = " kb_layout = " new_layout} 1' "$base/config/hypr/configs/SystemSettings.conf" >temp.conf + mv temp.conf "$base/config/hypr/configs/SystemSettings.conf" echo "${OK} kb_layout $new_layout configured in settings." 2>&1 | tee -a "$log" break ;; @@ -131,6 +132,7 @@ prompt_resolution_choice() { # Prompt for 12H clock; sets waybar/hyprlock/SDDM changes when accepted. prompt_clock_12h() { local log="$1" + local base="${DOTFILES_DIR:-.}" while true; do echo -e "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured in 24H clock format." echo -n "$CAT Do you want to change to 12H (AM/PM) clock format? (y/n): " @@ -138,20 +140,20 @@ prompt_clock_12h() { answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') if [[ "$answer" == "y" ]]; then # waybar clocks - sed -i 's#^\(\s*\)//\("format": " {:%I:%M %p}",\) #\1\2 #g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)\("format": " {:%H:%M:%S}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)\("format": " {:%H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)//\("format": "{:%I:%M %p - %d/%b}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)\("format": "{:%H:%M - %d/%b}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)//\("format": "{:%B | %a %d, %Y | %I:%M %p}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)\("format": "{:%B | %a %d, %Y | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)//\("format": "{:%A, %I:%M %P}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" - sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": " {:%I:%M %p}",\) #\1\2 #g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": " {:%H:%M:%S}",\) #\1//\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": " {:%H:%M}",\) #\1//\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%I:%M %p - %d/%b}",\) #\1\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%H:%M - %d/%b}",\) #\1//\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%B | %a %d, %Y | %I:%M %p}",\) #\1\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%B | %a %d, %Y | %H:%M}",\) #\1//\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%A, %I:%M %P}",\) #\1\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' "$base/config/waybar/Modules" 2>&1 | tee -a "$log" # hyprlock - local HYPRLOCK_FILE="config/hypr/hyprlock.conf" - if [ ! -f "$HYPRLOCK_FILE" ] && [ -f "config/hypr/hyprlock-1080p.conf" ]; then - HYPRLOCK_FILE="config/hypr/hyprlock-1080p.conf" + local HYPRLOCK_FILE="$base/config/hypr/hyprlock.conf" + if [ ! -f "$HYPRLOCK_FILE" ] && [ -f "$base/config/hypr/hyprlock-1080p.conf" ]; then + HYPRLOCK_FILE="$base/config/hypr/hyprlock-1080p.conf" fi if [ -f "$HYPRLOCK_FILE" ]; then sed -i 's/^\s*text = cmd\[update:1000\] echo \"\$(date +\"%H\")\"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$log" -- cgit v1.2.3 From 7ccb8ceb875b9af27c517a85a69e5cdeebdf0fbe Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 30 Jan 2026 08:23:58 -0500 Subject: Added --tty flag to force basic menu Fixed the remaining hardcoded entries in copy.sh and helper scripts On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_apps.sh --- copy.sh | 38 +++++++++++++++++++++----------------- scripts/lib_apps.sh | 12 +++++++----- 2 files changed, 28 insertions(+), 22 deletions(-) (limited to 'scripts') diff --git a/copy.sh b/copy.sh index fc3f38b8..7fe72336 100755 --- a/copy.sh +++ b/copy.sh @@ -142,6 +142,7 @@ Usage: copy.sh [--upgrade] [--express-upgrade] [--help] Options: --upgrade Run the script in upgrade mode (can still prompt for express). --express-upgrade Upgrade with express behavior (no restore prompts, trims backups). + --tty Force basic TTY prompts (no whiptail menu). -h, --help Show this help message and exit. EOF } @@ -161,6 +162,9 @@ while [[ $# -gt 0 ]]; do EXPRESS_MODE=1 RUN_MODE="express" ;; + --tty) + COPY_TUI_BACKEND="basic" + ;; -h | --help) print_usage exit 0 @@ -315,7 +319,7 @@ detect_nixos_adjust "$LOG" # activating hyprcursor on env by checking if the directory ~/.icons/Bibata-Modern-Ice/hyprcursors exists if [ -d "$HOME/.icons/Bibata-Modern-Ice/hyprcursors" ]; then - HYPRCURSOR_ENV_FILE="config/hypr/configs/ENVariables.conf" + HYPRCURSOR_ENV_FILE="$DOTFILES_DIR/config/hypr/configs/ENVariables.conf" echo "${INFO} Bibata-Hyprcursor directory detected. Activating Hyprcursor...." 2>&1 | tee -a "$LOG" || true sed -i 's/^#env = HYPRCURSOR_THEME,Bibata-Modern-Ice/env = HYPRCURSOR_THEME,Bibata-Modern-Ice/' "$HYPRCURSOR_ENV_FILE" sed -i 's/^#env = HYPRCURSOR_SIZE,24/env = HYPRCURSOR_SIZE,24/' "$HYPRCURSOR_ENV_FILE" @@ -357,18 +361,18 @@ done echo "${OK} You have chosen $resolution resolution." 2>&1 | tee -a "$LOG" if [ "$resolution" == "< 1440p" ]; then # kitty font size - sed -i 's/font_size 16.0/font_size 14.0/' config/kitty/kitty.conf + sed -i 's/font_size 16.0/font_size 14.0/' "$DOTFILES_DIR/config/kitty/kitty.conf" # hyprlock matters - if [ -f config/hypr/hyprlock.conf ]; then - mv config/hypr/hyprlock.conf config/hypr/hyprlock-2k.conf + if [ -f "$DOTFILES_DIR/config/hypr/hyprlock.conf" ]; then + mv "$DOTFILES_DIR/config/hypr/hyprlock.conf" "$DOTFILES_DIR/config/hypr/hyprlock-2k.conf" fi - if [ -f config/hypr/hyprlock-1080p.conf ]; then - mv config/hypr/hyprlock-1080p.conf config/hypr/hyprlock.conf + if [ -f "$DOTFILES_DIR/config/hypr/hyprlock-1080p.conf" ]; then + mv "$DOTFILES_DIR/config/hypr/hyprlock-1080p.conf" "$DOTFILES_DIR/config/hypr/hyprlock.conf" fi # rofi fonts reduction - rofi_config_file="config/rofi/0-shared-fonts.rasi" + rofi_config_file="$DOTFILES_DIR/config/rofi/0-shared-fonts.rasi" if [ -f "$rofi_config_file" ]; then sed -i '/element-text {/,/}/s/[[:space:]]*font: "JetBrainsMono Nerd Font SemiBold 13"/font: "JetBrainsMono Nerd Font SemiBold 11"/' "$rofi_config_file" 2>&1 | tee -a "$LOG" sed -i '/configuration {/,/}/s/[[:space:]]*font: "JetBrainsMono Nerd Font SemiBold 15"/font: "JetBrainsMono Nerd Font SemiBold 13"/' "$rofi_config_file" 2>&1 | tee -a "$LOG" @@ -407,8 +411,8 @@ if command -v ags >/dev/null 2>&1; then if [ ! -d "$DIRPATH_AGS" ]; then echo "${INFO} - ags config not found, copying new config." - if [ -d "config/ags" ]; then - cp -r "config/ags/" "$DIRPATH_AGS" 2>&1 | tee -a "$LOG" + if [ -d "$DOTFILES_DIR/config/ags" ]; then + cp -r "$DOTFILES_DIR/config/ags/" "$DIRPATH_AGS" 2>&1 | tee -a "$LOG" fi else read -p "${CAT} Do you want to overwrite your existing ${YELLOW}ags${RESET} config? [y/N] " answer_ags @@ -418,7 +422,7 @@ if command -v ags >/dev/null 2>&1; then mv "$DIRPATH_AGS" "$DIRPATH_AGS-backup-$BACKUP_DIR" 2>&1 | tee -a "$LOG" echo -e "${NOTE} - Backed up ags config to $DIRPATH_AGS-backup-$BACKUP_DIR" - if cp -r "config/ags/" "$DIRPATH_AGS" 2>&1 | tee -a "$LOG"; then + if cp -r "$DOTFILES_DIR/config/ags/" "$DIRPATH_AGS" 2>&1 | tee -a "$LOG"; then echo "${OK} - ${YELLOW}ags configs${RESET} overwritten successfully." else echo "${ERROR} - Failed to copy ${YELLOW}ags${RESET} config." @@ -448,8 +452,8 @@ if command -v qs >/dev/null 2>&1; then if [ ! -d "$DIRPATH_QS" ]; then echo "${INFO} - quickshell config not found, copying new config." - if [ -d "config/quickshell" ]; then - cp -r "config/quickshell/" "$DIRPATH_QS" 2>&1 | tee -a "$LOG" + if [ -d "$DOTFILES_DIR/config/quickshell" ]; then + cp -r "$DOTFILES_DIR/config/quickshell/" "$DIRPATH_QS" 2>&1 | tee -a "$LOG" fi else # If default shell.qml exists, it blocks named config subdirectory detection @@ -466,7 +470,7 @@ if command -v qs >/dev/null 2>&1; then mv "$DIRPATH_QS" "$DIRPATH_QS-backup-$BACKUP_DIR" 2>&1 | tee -a "$LOG" echo -e "${NOTE} - Backed up quickshell to $DIRPATH_QS-backup-$BACKUP_DIR" - cp -r "config/quickshell/" "$DIRPATH_QS" 2>&1 | tee -a "$LOG" + cp -r "$DOTFILES_DIR/config/quickshell/" "$DIRPATH_QS" 2>&1 | tee -a "$LOG" if [ $? -eq 0 ]; then echo "${OK} - ${YELLOW}quickshell${RESET} overwritten successfully." # Remove default shell.qml from new copy to enable overview detection @@ -484,9 +488,9 @@ if command -v qs >/dev/null 2>&1; then # Ensure overview subdirectory exists and is up to date DIRPATH_OVERVIEW="$DIRPATH_QS/overview" - if [ ! -d "$DIRPATH_OVERVIEW" ] && [ -d "config/quickshell/overview" ]; then + if [ ! -d "$DIRPATH_OVERVIEW" ] && [ -d "$DOTFILES_DIR/config/quickshell/overview" ]; then echo "${INFO} - Copying quickshell overview config..." 2>&1 | tee -a "$LOG" - cp -r "config/quickshell/overview" "$DIRPATH_QS/" 2>&1 | tee -a "$LOG" + cp -r "$DOTFILES_DIR/config/quickshell/overview" "$DIRPATH_QS/" 2>&1 | tee -a "$LOG" echo "${OK} - Quickshell overview config copied successfully" 2>&1 | tee -a "$LOG" fi @@ -539,7 +543,7 @@ printf "\n%.0s" {1..1} # wallpaper stuff PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" mkdir -p "$PICTURES_DIR/wallpapers" -if cp -r wallpapers "$PICTURES_DIR/"; then +if cp -r "$SCRIPT_DIR/wallpapers" "$PICTURES_DIR/"; then echo "${OK} Some ${MAGENTA}wallpapers${RESET} copied successfully!" | tee -a "$LOG" else echo "${ERROR} Failed to copy some ${YELLOW}wallpapers${RESET}" | tee -a "$LOG" @@ -590,7 +594,7 @@ printf "\n%.0s" {1..1} sddm_simple_sddm_2="/usr/share/sddm/themes/simple_sddm_2" if [ -d "$sddm_simple_sddm_2" ]; then # Apply the current wallpaper as SDDM background without prompting - sudo -n cp -r "config/hypr/wallpaper_effects/.wallpaper_current" "/usr/share/sddm/themes/simple_sddm_2/Backgrounds/default" || true + sudo -n cp -r "$DOTFILES_DIR/config/hypr/wallpaper_effects/.wallpaper_current" "/usr/share/sddm/themes/simple_sddm_2/Backgrounds/default" || true echo "${NOTE} Current wallpaper applied as default SDDM background" 2>&1 | tee -a "$LOG" fi diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index 900ca801..f71ef05a 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -226,11 +226,13 @@ install_waybar_weather_nixos() { return 1 fi - cd "${tmp}/src" || { _err "cd failed"; return 1; } - _log "Fetching modules" - go mod download >/dev/null 2>&1 || _warn "go mod download returned non-zero; continuing" - _log "Building ${APP_NAME}" - if ! CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o "${APP_NAME}" ./cmd/${APP_NAME}; then + if ! ( + cd "${tmp}/src" || { _err "cd failed"; exit 1; } + _log "Fetching modules" + go mod download >/dev/null 2>&1 || _warn "go mod download returned non-zero; continuing" + _log "Building ${APP_NAME}" + CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o "${APP_NAME}" ./cmd/${APP_NAME} + ); then _err "go build failed" return 1 fi -- cgit v1.2.3 From b2a7909f4c2f2b47386e24519afc62fa49bfa0c8 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 30 Jan 2026 08:35:39 -0500 Subject: Fixed waybar-weather error overwriting installed version On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: scripts/lib_apps.sh --- scripts/lib_apps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index f71ef05a..f19fd75a 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -180,7 +180,7 @@ install_waybar_weather_binary() { fi _log "Installing prebuilt binary to ${INSTALL_PATH} from ${ASSET}" - if ${SUDO} sh -c "gzip -dc '$ASSET' > '${INSTALL_PATH}'" && ${SUDO} chmod 0755 "${INSTALL_PATH}"; then + if ${SUDO} sh -c "tmp=\$(mktemp '${INSTALL_PATH}.XXXXXX') && gzip -dc '$ASSET' > \"\$tmp\" && chmod 0755 \"\$tmp\" && mv -f \"\$tmp\" '${INSTALL_PATH}'"; then if "${INSTALL_PATH}" -h >/dev/null 2>&1; then _log "Installed ${APP_NAME} successfully." else -- cgit v1.2.3 From bb701a20280ab0049a8b31f502c2f6d2992ad940 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 4 Feb 2026 15:04:12 -0500 Subject: Fresh install option did not reset wallpaper On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: scripts/lib_copy.sh --- scripts/lib_copy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/lib_copy.sh b/scripts/lib_copy.sh index dd83007e..58fbe066 100644 --- a/scripts/lib_copy.sh +++ b/scripts/lib_copy.sh @@ -149,7 +149,15 @@ restore_hypr_assets() { echo -e "\n${NOTE:-[NOTE]} Restoring ${SKY_BLUE:-}Animations & Monitor Profiles${RESET:-} into ${YELLOW:-}$HYPR_DIR${RESET:-}..." - local DIR_B=("Monitor_Profiles" "animations" "wallpaper_effects") + # Fresh installs should apply repo defaults; do not restore a previous wallpaper. + # RUN_MODE is set by copy.sh (install|upgrade|express) and is visible here. + local DIR_B=("Monitor_Profiles" "animations") + if [ "${RUN_MODE:-}" != "install" ]; then + DIR_B+=("wallpaper_effects") + else + echo "${NOTE:-[NOTE]} Fresh install: skipping restore of wallpaper_effects so default wallpaper applies." 2>&1 | tee -a "$log" + fi + for DIR_RESTORE in "${DIR_B[@]}"; do local BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" if [ -d "$BACKUP_SUBDIR" ]; then -- cgit v1.2.3