mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Consistent const naming
This commit is contained in:
@@ -5,8 +5,8 @@ if [[ -z $1 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
|
CURRENT_THEME_PATH="$HOME/.config/omarchy/current/theme"
|
||||||
NEXT_THEME_DIR="$HOME/.config/omarchy/current/next-theme"
|
NEXT_THEME_PATH="$HOME/.config/omarchy/current/next-theme"
|
||||||
|
|
||||||
THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
||||||
THEME_PATH="$HOME/.config/omarchy/themes/$THEME_NAME"
|
THEME_PATH="$HOME/.config/omarchy/themes/$THEME_NAME"
|
||||||
@@ -17,18 +17,18 @@ if [[ ! -d "$THEME_PATH" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup clean next theme directory (for atomic theme config swapping)
|
# Setup clean next theme directory (for atomic theme config swapping)
|
||||||
rm -rf "$NEXT_THEME_DIR"
|
rm -rf "$NEXT_THEME_PATH"
|
||||||
mkdir -p "$NEXT_THEME_DIR"
|
mkdir -p "$NEXT_THEME_PATH"
|
||||||
|
|
||||||
# Copy static configs
|
# Copy static configs
|
||||||
cp -r "$THEME_PATH/"* "$NEXT_THEME_DIR/" 2>/dev/null
|
cp -r "$THEME_PATH/"* "$NEXT_THEME_PATH/" 2>/dev/null
|
||||||
|
|
||||||
# Generate dynamic configs
|
# Generate dynamic configs
|
||||||
omarchy-theme-set-templates
|
omarchy-theme-set-templates
|
||||||
|
|
||||||
# Swap next theme in as current
|
# Swap next theme in as current
|
||||||
rm -rf "$CURRENT_THEME_DIR"
|
rm -rf "$CURRENT_THEME_PATH"
|
||||||
mv "$NEXT_THEME_DIR" "$CURRENT_THEME_DIR"
|
mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"
|
||||||
|
|
||||||
# Change background with theme
|
# Change background with theme
|
||||||
omarchy-theme-bg-next
|
omarchy-theme-bg-next
|
||||||
|
|||||||
Reference in New Issue
Block a user