mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Migrate existing user backgrounds to the new proper location
This commit is contained in:
@@ -2,6 +2,46 @@ echo "Migrate to new theme setup"
|
|||||||
|
|
||||||
omarchy-pkg-add yq
|
omarchy-pkg-add yq
|
||||||
|
|
||||||
|
# Move user-added backgrounds from Omarchy theme folders to user config
|
||||||
|
OMARCHY_DIR="$HOME/.local/share/omarchy"
|
||||||
|
USER_BACKGROUNDS_DIR="$HOME/.config/omarchy/backgrounds"
|
||||||
|
|
||||||
|
if [[ -d "$OMARCHY_DIR/themes" ]]; then
|
||||||
|
cd "$OMARCHY_DIR"
|
||||||
|
|
||||||
|
# Get list of git-tracked background files (relative to omarchy dir)
|
||||||
|
mapfile -t TRACKED_BACKGROUNDS < <(git ls-files --cached 'themes/*/backgrounds/*' 2>/dev/null)
|
||||||
|
|
||||||
|
# Find all background files and check if they're untracked (user-added)
|
||||||
|
for theme_dir in themes/*/; do
|
||||||
|
theme_name=$(basename "$theme_dir")
|
||||||
|
backgrounds_dir="themes/$theme_name/backgrounds"
|
||||||
|
|
||||||
|
[[ -d "$backgrounds_dir" ]] || continue
|
||||||
|
|
||||||
|
for bg_file in "$backgrounds_dir"/*; do
|
||||||
|
[[ -f "$bg_file" ]] || continue
|
||||||
|
|
||||||
|
# Check if this file is tracked by git
|
||||||
|
is_tracked=false
|
||||||
|
for tracked in "${TRACKED_BACKGROUNDS[@]}"; do
|
||||||
|
if [[ "$tracked" == "$bg_file" ]]; then
|
||||||
|
is_tracked=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$is_tracked" == "false" ]]; then
|
||||||
|
# This is a user-added background, move it to user config
|
||||||
|
user_theme_bg_dir="$USER_BACKGROUNDS_DIR/$theme_name"
|
||||||
|
mkdir -p "$user_theme_bg_dir"
|
||||||
|
mv "$bg_file" "$user_theme_bg_dir/"
|
||||||
|
echo "Moved user background: $bg_file -> $user_theme_bg_dir/"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
THEMES_DIR="$HOME/.config/omarchy/themes"
|
THEMES_DIR="$HOME/.config/omarchy/themes"
|
||||||
CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme"
|
CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user