-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme-install
More file actions
executable file
·37 lines (29 loc) · 877 Bytes
/
theme-install
File metadata and controls
executable file
·37 lines (29 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
if [ -z "$1" ]; then
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/themes/themeLists"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//')
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Ask whether to keep or disable .git before cloning
KEEP_GIT=$(gum choose --header="Do you want to keep git?" "Delete" "Keep")
# 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
# Remove .git if user chose Delete
if [ "$KEEP_GIT" = "Delete" ]; then
rm -rf "$THEME_PATH/.git"
fi
# Apply the new theme with theme-set
theme-set $THEME_NAME