Introducing a new way to review your PRs.

Read the announcement

omacom / omarchy

Beautiful, Modern & Opinionated Linux

View on GitHub

29 documents · Updated Nov 23, 2026

docs / theme-switching-and-application-sync

Theme switching and application sync

Theme switching turns one named theme into the active desktop appearance. It updates shared theme state, the shell, the background, supported applications, and the Herdr desktop app, then mirrors the selection to enabled remote Omarchy machines. The parent page, Themes and visual customization, gives the wider theme model; Theme catalog and assets explains the files that supply the inputs.

Theme command model

Omarchy exposes theme actions as commands and desktop menu actions. These actions use a stored theme name and shared current-theme state so later refreshes, background changes, and application hooks use the same selection.

Theme selection and state

omarchy theme list combines bundled themes with themes in the user's theme directory. omarchy theme set <name> accepts the displayed name, converts it to a safe theme name, and rejects a name that is not available. The selected name becomes current after Omarchy assembles the bundled theme with the matching user theme and generates its derived settings. The active background stays separate so each theme can remember its last choice.

The selector uses the same theme sources and adds image previews. It marks the current theme and warms its preview cache when theme data changes. omarchy theme current reads the stored selection for users and scripts that need the active theme.

References: bin/omarchy-theme-list• L1-9 bin/omarchy-theme-set• L380-399 bin/omarchy-theme-set• L413-434 bin/omarchy-theme-switcher• L56-64 bin/omarchy-theme-switcher• L110-130

Palette resolution

omarchy-theme-color is the shared palette resolver for theme consumers. It reads semantic and older ANSI color names, fills supported aliases and derived shades, and resolves the theme mode from explicit metadata or the background. Templates, terminal sequences, tmux, GNOME, and previews therefore use the same color values.

The resolver can print raw source values, all resolved values, or one value with a fallback. It rejects unsupported keys and values instead of passing unsafe replacement text into generated settings.

References: bin/omarchy-theme-color• L7-18 bin/omarchy-theme-color• L120-135 bin/omarchy-theme-color• L176-282 bin/omarchy-theme-color• L284-305

Theme application pipeline

Theme application has one shared stage before application-specific work. Omarchy combines the bundled theme with the matching user theme, creates derived settings, swaps the result into current state, and updates the shell and background. It then runs separate sync actions for visible desktop targets and for application settings.

The shared stage makes a theme change one state transition. A lock prevents two selections from replacing each other's staged data. Visible targets run first so the screen changes quickly. The remaining application actions run as a guarded batch. A generation check prevents a superseded batch from applying stale settings, while failed optional actions are reported without undoing the successful theme switch. Interactive callers can wait for the full batch; menu and other detached calls record the result for later review.

This diagram shows how a theme command reaches the shared state and its consumers.

flowchart LR
    A[Theme command] --> B[Theme selection and staging]
    B --> C[Current theme state]
    C --> D[Shell palette and background]
    C --> E[Generated application settings]
    E --> F[Visible desktop targets]
    E --> G[Other application targets]
    G --> H[Local applications]
    G --> I[Enabled remote machines]

References: bin/omarchy-theme-set• L401-434 bin/omarchy-theme-set• L491-536 bin/omarchy-theme-set• L538-569 bin/omarchy-theme-set• L571-648 bin/omarchy-theme-set-templates• L440-490

Theme lifecycle

The lifecycle separates choosing a theme from changing the theme catalog. Selection applies an existing theme. Installation adds a user theme and applies it. Refresh rebuilds the current theme from its sources. Removal deletes only a user-installed theme.

Theme preview

The desktop theme switcher previews a theme with its own preview image when one exists. If no dedicated preview exists, it can use a suitable background image. The preview cache lets the picker open without rebuilding every row each time.

For palette work, omarchy dev theme-preview reads a theme name, theme directory, or colors.toml file. It shows color samples, contrast data, and terminal examples. In a terminal, it can also apply the palette through the terminal display interface. This previews the palette without selecting the theme or running the full application sync path.

References: bin/omarchy-theme-switcher• L23-54 bin/omarchy-theme-switcher• L67-108 bin/omarchy-dev-theme-preview• L18-29 bin/omarchy-dev-theme-preview• L400-439

Theme installation and refresh

omarchy theme install <git-repo-url> checks the repository URL, derives a safe theme name, replaces any existing theme with that name, clones the repository into the user's theme directory, and applies it. During application, an installed repository contributes visual theme data only. Code-bearing files and unsafe links are kept outside the active theme, and ignored files are reported.

The install command accepts both web URLs and SSH-style repository addresses. It checks the derived name before it removes an existing directory or clones new content. The command then passes the name to the normal theme-setting path, so installation receives the same application sync as a selected theme.

omarchy theme refresh reapplies the stored current theme with the existing background. It waits for the full application retint path when callers need the generated settings immediately. This is useful after a theme source or template changes because it rebuilds derived settings without selecting another theme or moving to another background.

References: bin/omarchy-theme-install• L19-63 bin/omarchy-theme-set• L337-377 bin/omarchy-theme-set• L401-434 bin/omarchy-theme-refresh• L5-11

Theme removal and update

omarchy theme remove <name> deletes a user-installed theme directory. With no name, it offers only extra themes for selection. Bundled themes are not removal targets. Removing a theme does not select a replacement, so the current assembled theme stays active until another theme is set.

omarchy-theme-update updates user-installed Git themes from their remotes. The update changes the source. A later selection or refresh makes the changed source active.

References: bin/omarchy-theme-remove• L7-48 bin/omarchy-theme-update• L1-10 bin/omarchy-theme-set• L375-399

Background selection

The background commands manage the media shown by the current theme. omarchy theme bg set <path> validates an image or video, resolves its matching intro when enabled, and asks the running shell to sequence the change. If the shell cannot handle the request, it updates the current background link and applies the background directly. omarchy theme bg next cycles through the current theme's available media, including user-provided backgrounds, and wraps to the first item.

omarchy theme bg install opens the current theme's user background folder. This gives users a direct place to add media that the background selector can include.

The cycle command first asks the shell which background it is showing. This lets quick repeated selections move forward even before the durable current-background link changes.

Theme changes remember the last background for each theme. When a theme has no usable media, the palette still applies and the shell reports that no background is available.

References: bin/omarchy-theme-bg-set• L7-31 bin/omarchy-theme-bg-next• L6-49 bin/omarchy-theme-bg-install• L3-9 bin/omarchy-theme-set• L122-198 bin/omarchy-theme-set• L200-273

Background intro control

Background intros are optional visual transitions that can play a theme-specific video when a theme changes or when the session starts. The intro path prepares the clip only for a theme that is not current yet, then checks the current setting and resolved clip again before playback. This prevents an older asynchronous transition from replacing a newer selection.

omarchy theme bg intro enable|disable|toggle|status controls the user-level background-intro setting. Disabled intros skip playback while normal background and theme updates continue.

References: bin/omarchy-theme-bg-intro• L1-34 bin/omarchy-theme-bg-boot-intro• L40-79 bin/omarchy-theme-bg-boot-intro• L110-147 bin/omarchy-theme-set• L451-489 bin/omarchy-theme-set• L491-530

Application synchronization

Application synchronization uses the current assembled theme as the source for independent targets. Some targets receive generated files. Others receive a color, mode, or icon setting. Running processes may also refresh so the new appearance becomes visible at once.

Desktop and shell synchronization

The shell receives the new palette and shell settings during the main theme transition. The background selector chooses a theme background, remembers the user's last background for that theme, and can show a still-image transition or a background intro.

GNOME receives the theme's light or dark mode and Adwaita icon theme when a user D-Bus session exists. Qt applications receive the same Adwaita icon theme when their Qt Engine configuration exists. The visible sync group also refreshes terminals, tmux, compositor controls, status tools, and other desktop targets. The theme renderer can add or remove the optional glass treatment for supported terminal, btop, and GTK settings. A missing optional tool does not stop the other targets.

References: bin/omarchy-theme-set• L515-551 bin/omarchy-theme-set• L553-569 bin/omarchy-theme-set-glass• L54-122 bin/omarchy-theme-set-tmux• L71-160 bin/omarchy-theme-set-gnome• L3-29 bin/omarchy-theme-set-qt• L3-28 bin/omarchy-theme-set-fcitx5• L35-88

Application icon synchronization

Omarchy's application icons are recolored from the resolved theme palette so the dock and shell can follow a theme. Icon sets are selected separately from themes: a theme supplies the colors, while the built-in and user icon sets supply the icon drawings.

omarchy-theme-set-icons combines the selected user icon set with the built-in set of the same name, then renders template icons from the active theme. User-owned installed icons remain untouched. Icons that the selected set no longer draws are removed so packaged hicolor icons can show again. The shell watches an icon revision marker and redraws after a completed icon refresh.

References: bin/omarchy-theme-icon-palette• L7-33 bin/omarchy-theme-icon-palette• L155-219 bin/omarchy-theme-set-icons• L6-30 bin/omarchy-theme-set-icons• L39-95 bin/omarchy-theme-set-templates• L440-475 bin/omarchy-theme-set• L542-544

Editor and agent synchronization

Editors and agent tools consume theme-specific output built from the shared palette. VS Code, VSCodium, and Cursor use a supplied descriptor or a generated local color theme. Claude Code, Pi, and Hermes receive their own theme files.

The editor sync model avoids unwanted changes. A target is skipped when its application is absent or its sync toggle is off. A supplied editor descriptor can install and select a named extension theme. Without one, Omarchy publishes a local color-theme extension and selects it. Publishing a theme file and selecting it remain separate actions for targets that preserve an explicit user choice.

References: bin/omarchy-theme-set• L556-565 bin/omarchy-theme-set-vscode• L59-104 bin/omarchy-theme-set-vscode• L139-204 bin/omarchy-theme-set-claude• L35-74 bin/omarchy-theme-set-pi• L37-76 bin/omarchy-theme-set-hermes• L183-223

T3 Code synchronization

T3 Code receives a generated Omarchy theme when its local state directory already exists. The sync publishes a stable omarchy theme identity from the current theme's JSON and optional CSS, so T3 Code can retint connected clients when the file changes.

The generated CSS also follows the live Hyprland corner radius. Omarchy skips publication when generated color placeholders remain unresolved, and it writes the result as one complete file so T3 Code does not read a partial theme. T3 Code remains an optional target; systems without its state directory are not changed.

References: bin/omarchy-theme-set• L556-569 bin/omarchy-theme-set-t3code• L8-38 bin/omarchy-theme-set-t3code• L40-77

Herdr desktop app synchronization

The Herdr desktop app receives a generated Omarchy palette when the app has already created its configuration directory. Normal theme changes publish the palette without forcing the app to select it, so an existing app choice remains separate from theme publication.

Explicit activation uses omarchy-theme-set-herdr-app --activate. It requires Herdr 0.1.11 or newer for live custom-theme reload, validates the generated palette, and then asks Herdr to select the published omarchy theme. If the app is not installed or has not been opened, a normal sync skips it and activation reports the required next action.

References: bin/omarchy-theme-set• L560-569 bin/omarchy-theme-set-herdr-app• L18-41 bin/omarchy-theme-set-herdr-app• L44-87

Browser and vault synchronization

Supported Chromium-family browsers receive managed theme colors and a device color-scheme policy. The browser sync also refreshes supported running browsers so an open browser can accept the new policy without a full user restart.

Obsidian receives a generated theme stylesheet in each configured vault. The sync creates or updates the Omarchy theme in the vault. Obsidian must use that theme for its appearance to follow the system selection.

References: bin/omarchy-theme-set-browser• L1-23 bin/omarchy-theme-set-browser• L35-94 bin/omarchy-theme-set-obsidian• L1-28

Slack synchronization

Slack receives a small generated theme file when Slack theme sync is enabled. The sync validates the mode and required colors before replacing the file, so an invalid generated theme cannot overwrite the last valid Slack settings.

The command updates the shared Slack state that running Slack windows use. It does not act when the feature is disabled or when the generated Slack theme is absent. The main theme path runs this sync with the other application targets, so a failed Slack update is reported as an optional retint failure rather than undoing the desktop theme change.

References: bin/omarchy-theme-set-slack• L3-21 bin/omarchy-theme-set• L556-569 bin/omarchy-theme-set• L576-624

Remote machine synchronization

Theme changes can mirror to enabled Herdr machines when the herdr-theme-sync toggle is on. The local command sends the current theme name over SSH. The remote machine accepts it only when its own toggle is on and it has a live Omarchy session.

The remote path avoids loops by marking a theme that arrived from another machine. It also serializes sends so a slow earlier connection cannot overwrite a newer local selection. Remote mirroring runs in the background so an SSH delay does not hold up the local theme change. omarchy toggle theme sync changes the local mirror setting and reports its state.

This diagram shows the guarded path from a local theme change to a remote apply.

sequenceDiagram
    participant Local as Local Omarchy
    participant SSH as SSH connection
    participant Remote as Remote Omarchy
    Local->>Local: Check local sync toggle
    Local->>SSH: Send current theme name
    SSH->>Remote: Run remote theme command
    Remote->>Remote: Check remote toggle and live session
    Remote->>Remote: Apply theme with incoming marker
    Remote-->>SSH: Report result
    SSH-->>Local: Log result

References: bin/omarchy-toggle-theme-sync• L1-11 bin/omarchy-theme-set• L646-648 bin/omarchy-theme-set-herdr-machines• L20-29 bin/omarchy-theme-set-herdr-machines• L31-80

Change checklist

When these files or sections are changed, remember to consider these:

  • A new application target needs both a theme source and an entry in the post-selection sync group. Otherwise valid theme data may never reach the target.
  • A new template token must remain compatible with the shared color resolver. It affects every generated target that uses the token.
  • Changes to icon roles must keep palette derivation complete and icon templates aligned. A partial role set can prevent all generated icons from being published.
  • Changes to icon set layering or ownership rules must preserve user overrides, built-in fallbacks, packaged icons, and the shell's revision signal.
  • Changes to external-theme file rules must keep the install staging boundary and its ignored-file report aligned.
  • Changes to theme names must preserve the link between current theme state, per-theme background memory, previews, and remote sync.
  • Changes to background intro timing must preserve the current-background and current-theme checks. Otherwise an old transition can finish after a newer selection.
  • Changes to application activation rules must preserve an explicit non-Omarchy selection. Publishing a theme file and selecting that theme are separate actions for several targets.
  • Changes to editor extension generation must keep the generated extension registry entry, its content version, and the selected editor theme aligned.
  • T3 Code changes must keep the generated JSON and CSS inputs, stable omarchy theme identity, Hyprland corner state, and atomic publication aligned.
  • Live application sync changes must preserve the generation check and retint lock. Otherwise a slow older batch can apply after a newer theme.
  • Changes to live tmux retinting must preserve both global session settings and pane refresh behavior. Updating only new sessions leaves existing panes stale.
  • Fcitx5 theme changes must keep the generated fcitx5-theme.conf, the installed omarchy theme directory, and the activation rule aligned. Otherwise the candidate window can use stale colors or override a user's own theme.
  • Slack theme changes must keep the generated slack.json fields, the Slack sync toggle, and the application sync group aligned. Otherwise enabled Slack windows can keep stale or invalid colors.
  • Herdr app changes must keep palette publication, palette validation, the app version gate, and optional activation aligned. Otherwise the app can receive no theme or select a theme that cannot live-reload.
  • GNOME and Qt icon changes must keep their settings aligned with the shared Adwaita icon choice. A new target must also remain optional so an absent desktop config does not block other retints.
  • User background changes must preserve the current-theme folder convention. Otherwise media added through the background folder may not appear in selection or cycling.
  • Remote synchronization changes must keep the incoming-theme guard and both-machine toggle checks. Removing either can create echo loops or unexpected remote changes.

Important failure modes

TriggerConsequenceGuard
Two theme selections run at the same timeOne selection can replace another selection's staged stateThe theme-set lock around staging and current-state replacement
An installed repository contains code-bearing theme filesThose files do not enter the active theme and the repository may appear partly appliedExternal themes are staged as visual data and report ignored files
A theme has no usable backgroundThe palette can apply but no new background transition can startBackground selection reports the missing background and applies the shell palette
A background intro finishes after a new theme is selectedAn old video can overwrite the new visual stateIntro playback checks the current background and theme identity
The GNOME command has no user D-Bus sessionGNOME mode and icon settings remain unchangedGNOME sync exits until a real user session exists
The Qt Engine config is absentQt apps keep their existing icon settingQt sync skips the target without blocking other theme actions
A retint batch belongs to a theme that a later switch replacedAn older application setting can land after the newer themeTheme generations and the retint lock gate deferred application work
A palette key or value contains unsupported charactersThat source entry is skipped and a consumer can fall back or lack the expected valueThe shared resolver validates keys and values before resolution
The current palette cannot produce all required icon rolesTheme-colored icons are removed and packaged icons remain visibleThe icon palette emits a complete role set or no roles, and the icon publisher restores packaged links
A quick theme switch overlaps icon refresh workAn older icon render can appear after a newer themeThe icon refresh lock makes each run read and publish from the current theme
VS Code cannot find a valid descriptor or generated themeThe editor keeps its prior color themeDescriptor validation and generated local extension creation control theme selection
T3 Code has no state directory or its generated theme still has placeholdersT3 Code keeps its prior themeThe sync requires an existing install and skips invalid generated output
Herdr has not been opened or is older than 0.1.11 when activation is requestedThe palette cannot be activated in HerdrNormal sync skips unopened apps, while activation checks the app and its live-reload version
Fcitx5 is not using the Omarchy theme or its generated source is absentThe candidate window keeps its own theme or can keep an older generated resourceActivation changes only default choices, while the sync updates the resource only when the Omarchy theme is present
The generated Slack theme has an invalid mode or colorSlack keeps its prior shared theme fileThe Slack sync validates the mode and required six-digit colors before replacement
Herdr sync is off on either machine or the remote machine has no live sessionThe remote machine keeps its current themeBoth toggles and the remote-session check gate the SSH apply
An install URL produces an unsafe theme name or fails the URL checkThe theme is not cloned or appliedURL validation and the fixed theme-name character set run before removal and cloning

Key files

FileWhy to read it
bin/omarchy-theme-setPrimary theme path. It shows shared state replacement, background handling, transition control, ordered application sync, and remote mirroring.
bin/omarchy-theme-colorShows how one semantic palette is resolved for all theme consumers and how legacy palette names remain usable.
bin/omarchy-theme-set-templatesShows how one palette becomes settings for supported targets, including derived icon roles and the optional glass treatment.
bin/omarchy-theme-icon-paletteShows how the shared palette becomes the complete set of roles used by Omarchy's application icons.
bin/omarchy-theme-set-iconsShows how selected icon sets are layered, rendered, published without partial files, and restored to packaged icons when needed.
bin/omarchy-theme-set-glassShows how the glassy window setting is added or removed without replacing a theme's own values.
bin/omarchy-theme-set-fcitx5Shows how the generated Fcitx5 candidate-window theme is installed, reloaded, and activated without replacing an explicit user choice.
bin/omarchy-theme-bg-setShows how direct background selection reaches the current state and the running shell.
bin/omarchy-theme-bg-nextShows how background cycling uses theme and user media.
bin/omarchy-theme-bg-installShows where users add backgrounds for the current theme.
bin/omarchy-theme-bg-introShows the user control for background intros.
bin/omarchy-theme-bg-boot-introShows startup and theme-change intro selection and stale-transition checks.
bin/omarchy-theme-switcherShows how the desktop picker finds themes and builds previews.
bin/omarchy-theme-installShows the external theme install boundary, safe name checks, replacement behavior, and immediate apply step.
bin/omarchy-theme-refreshShows how the current theme is rebuilt without changing its background.
bin/omarchy-theme-removeShows how only user-installed themes can be removed and how bundled themes are protected.
bin/omarchy-theme-set-gnomeShows how the resolved theme mode and shared icon choice reach GNOME.
bin/omarchy-theme-set-qtShows how the shared icon choice reaches configured Qt Engine apps without replacing other user settings.
bin/omarchy-theme-set-tmuxIllustrates live synchronization of tmux sessions, panes, and clients.
bin/omarchy-theme-set-vscodeIllustrates editor sync, generated local extensions, and the difference between publishing and activating a theme.
bin/omarchy-theme-set-t3codeShows optional T3 Code publication, palette validation, corner synchronization, and atomic theme updates.
bin/omarchy-theme-set-herdr-appShows guarded publication of the generated palette to Herdr and optional activation of the Omarchy theme.
bin/omarchy-theme-set-browserIllustrates browser policy sync and refresh of running browsers.
bin/omarchy-theme-set-slackIllustrates guarded Slack theme-file updates for enabled running Slack windows.
bin/omarchy-theme-set-herdr-machinesShows guarded, loop-free theme mirroring to remote Omarchy machines.