Skip to content

Only offer Update > Extra Themes when there is one - #7775

Merged
dhh merged 2 commits into
quattrofrom
menu-extra-themes-guard
Aug 22, 2026
Merged

dhh merged 2 commits into
quattrofrom
menu-extra-themes-guard

Conversation

@omarchybot

@omarchybot omarchybot commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Update > Extra Themes runs omarchy-theme-update, which pulls the themes under ~/.config/omarchy/themes that came from a git clone. On a machine that has never installed a theme by hand — which is most of them — the row opens a terminal that prints nothing and closes again.

Which themes those are is now one command. omarchy-theme-extras lists them and exits nonzero when there are none, the menu row asks it as its when:, and omarchy-theme-update pulls what it lists. So the row appears exactly when there is something to pull, and stays hidden over a theme copied by hand, a symlinked working copy, or a worktree's .git file — the shapes the updater has always skipped and the row used to offer anyway.

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 <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 22, 2026 13:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Conditionally exposes Update > Extra Themes only when an updateable Git-cloned theme exists.

Changes:

  • Adds a visibility guard matching theme updater predicates.
  • Tests copied, cloned, symlinked, empty, and worktree layouts.
  • Adds a menu configuration assertion.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
default/omarchy/omarchy-menu.jsonc Adds the Extra Themes visibility guard.
test/shell.d/menu-guards-test.sh Verifies guard/updater agreement across theme layouts.
test/shell.d/menu-test.sh Confirms the menu entry includes a theme guard.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread default/omarchy/omarchy-menu.jsonc Outdated
"update.channel": {"icon":"󰔫","label":"Channel"},
"update.config": {"icon":"","label":"Config","title":"Reset to default"},
"update.themes": {"icon":"󰸌","label":"Extra Themes","action":"omarchy-launch-floating-terminal-with-presentation omarchy-theme-update"},
"update.themes": {"icon":"󰸌","label":"Extra Themes","when":"( for theme in $HOME/.config/omarchy/themes/*; do [[ ! -L $theme && -d $theme/.git ]] && exit 0; done; exit 1 )","action":"omarchy-launch-floating-terminal-with-presentation omarchy-theme-update"},
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 <[email protected]>
@dhh
dhh merged commit 13a969e into quattro Aug 22, 2026
3 checks passed
@dhh
dhh deleted the menu-extra-themes-guard branch August 22, 2026 14:24
dhh pushed a commit that referenced this pull request Aug 23, 2026
* 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 <[email protected]>

* 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 <[email protected]>

---------

Co-authored-by: Codex XHigh <[email protected]>
(cherry picked from commit 13a969e)
@dhh dhh mentioned this pull request Aug 23, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* 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 <[email protected]>

* 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 <[email protected]>

---------

Co-authored-by: Codex XHigh <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants