Add Omarchy support with conditional tool management - #16
Open
CS-5 wants to merge 1 commit into
Open
Conversation
Omarchy owns a large part of $HOME plus its own mise, package-update
entrypoint, and login shell, and several of these dotfiles collided with
it hard enough to break. Add an `isOmarchy` data flag (a
/usr/share/omarchy directory or, on the dev channel, /etc/omarchy.conf)
and defer to Omarchy wherever it already provides something.
Fixes outright breakage:
- install.sh no longer chsh's to fish there. SDDM, /etc/profile.d, and
the uwsm session are bash scripts, and chsh'ing to fish breaks the
graphical login. ~/.bashrc execs fish for interactive terminals
instead, which is what omarchy-setup-fish does -- but chezmoi owns
~/.bashrc, so that command must not be run.
- install.sh's bootstrap step and `update` both ran `pacman -Syu`, which
Omarchy's 00-omarchy-update-guard.hook libalpm hook aborts. The former
now uses omarchy-pkg-add; the latter hands the whole system-package
step to `omarchy-update -y`, which also covers mise itself and mise's
tools. It runs last because it owns the reboot prompt.
- `mise self-update` is tolerated rather than fatal. Omarchy installs
mise-bin, which ships mise's self-update marker and exits nonzero, so
every `chezmoi apply` was failing on that script. Same fix covers
Arch's mise and Homebrew.
- `clean` trims the package cache with `paccache -rk2` instead of
emptying it with `pacman -Sc`: Omarchy treats the cache as its only
offline downgrade path and keeps two versions per package.
Splits mise config ownership:
- The tool config moves from ~/.config/mise/config.toml to a
conf.d/10-dotfiles.toml drop-in. Omarchy provisions its lazy tool
stubs with `mise use -g`, which writes config.toml, so chezmoi owning
that file made the two clobber each other on every apply. mise
structurally refuses to write into conf.d. Note the precedence
trade-off: config.toml outranks conf.d.
- A run_once script moves a pre-existing dotfiles-owned config.toml
aside (config.toml outranks conf.d, so a leftover copy would keep
winning). It recognises the old file by its minimum_release_age line
so a `mise use -g` config survives untouched.
- Tools Omarchy already ships are dropped there: starship, lazygit,
lazydocker, fd, fzf, jq, ripgrep, zoxide, usage and herdr as pacman
packages, gh and hunk as Omarchy's ~/.local/bin mise stubs. A
duplicate herdr is the worst of these -- Omarchy has a migration that
deletes mise copies because a stale client shadows /usr/bin/herdr with
an older wire protocol.
Shell and terminal integration:
- ~/.bashrc sources Omarchy's default/bash/env-bootstrap above the
interactivity guard (OMARCHY_PATH and the PATH entries non-interactive
shells and the uwsm session need), then default/bash/rc, and skips our
duplicate starship/mise/zoxide/mcfly activations and history settings.
- install.sh installs omarchy-fish and ttf-firacode-nerd. omarchy-fish
vendors fzf.fish, so the fundle copy is dropped to stop the two
fighting over the same keybindings; conf.d/{mise,zoxide,starship}.fish
now check for the function their activation defines so they don't
spawn a redundant subprocess on every shell start.
- The ghostty config becomes a template that follows Omarchy's theme
system (config-file = ?".../current/theme/ghostty.conf") instead of
pinning a theme, so the terminal stays in sync with the rest of the
desktop. font-family stays unquoted on purpose: omarchy-font-set only
rewrites a quoted one, which keeps chezmoi the source of truth.
Renders are byte-identical to before on non-Omarchy hosts. Verified with
chezmoi init --apply into a throwaway HOME both with and without a
/usr/share/omarchy present, including the config.toml migration in both
directions, `update`/`clean` branch selection against command stubs, the
bash-to-fish handoff guards, and the fish activation guards under real
fish.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXzpqB5fEr7ASNjLz7AjKT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive support for Omarchy, an opinionated Arch/Hyprland setup that owns significant portions of
$HOME. The dotfiles now detect Omarchy environments and adapt their behavior across package management, tool configuration, shell setup, and update workflows to avoid conflicts with Omarchy's own systems.Key Changes
Environment Detection & Configuration
isOmarchydata flag to.chezmoi.toml.tmplthat detects/usr/share/omarchyor/etc/omarchy.conf(dev channel)IS_OMARCHYdetection toinstall.shwith matching logicAGENTS.mdwith comprehensive Omarchy documentation including behavior tableTool Management (mise)
~/.config/mise/config.tomltoconf.d/10-dotfiles.tomldrop-in to avoid conflicts withmise use -g(used by Omarchy's lazy tool stubs)run_once_before_00-migrate-mise-config.sh.tmpland.ps1.tmpl) to move pre-existing dotfiles-owned config asidestarship,lazygit,lazydocker,fd,fzf,jq,ripgrep,zoxide,usage,herdr,gh,hunkShell & Login Configuration
dot_bashrc.tmplfor Omarchy: sources Omarchy'senv-bootstrapandrc, execs fish for interactive terminals instead of usingchshmise.fish,starship.fish,zoxide.fish) to skip re-activation when Omarchy'somarchy-fishalready activated themomarchy-fish)config.fishto allow fish_vi_key_bindings override from OmarchyPackage Management & Updates
install.shto useomarchy-pkg-addinstead ofpacman -Syuon Omarchy, plusomarchy-fishandttf-firacode-nerdupdatescript to hand off system package and mise self-update steps toomarchy-update -yon Omarchy (runs last to own reboot prompt)cleanscript to usepaccache -rk2on Omarchy instead ofpacman -Sc(preserves two package versions for downgrade path)run_after_mise-update.sh.tmplfor package-manager builds that disable self-updateTerminal Configuration
ghostty/configto template (ghostty/config.tmpl) with Omarchy theme system support via~/.local/state/omarchy/current/theme/ghostty.confDocumentation
AGENTS.mdwith detailed Omarchy section covering login shell, bashrc, bootstrap packages, fish, mise config, and mise self-update behaviorREADME.mdto mention Omarchy support and link to detailed documentationImplementation Details
conf.ddrop-in approach for mise leverages precedence rules:conf.dis lowest precedence, soconfig.toml(written bymise use -g) wins for duplicate tools, avoiding shadowing issuesfunctions -q) rather than just binary checks, since Omarchy's vendor_conf.d activations are per-shell statechezmoi inittime (likeisDcand identity), so post-install Omarchy setup requires re-initisOmarchyflag, maintaining clean separation and allowing easy testing viarender.sh --data '{"isOmarchy":true}'https://claude.ai/code/session_01CXzpqB5fEr7ASNjLz7AjKT