Skip to content

Find a theme by the name omarchy theme list shows - #18795

Closed
ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/theme-set-by-name
Closed

ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/theme-set-by-name

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

A theme made by hand in a folder with capitals or spaces shows in omarchy theme list, but setting it by that name fails with Theme 'walk-handmade-theme' does not exist: bin/omarchy-theme-set lowercases the name and turns its spaces into dashes before looking for the folder.

Screenshots

Before After
before after

Reproduce

  1. Open a terminal with Super+Return.
  2. cp -r /usr/share/omarchy/themes/gruvbox ~/.config/omarchy/themes/'Walk Handmade Theme'
  3. omarchy theme list: it lists Walk Handmade Theme.
  4. omarchy theme set 'Walk Handmade Theme': it prints Theme 'walk-handmade-theme' does not exist and the theme stays as it was.

More cases

A hand-made Gruvbox folder beside the bundled gruvbox: omarchy theme set Gruvbox applies the bundled one

Before After
before after

Picking a hand-made theme in the theme picker and pressing Enter leaves the theme unchanged

Before After
before after

omarchy theme remove 'Walk Kebab Theme' does not find the folder walk-kebab-theme

Before After
before after

Also affected

  • bin/omarchy-theme-dir: takes only a folder's own name, so omarchy theme dir 'Walk Kebab Theme' prints a bundled path that does not exist; fixed here, and it is now the one lookup set, remove and the preview use.
  • bin/omarchy-dev-theme-preview: kept its own copy of set's conversion, so omarchy dev theme-preview 'Walk Handmade Theme' says Theme not found; fixed here.

Related

omarchy-theme-list shows each folder title-cased with its dashes as spaces,
but omarchy-theme-set lowercased the name and turned its spaces into dashes
before looking. A theme made by hand in a folder with capitals or spaces
could not be applied, from the CLI or the theme picker, and a folder named
Gruvbox applied the stock gruvbox instead. omarchy-theme-remove and
omarchy-theme-dir did the opposite and took only the folder's own name, so
the name the list shows for a dashed folder was not found, remove's own
"Tokyo Night" example among them.

Make omarchy-theme-dir the one lookup: a folder of exactly that name wins,
otherwise the folder shown under it, compared in the C locale so a Turkish
one does not lowercase I to a dotless i. Set, remove and the theme preview
go through it, and theme.name keeps the folder's real name.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous wrong-theme deletion issue is fixed.

Summary

Theme commands now share a lookup that accepts folder names and the names shown by omarchy theme list.

  • Theme setting finds the folder behind a listed name.
  • Theme removal finds the folder behind a listed name.
  • Palette preview finds themes by their listed names.

Reviews (3) · Last reviewed commit: "Keep a trailing dash when matching the s..." · Reviewed by Greptile

Comment thread bin/omarchy-theme-dir Resolved
With user folders FOO and foo, omarchy theme list shows FOO and Foo, but
omarchy-theme-dir lowercased Foo before comparing and took FOO, the first
folder that matched. Setting Foo applied FOO, and removing Foo deleted it.

Compare the name the list shows for each folder exactly first, and fall back
to the case-folded comparison only when no folder is shown under that name.
The removal test now runs the checkout's omarchy-theme-dir rather than an
installed one.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread bin/omarchy-theme-dir Resolved
omarchy theme list shows a folder named tokyo-night- as "Tokyo Night ", with
the trailing dash as a space, but omarchy-theme-dir split the folder name with
read, which drops it. "Tokyo Night" then found tokyo-night- before the stock
tokyo-night, so setting it applied the wrong theme and removing it deleted
that folder. Build the shown name word by word, as the list does.

Co-authored-by: Cursor <cursoragent@cursor.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Closing in favour of #18557, which fixes the same thing with less: it tries the exact folder name first, then the existing conversion. This one rewrites the shared omarchy-theme-dir into a 40-line resolver and breaks theme preview for a name wrapped in markup tags.

Reviewed by Claude Opus 5.5 with Codex Medium as a second opinion; its independence is not guaranteed.

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.

2 participants