Skip to content

Dynamic Color Match Obsidian theme to current Omarchy theme - #791

Merged
dhh merged 3 commits into
omacom:devfrom
darcy:feat/obsidian-theme
Oct 17, 2025
Merged

dhh merged 3 commits into
omacom:devfrom
darcy:feat/obsidian-theme

Conversation

@darcy

@darcy darcy commented Aug 14, 2025 •

Copy link
Copy Markdown
Contributor

Overview

Creates a dynamic theme.css color-matched based on the values from the current selected theme. Applies theme changes immediately to Obsidian. Dynamic theme.css generation works surprisingly well with some basic logic applied (see screenshots and vid).

New Scripts

omarchy-theme-set-obsidian
  • Bootstrap and update Omarchy theme for Obsidian
    • Ensures registry at ~/.local/state/omarchy/obsidian-vaults
      • If missing/empty, bootstraps by scanning ~/Documents//.obsidian and ~/Dropbox//.obsidian
    • For each valid vault:
      • Ensures .obsidian/themes/Omarchy/{manifest.json, theme.css}
      • Updates theme.css (uses current theme’s obsidian.css if present; otherwise generates)
        • If not present, reads multiple theme files to infer the values for an effective Obsidian theme with logic:
          • Find all colors in theme directory, sort them by count/usage and dedupe - this is our work color set
          • Find background color & foreground color from alacritty - remove from color set
          • Find some other magic colors like border color from btop
          • Pick the closest color to background color to make secondary code-block background color.
          • Then use the top colors in the theme with sane defaults.
  • If Omarchy theme is selected in Obsidian, then the theme is immediately updated with changes.
omarchy-theme-set-obsidian --reset
  • Removes themes from registered vaults
  • Removes registry allowing for automatic vault detection on next run

Screenshots (these are all dynamically generated)

ristretto everforest mars catppucin tokyonight osakajade

@darcy darcy changed the title feat: Obsidian theme to use current Omarchy theme Dynamic Obsidian theme to use current Omarchy theme Aug 14, 2025
@darcy darcy changed the title Dynamic Obsidian theme to use current Omarchy theme Dynamic Color Match Obsidian theme to current Omarchy theme Aug 15, 2025
@darcy

darcy commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

Not sure this makes a ton of sense. Obsidian is installed as part of Omarchy (unlike Zed, VSCode, etc), so it doesn't seem out of step to include in Omarchy the ability to tie it to the overall themeing structure. But with all the other related PRs, it could easily be separated (and less to maintain here) if there is a path to "hook" into themes, eg #809

@dhh

dhh commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

I do love this idea. I want it for my setup. But need to review the implementation in detail, so will need to wait until next release.

@dhh
dhh changed the base branch from master to dev October 7, 2025 16:07
@dhh

dhh commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

I'm very much digging this, but I'm finding the vault installation stuff a bit cumbersome. What I'd love to see is that we simply add an Omarchy theme for every single vault we find/see. That theme is updated via omarchy-theme-set, and if that theme is set in Obsidian, then you get the live switching. What do you think?

@dhh

dhh commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Maybe we could even just make an Omarchy theme for Obsidian that works like any other theme? And that just live references these dynamic values?

@darcy

darcy commented Oct 9, 2025 •

Copy link
Copy Markdown
Contributor Author

@dhh both directions make sense to me. I'll look into it soon and see how the Omarchy theme for Obsidian could work.

@darcy
darcy force-pushed the feat/obsidian-theme branch from 895e2e9 to 675626e Compare October 16, 2025 17:10
@darcy
darcy force-pushed the feat/obsidian-theme branch from 5a4ab81 to 1a449fb Compare October 16, 2025 17:29
* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
@darcy
darcy force-pushed the feat/obsidian-theme branch from 1a449fb to 456439b Compare October 16, 2025 17:31
@darcy

darcy commented Oct 16, 2025 •

Copy link
Copy Markdown
Contributor Author

@dhh This is updated with the following changes:

  • Removed install/remove scripts and flow
  • First omarchy-theme-set-obsidian run will look for vaults in Documents and Dropbox folders and add them to /.local/state/omarchy/obsidian-vaults
    • Point of this is such that we assume a couple locations to look for vaults but allow people to add vaults to the file for custom locations.
    • Subsequent omarchy-theme-set invocations aren't impacted by find/search on large file systems, which was a concern of mine.
    • Note there is no documentation about this registry at the moment for people to know they can manually put custom locations of their vaults.
  • Each omarchy-theme-set invocation will install the themes on all found/registered vaults if missing and update the live theme
  • Added an option of omarchy-theme-set-obsidian --reset to wipe out themes in registered vaults and remove the registry file. This would be the option to re-run to the automatic vault registration.
  • Added migration to trigger install immediately in Obsidian, note that you still need to pick Omarchy theme.

I looked into an Omarchy community theme for Obsidian, that looked to be too messy an approach for a few reasons - starting with it needs to be in a separate repo and would likely require it to be a plugin rather than a theme for the wiring up to work smoothest.

@dhh

dhh commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Absolutely gorgeous! I wish there was a way we could default Obsidian to this dynamic theme, but that's probably too clever.

@dhh
dhh merged commit 4174ff7 into omacom:dev Oct 17, 2025
dhcrzf pushed a commit to dhcrzf/omarchy that referenced this pull request Oct 21, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
manuel1618 pushed a commit to manuel1618/omarchy that referenced this pull request Oct 24, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
zachasme pushed a commit to zachasme/omarchy that referenced this pull request Oct 27, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
guirossibrum pushed a commit to guirossibrum/omarchy that referenced this pull request Oct 30, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
malik-na referenced this pull request in omacom/omarchy-mac Nov 1, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
malik-na referenced this pull request in omacom/omarchy-mac Nov 16, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
gocs pushed a commit to gocs/omarchy that referenced this pull request Dec 7, 2025
* feat: obsidian theme to tie into Omarchy theme

* better color matching for search result matches

* feat: simplify install flow

* Removed install/remove scripts and flow
* First `omarchy-theme-set-obsidian` run will look for vaults in
Documents and Dropbox folders and add them to
`/.local/state/omarchy/obsidian-vaults`
  * Point of this is such that we assume a couple locations to look for
vaults but allow people to add vaults to the file for custom locations.
Subsequent theme-set invocations aren't impacted by find/search on large
systems
* Each `omarchy-theme-set` invocation will install the themes on all
found/registered vaults if missing and update the live theme
* Added an option of `omarchy-theme-set-obsidian --reset` to wipe out
themes in registered vaults and remove the registry file. This would be
the option to re-run to the automatic vault registration.
* Added migration to trigger install immediately in Obisdian, note that
you still need to pick Omarchy theme.
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