2025-07-15 14:39:07 +10:00
|
|
|
#!/bin/bash
|
|
|
|
|
2025-07-14 22:35:10 -07:00
|
|
|
# omarchy-theme-install: Install a new theme from a git repo for Omarchy
|
2025-07-15 14:39:07 +10:00
|
|
|
# Usage: omarchy-theme-install <git-repo-url>
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Usage: omarchy-theme-install <git-repo-url>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2025-07-14 22:35:10 -07:00
|
|
|
REPO_URL="$1"
|
|
|
|
THEMES_DIR="$HOME/.config/omarchy/themes"
|
2025-07-15 22:00:08 -07:00
|
|
|
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//')
|
2025-07-14 22:35:10 -07:00
|
|
|
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
2025-07-15 14:39:07 +10:00
|
|
|
|
|
|
|
# Remove existing theme if present
|
|
|
|
if [ -d "$THEME_PATH" ]; then
|
|
|
|
rm -rf "$THEME_PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clone the repo directly to ~/.config/omarchy/themes
|
|
|
|
if ! git clone "$REPO_URL" "$THEME_PATH"; then
|
|
|
|
echo "Error: Failed to clone theme repo."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Apply the new theme with omarchy-theme-set
|
2025-07-14 22:35:10 -07:00
|
|
|
omarchy-theme-set $THEME_NAME
|