* Only offer Update > Extra Themes when there is one omarchy-theme-update pulls the themes under ~/.config/omarchy/themes that came from a git clone, so on a machine that has never installed one by hand the row opens a terminal that prints nothing and closes. Guard it with the same predicates the command itself applies, since a row that shows over a symlinked theme or a worktree's `.git` file is the same dead end in a narrower shape, and pin the two to each other in the guard test. Co-Authored-By: Codex XHigh <noreply@openai.com> * Extract the Extra Themes guard into omarchy-theme-extras The row's `when:` and omarchy-theme-update each carried their own idea of which themes came from a git clone, and the two only matched because a test held them together. Name it once instead: omarchy-theme-extras lists those directories and exits nonzero when there are none, so the row asks exactly the command its action runs. Living in a script also puts the glob out of reach of whatever shopt a login shell left set for the guard batch. Co-Authored-By: Codex XHigh <noreply@openai.com> --------- Co-authored-by: Codex XHigh <noreply@openai.com>
18 lines
506 B
Bash
Executable File
18 lines
506 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=List the user-installed themes that came from a git clone
|
|
# omarchy:examples=omarchy theme extras
|
|
|
|
# Exits nonzero when there are none, so a caller can ask whether any exist
|
|
# without reading the list. A symlinked theme is someone's working copy and a
|
|
# `.git` file is a worktree pointing elsewhere; neither is ours to pull.
|
|
status=1
|
|
|
|
for theme in ~/.config/omarchy/themes/*; do
|
|
[[ ! -L $theme && -d $theme/.git ]] || continue
|
|
echo "$theme"
|
|
status=0
|
|
done
|
|
|
|
exit $status
|