arch-hyprland-setup/bin/omarchy-theme-install
2025-08-07 18:19:16 -04:00

35 lines
945 B
Bash
Executable File

#!/bin/bash
# omarchy-theme-install: Install a new theme from a git repo for Omarchy
# Usage: omarchy-theme-install <git-repo-url>
if [ -z "$1" ]; then
~/.local/share/omarchy/bin/omarchy-show-logo
echo -e "\e[32mSee https://manuals.omamix.org/2/the-omarchy-manual/90/extra-themes\n\e[0m"
REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="")
else
REPO_URL="$1"
fi
if [ -z "$REPO_URL" ]; then
exit 1
fi
THEMES_DIR="$HOME/.config/omarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//')
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# 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
~/.local/share/omarchy/bin/omarchy-theme-set $THEME_NAME