Files
dotfiles/scripts/update-profiles.sh
tekki 350fb4fe59 initial dotfiles setup
Profile-based dotfiles with switchable color themes.
Structure: profiles/ with themes/ and config/ per profile.
2026-04-21 17:41:08 +02:00

35 lines
973 B
Bash
Executable File

#!/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."