From 6370a673ed685fee04924d0066a53b96654fdbf5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 May 2026 19:36:50 +0200 Subject: [PATCH] Allow ssh git urls not just web for theme installs Closes #3916 Co-authored-by: @Vargrul --- bin/omarchy-theme-install | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-theme-install b/bin/omarchy-theme-install index 5cd29bde..3b6f5254 100755 --- a/bin/omarchy-theme-install +++ b/bin/omarchy-theme-install @@ -3,10 +3,11 @@ # omarchy:summary=Install a theme from a git repository # omarchy:args=[git-repo-url] # omarchy:examples=omarchy theme install https://github.com/example/omarchy-example-theme.git +# omarchy:examples=omarchy theme install git@github.com:example/omarchy-example-theme.git if [[ -z $1 ]]; then 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="") + REPO_URL=$(gum input --placeholder="Git repo URL (https or git@host:org/repo.git)" --header="") else REPO_URL="$1" fi @@ -16,7 +17,11 @@ if [[ -z $REPO_URL ]]; then fi THEMES_DIR="$HOME/.config/omarchy/themes" -THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//' | tr '[:upper:]' '[:lower:]') + +# Strip user@host: prefix from scp-style SSH URLs so basename sees just the path +REPO_PATH="$REPO_URL" +[[ $REPO_PATH != *"://"* && $REPO_PATH == *:*/* ]] && REPO_PATH="${REPO_PATH#*:}" +THEME_NAME=$(basename "$REPO_PATH" .git | sed -E 's/^omarchy-//; s/-theme$//' | tr '[:upper:]' '[:lower:]') THEME_PATH="$THEMES_DIR/$THEME_NAME" # Remove existing theme if present