Many thanks to beaterblank for making omarchy's theme syncing more accessible. This is a fork of their repo adding support for firefox (PR incoming). Zen-browser support forthcoming. You can find beaterblank's original README below.
All you have to do is run install.sh. Themes should sync any time you change omarchy's theme. Firefox must be restarted for the change to take effect.
If it turns out you don't like it:
- If you did not previously have a
user.js, you can navigate to.mozilla/firefox/<your_profile_folder>/user.jsand delete the file. This should remove settings overriding firefox's defaultprefs.js - Otherwise, manually rollback
user.jsby removing/updating the following settings the script adds/changes in this file:toolkit.legacyUserProfileCustomizations.stylesheets-> enablesuserChrome.cssstylingextensions.activeThemeID-> attempts to set current firefox theme back to defaultlayout.css.prefers-color-scheme.content-override-> where supported, websites will set themselves to dark/light mode depending on your system
Make sure to switch firefox to its default theme WITH syncing of light/dark mode based on OS settings enabled. You can do this before or after installation.
- The script will detect the current theme and attempt to override/swap back to default for you via
user.js/extensions.json.- This method is currently imperfect/untested. If it doesn't work, manually switch to another theme, and back to the default firefox theme in
about:addons > Themes.
- This method is currently imperfect/untested. If it doesn't work, manually switch to another theme, and back to the default firefox theme in
- 🌠 Each Firefox profile updated MUST be fully shut-down and restarted for themes to apply. It does not currently support hot-reloading of
userChrome.cssstyling without the Browser Toolbox mode devtools interface (not recommended).
install.sh
- Changed
chmod +x omarchy-theme-synctochmod 755 omarchy-theme-syncto align with other executable bin permissions - Permissions are applied after
omarchy-theme-syncis copied to$OMARCHY_BIN_DIR
omarchy-theme-sync
- firefox
- Added
config/firefoxtemplate folder with:userChrome.css-> Styles the browser interfaceuserContent.css-> Styles default home, new tab, and blank pages
- Syncing the theme across all firefox profiles required some extra logic:
- Added firefox-specific conditional in
replace_vars()to route the firefox subdirectory throughsync_firefox()instead of the normal copy logic - Added
sync_firefox()function to handle syncing theme files across all Firefox profiles parsed fromprofiles.ini - Added
ensure_user_pref()helper to idempotently manage preferences in each profile'suser.js
- Added firefox-specific conditional in
- Added theme detection via
extensions.jsonusingjq, resetting non-default themes back todefault-theme@mozilla.org - Enforced three
user.jsprefs per profile:toolkit.legacyUserProfileCustomizations.stylesheets,extensions.activeThemeID, andlayout.css.prefers-color-scheme.content-override
- Added
Because zen is based on firefox, support for it can be added using this same method. BUT, it requires a userChrome.css tailored for it (and perhaps a userContent.css too). Sync logic specific to zen also needs to be added (e.g. sync_zenbrowser() in omarchy-theme-sync with multi-profile imports).
I worked on this a bit after adding firefox support, but it's unfinished. I'll include a separate branch with what I've done so far.
Automatically updates your configuration files when your Omarchy theme changes.
This script watches your current Omarchy theme for changes and dynamically replaces color placeholders in your configuration files with the actual values from the theme.
- Watches
~/.config/omarchy/current/theme/for updates. - Replaces
${var_name}placeholders in your app configuration files with the corresponding values fromcolors.toml. - Copies the processed configuration files to the destination specified in each app’s
dirfile.
~/.config/omarchy/current/theme/ # Active theme folder
~/.config/omarchy-theme-sync/
└─ <app_name>/
├─ <config_files> # Files with ${var_name} placeholders
└─ dir # File containing the actual destination path
colors.tomlcontains the theme variables (e.g.,foreground = "#a9b1d6").- Each app folder in
~/.config/omarchy-theme-sync/must have adirfile specifying the destination path. - Placeholders like
${foreground}in the configuration files will be replaced with the actual values fromcolors.toml.
~/.config/omarchy-theme-sync/zen-cal/dir
$HOME/.config/zen-cal
~/.config/omarchy-theme-sync/zen-cal/zen-cal.conf
# Zen-Cal color configuration
today = ${selection_background}
today_text = ${selection_foreground}
headings = ${accent}
text = ${foreground}
weekends = ${color2}
- Run the installer
chmod +x ./install.sh
./install.shchmod +x ./uninstall.sh
./uninstall.sh- Detects the active color scheme (
catppuccin-lattefor light orcatppuccin-mochafor dark) ifcolors.tomlis missing. - Iterates over all subdirectories in the sync folder (
~/.config/omarchy-theme-sync/). - Uses a temporary directory for processing to avoid overwriting files during replacement.
- Recursively replaces all
${var_name}placeholders with values fromcolors.toml. - Moves the processed files to the existing destination directory specified in the
dirfile.
- Only directories with a
dirfile are processed. - If the destination path does not exist, the folder is skipped.
- Changes in the theme folder are automatically applied to your configurations in real-time.
