#!/bin/bash PROFILES_DIR="$HOME/profiles" ACTIVE=$(basename "$(readlink "$HOME/.active_profile" 2>/dev/null)") for profile_dir in "$PROFILES_DIR"/*/; do [[ ! -d "$profile_dir/.git" ]] && continue profile=$(basename "$profile_dir") echo "==> $profile" cd "$profile_dir" || continue git fetch origin --quiet 2>/dev/null || { echo " fetch failed (no remote?)"; continue; } LOCAL=$(git rev-parse HEAD 2>/dev/null) REMOTE=$(git rev-parse "@{u}" 2>/dev/null) if [[ "$LOCAL" == "$REMOTE" ]]; then echo " up to date" continue fi git pull --ff-only || { echo " pull failed (conflicts? run: cd $profile_dir && git status)"; continue; } echo " updated" if [[ "$profile" == "$ACTIVE" ]]; then echo " active profile changed — reinstalling..." "$profile_dir/install.sh" hyprctl reload pkill waybar; sleep 0.3; waybar &disown echo " reloaded" fi done echo "Done."