Skip to content

fix(theme): establish OMARCHY_PATH in entry points for non-interactive shells - #9103

Open
harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/theme-non-interactive-omarchy-path
Open

fix(theme): establish OMARCHY_PATH in entry points for non-interactive shells#9103
harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/theme-non-interactive-omarchy-path

Conversation

@harshithnadig

Copy link
Copy Markdown

Problem

In #9065, omarchy theme list and omarchy theme set fail in non-interactive environments (scripts, cron, SSH, CI, AI agents) because $OMARCHY_PATH is only exported by ~/.bashrc in interactive login sessions.

When $OMARCHY_PATH is unset:

  • omarchy theme list queries /themes/, outputs a find error to stderr, and silently exits 0 with an empty list.
  • omarchy theme set <name> queries /themes/<name> and falsely reports that the theme does not exist.

Solution

  1. In bin/omarchy (the root entry dispatcher), establish OMARCHY_PATH if unset before executing sub-commands.
  2. In bin/omarchy-theme-list and bin/omarchy-theme-set, check and fallback OMARCHY_PATH from /etc/omarchy.conf or /usr/share/omarchy.
  3. In bin/omarchy-theme-list, exit with code 1 if neither system nor user theme directories exist.

Fixes #9065

…e shells

'omarchy theme list' and 'omarchy theme set' depended on OMARCHY_PATH being
exported in the caller's environment. Because OMARCHY_PATH was only exported
in '~/.bashrc' via 'env-bootstrap', non-interactive shells (cron, SSH, scripts,
CI, systemd) evaluated OMARCHY_PATH as empty, causing 'theme list' to query
'/themes/' (failing silently with exit 0) and 'theme set' to report that
existing themes do not exist.

Establish OMARCHY_PATH in 'bin/omarchy', 'bin/omarchy-theme-list', and
'bin/omarchy-theme-set' if unset, falling back to '/etc/omarchy.conf' and
'/usr/share/omarchy'. Also exit non-zero if the themes directory cannot be found.

Fixes omacom#9065
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.

omarchy theme list fails silently (exit 0) in non-interactive shells; theme set reports a wrong reason — OMARCHY_PATH is only exported by ~/.bashrc

1 participant