Rebuild an Omarchy dev link checkout from all of your open PRs and selected upstream PRs, so the live desktop runs every patch together.
If you keep several Omarchy PRs in flight, testing them one branch at a time misses interactions. This script fetches upstream, fast-forwards your PR branches, and rebuilds a throwaway integration branch (integration-prs by default) by merging each open PR onto quattro. The checkout stays on that branch, so omarchy dev link is already running the combined tree.
Only one sync can run at a time per user, including across checkouts. A second invocation exits immediately with status 75 before self-update, Git operations, or package work. The lock survives self-update and is released on exit or before launching the troubleshooting agent. --help remains available while a sync is running.
Before syncing, it checks its own Git tracking branch and fast-forwards a clean checkout to the latest commit, then restarts with the original arguments. Local changes, detached HEAD, missing tracking branches, ahead/diverged history, or fetch failures leave the existing version running with a warning. Copies outside a Git checkout run without self-updating. --help never fetches. Use --no-self-update, self_update=0 in the config, or OMARCHY_DEV_SYNC_SELF_UPDATE=0 to disable it.
- Fetches the upstream remote (
origin) and your fork (fork). - Lists your open PRs against that upstream with
gh. - Fast-forwards each PR branch from the fork (or merges the remote tip if the local branch cannot fast-forward).
- Checks out
$upstream/quattroasintegration-prsand merges every PR branch into it. - Force-pushes
integration-prsto the fork with--force-with-lease. - Rebuilds and installs the
omarchy-settings-devandomarchy-devpackages from the rebuilt checkout when the packaged copies behind pkexec or their packaging recipes have gone stale, so helpers likeomarchy-windows-vmkeep elevating. Your open omarchy-pkgs PRs are merged into a disposable worktree first, so the packages under test include your packaging fixes. Both packages go into a single pacman transaction (installed separately, the settings package conflicts with the installed release omarchy). The dev builds carryepoch=1sodev.<sha>sorts above official releases andomarchy updatedoes not replace them. - Checks installed runtime packages independently of Omarchy helper differences. Quickshell uses the merged omarchy-pkgs recipe when available, otherwise the bundled Arch recipe with upstream Qt 6.12 fix
5d5d498. A recipe/patch change, an installed Qt dependency change, or replacement of the installed package triggers a rebuild. Successful installations are recorded under${XDG_STATE_HOME:-~/.local/state}/omarchy-dev-sync/packages; unchanged packages are skipped. A build/install failure stops before restarting the shell. - Restarts the live Omarchy shell when this checkout is the session
OMARCHY_PATH. A secure session lock deliberately blocks that restart so the lock client is not killed; the sync then reports the deferred restart instead of failing. The rebuilt shell loads at the next login or afteromarchy restart shell.
Before restarting, it checks the persistent dev link in /etc/omarchy.conf. When that link points at the synced checkout, it aligns known Omarchy stable/rc URLs in /etc/pacman.conf and /etc/pacman.d/mirrorlist with edge, preserving custom repositories, settings and comments. Changed files get *.bak.omarchy-dev-sync.* backups. The full system update now runs automatically after integration and mirror alignment, before package rebuilds so runtime packages build against the upgraded dependencies. This prevents development migrations from requesting packages missing from stable. Packaged installations and other linked checkouts are untouched. Repair needs sudo in a terminal or pkexec otherwise; failure stops the sync. This check also runs with --no-pkg; use --no-package-sources, config package_sources=0, or OMARCHY_DEV_SYNC_PACKAGE_SOURCES=0 to opt out.
Known append-only conflicts in test/shell.d/theme-staging-test.sh (colour_only / denied arrays) are resolved as a sorted union. Other conflicts require a matching verified quirk; unresolved conflicts abort the rebuild and restore the previous integration branch.
Compatibility fixes live in independently removable quirks/<id>/ directories. The quirk contract defines activation, source/package conflict and pre-restart hooks, including retirement rules. Each quirk checks whether it is still needed. Disable named quirks with config disabled_quirks="qt612-shell-color" or OMARCHY_DEV_SYNC_DISABLED_QUIRKS (space-separated); deleting a quirk directory retires it without editing the main script.
Qt 6.12 compatibility is portable: installed Qt 6.12 or newer automatically includes upstream PR #14511 until upstream ships ShellColor or its qualified Commons.Color replacement. The latter also suppresses obsolete PR #14511 entries in extra-prs. Verified mechanical palette rename/qualification conflicts preserve feature behavior through a three-way merge; unrelated conflicts still stop the sync. Before restart, user plugin QML importing qs.Commons is migrated for actual palette members with per-file backups, including previous ShellColor migrations back to upstream qualification. Unrelated Qt color members, qualified imports and symlinked plugins are preserved. No saved rerere cache is required.
-
A local Omarchy clone with:
origin→ upstream (omacom/omarchy)fork→ your GitHub fork
-
ghauthenticated as the PR author -
Optional:
omarchy dev linkpointing at that clone -
Optional, for the automatic package refresh: an omarchy-pkgs checkout at
~/Work/omarchy/omarchy-pkgs(orOMARCHY_PKGBUILDS_DIRpointed at one), and sudo for terminal installs (pkexec for noninteractive callers). Runtime builds also need their PKGBUILD build dependencies; terminal calls let makepkg install them, while agent/background calls must install missing dependencies separately. Your open PRs against omacom/omarchy-pkgs are merged into a throwaway worktree for the build; the checkout itself is never modified. PointOMARCHY_PKGBUILDS_DIRat a directory to use those PKGBUILDs as-is and skip the PR merge.
The installer and each sync verify authentication for the active github.com account before setup or integration. If the check fails, run gh auth login --hostname github.com; for an existing login, check token validity and network access with gh auth status --active --hostname github.com. Inactive accounts do not block this check.
PR ownership follows the active GitHub CLI account: both source and packaging queries use gh pr list --author @me. Switch accounts with gh auth switch; no username is configured or hardcoded in the script. Upstream, fork and self-update URLs come from Git remotes. The clone URL below identifies this project's repository, not the account whose PRs are selected.
Use install.sh for the recommended setup. If you want help choosing paths or adapting an existing checkout, use the agent prompt below. Manual setup is the last option.
Run these steps as your normal user in a terminal on an existing Omarchy installation. You need Git, Python 3, an authenticated GitHub CLI (gh auth login), and sudo access for dev-link setup and package installation.
-
Choose checkout locations. Defaults are
~/src/omarchyfor Omarchy and~/Work/omarchy/omarchy-pkgsfor packaging. Existing checkouts are supported; the installer can create missing ones after confirmation. -
Clone this tool:
git clone https://github.com/ekollof/omarchy-dev-sync.git ~/src/omarchy-dev-sync cd ~/src/omarchy-dev-sync
-
If your checkout or remote names differ from the defaults, create or edit
~/.config/omarchy-dev-sync/configbefore installing:mkdir -p ~/.config/omarchy-dev-sync # Edit this file; preserve any existing settings. $EDITOR ~/.config/omarchy-dev-sync/config
Example contents:
repo=$HOME/src/omarchy upstream=origin fork=fork head=quattro pkgs_repo=$HOME/Work/omarchy/omarchy-pkgs
Both the installer and sync honor
OMARCHY_DEV_SYNC_CONFIGandOMARCHY_DEV_SYNC_REPO. See Configuration for other settings and optional packaging checkout setup. -
Run the installer without sudo:
./install.sh
For each repository (
omacom/omarchyandomacom/omarchy-pkgs), it checks the configured checkout and remotes. Complete setups are skipped without confirmation. For missing remotes, it checks the active GitHub account’s existing forks by upstream parent, including renamed forks. Existing forks and upstream repositories are reused, and missing local remotes are filled in without prompting. Creating a GitHub fork or cloning a missing checkout requires confirmation listing the target path and upstream. Omarchy clones start on the configuredhead(defaultquattro); packaging clones use the upstream default branch. Existing checkouts, branches, files, and remotes are preserved. Declining or closed stdin stops installation; setup already completed for an earlier repository remains in place.Omarchy uses configured
upstream/forkremote names (defaultsorigin/fork); packaging usesorigin/fork. A missing upstream alone is added without creating a fork when a fork remote already exists. GitHub API/authentication errors stop setup. Existing remote URLs are never changed. Creating a GitHub fork requires confirmation.It then checks the persistent link in
/etc/omarchy.conf, and the running session. If the checkout is not dev-linked, it warns about unstable development code, privileged commands, edge packages, and migrations, then asksEnable this development setup? [y/N]. Enteryoryesto runomarchy dev link <checkout> --no-reboot. Declining or closed stdin cancels installation. Run the installer directly in a terminal so you can review and answer the prompt.Development branches and integrated PRs can break the desktop, updates, or boot. Dev linking trusts your writable checkout for system commands, including privileged commands. Keep backups and a recovery method.
omarchy dev unlinkrestores the packaged path after reboot, but does not undo package upgrades or migrations.After setup is accepted, the installer creates missing
config,extra-branches, andextra-prsfiles in~/.config/omarchy-dev-sync/(orOMARCHY_DEV_SYNC_CONFIG). The config saves the selected checkout paths and remote names, with integration branchintegration-prs, Quickshell runtime refresh, self-update, system updates, package-source alignment, package builds, shell restart, and agent troubleshooting enabled by default. Environment overrides used for installation are saved in a new config. Selection files contain comments only, with no extra branches or PRs selected. Existing files are never overwritten; generated files are readable only by your user.The installer links the launcher at
~/.local/bin/omarchy-dev-sync, registersomarchy dev syncwith a symlink in the configured checkout’sbin/, and installs the bundled agent skills. The command link is ignored locally through Git’sinfo/exclude; it is not committed or included in package-skew checks. Existing commands are preserved, and registration conflicts stop installation. It does not run a sync, system update, or reboot. If the correct link is already configured, it leaves it in place. -
If the installer says the link is not active, reboot before syncing. Changing
OMARCHY_PATHin a terminal does not activate the link across the desktop session. You can rerun./install.shafter reboot to check that the link is configured and active. -
Ensure
~/.local/binis on yourPATH, then run:omarchy dev sync --help omarchy dev sync
The standalone
omarchy-dev-synccommand remains available. Rerun./install.shto register the subcommand on an existing installation.A normal sync rebuilds integration, runs the full system updater and migrations, refreshes development/runtime packages, and restarts the live shell. It can request sudo authorization. Use
--no-system-updateto skip the system update,--no-pkgto skip package builds, or--no-restartto skip the shell restart.
For automatic troubleshooting, select an installed default agent with omarchy default agent <name>. Failures launch that agent with the sync log and checkout paths. Use --no-agent to disable this behavior.
The installer and sync startup install the omarchy-dev skill in ~/.agents/skills, ~/.claude/skills, ${XDG_CONFIG_HOME:-~/.config}/opencode/skills, and ${CODEX_HOME:-~/.codex}/skills. Missing skills become symlinks to this checkout. Changed copies are refreshed with omarchy-dev.bak.* backups; unrelated symlinks are preserved with a warning. Manual skill links are not required. Keep this tool’s checkout in place because the launcher and skills link to it.
Give your coding agent this prompt. It should inspect your existing setup and use the installer, leaving its confirmations for you to answer:
Set up https://github.com/ekollof/omarchy-dev-sync on this Omarchy machine.
Read README.md, install.sh, and the bundled omarchy-dev skill before making
changes. Prefer install.sh over recreating its logic manually.
Check Git, Python 3, GitHub CLI authentication, existing Omarchy and
omarchy-pkgs checkouts, remotes, forks, and the persistent and active dev link.
Reuse existing repositories and forks, including renamed forks. Preserve
working files, existing remote URLs, and configuration. Use the documented
default paths unless existing checkouts or my preferences suggest otherwise.
Clone the tool if needed and configure its checkout paths and remote names.
Run install.sh in an interactive terminal where I can answer its prompts,
or give me the exact command to run there. Do not supply yes automatically.
Explain the development-branch risks before asking me to approve a new fork,
checkout, or dev link. Never reboot or run the first sync/system update without
my approval. If activation needs a reboot, explain that and stop there.
Verify the launcher, omarchy dev sync --help, and agent skill links once the
dev link is active. Report what changed and any remaining steps.
Use this only if you want to manage each step yourself. Read the development risks in the installer instructions above first. These commands assume new checkouts at the default paths; for existing checkouts, inspect and reuse their remotes rather than cloning over them or replacing URLs.
Authenticate GitHub CLI and clone the tool:
gh auth login --hostname github.com
mkdir -p ~/src
git clone https://github.com/ekollof/omarchy-dev-sync.git ~/src/omarchy-dev-syncCreate or reuse your forks and clone upstream. Running gh repo fork below can create public GitHub forks; only run it if you want that setup:
gh repo fork omacom/omarchy --clone=false --remote=false
gh repo fork omacom/omarchy-pkgs --clone=false --remote=false
gh repo clone omacom/omarchy ~/src/omarchy -- --branch quattro --origin origin
mkdir -p ~/Work/omarchy
gh repo clone omacom/omarchy-pkgs ~/Work/omarchy/omarchy-pkgs -- --origin originAdd a fork remote to each checkout using your fork’s actual URL. Replace YOUR-GITHUB-USERNAME below; if a fork was renamed, use its actual repository name too:
git -C ~/src/omarchy remote add fork https://github.com/YOUR-GITHUB-USERNAME/omarchy.git
git -C ~/Work/omarchy/omarchy-pkgs remote add fork https://github.com/YOUR-GITHUB-USERNAME/omarchy-pkgs.gitFor other paths or Omarchy remote names, create the config shown in Configuration. Packaging uses origin and fork. Then register the launchers and refresh the bundled skills:
mkdir -p ~/.local/bin
ln -s ~/src/omarchy-dev-sync/omarchy-dev-sync ~/.local/bin/omarchy-dev-sync
ln -s ~/src/omarchy-dev-sync/omarchy-dev-sync ~/src/omarchy/bin/omarchy-dev-sync
# Keep this machine-local registration out of source commits.
printf '\n/bin/omarchy-dev-sync\n' >> ~/src/omarchy/.git/info/exclude
bash -c 'source "$HOME/src/omarchy-dev-sync/lib/self-update.sh"; refresh_local_dev_skills "$HOME/src/omarchy-dev-sync/skills/omarchy-dev"'Do not replace an existing command or unrelated symlink. Keep ~/.local/bin on your PATH and retain the tool checkout because these links point into it.
When you have reviewed the risks and are ready to trust the checkout for system commands, enable the dev link as your normal user:
omarchy dev link ~/src/omarchy --no-rebootReboot at a convenient time to activate the link across the desktop. After reboot, verify omarchy dev sync --help. Run the first omarchy dev sync when you are ready for integration, system updates, migrations, package builds, and a shell restart. The skip flags described above also apply to manual installations.
Settings live in ~/.config/omarchy-dev-sync/ (override the directory with OMARCHY_DEV_SYNC_CONFIG).
config is sourced as bash. Environment variables still win over the file.
# ~/.config/omarchy-dev-sync/config
repo=$HOME/src/omarchy
upstream=origin
fork=fork
head=quattro
integration=integration-prs
pkgs_repo=$HOME/Work/omarchy/omarchy-pkgs
pkgs_prs=1
runtime_packages="quickshell"
self_update=1
package_sources=1| File / variable | Default | Meaning |
|---|---|---|
config repo / OMARCHY_DEV_SYNC_REPO |
~/src/omarchy |
Omarchy checkout |
config upstream / OMARCHY_DEV_SYNC_UPSTREAM |
origin |
Upstream remote |
config fork / OMARCHY_DEV_SYNC_FORK |
fork |
Your fork remote |
config head / OMARCHY_DEV_SYNC_HEAD |
quattro |
Upstream branch |
config integration / OMARCHY_DEV_SYNC_INTEGRATION |
integration-prs |
Integration branch to rebuild |
config pkgs_repo / OMARCHY_DEV_SYNC_PKGS_REPO |
~/Work/omarchy/omarchy-pkgs |
omarchy-pkgs checkout for package builds |
config pkgs_prs / OMARCHY_DEV_SYNC_PKGS_PRS |
1 |
Merge your open omarchy-pkgs PRs into a disposable worktree for the package build |
To merge a branch before its PR is open, put the branch name in extra-branches (one per line, # comments allowed). Delete the line once the PR exists; gh will pick it up.
For a reviewed PR by another author, put its upstream PR number in extra-prs (one per line; # comments allowed). The script fetches upstream pull refs directly, so no fork branch or duplicate PR is needed. Closed (including merged) PRs and deleted PRs are automatically removed from this file before selection. A missing PR is removed only when GitHub confirms the repository remains accessible. Invalid entries, authentication/network errors or a failed fetch stop before rebuilding integration; status-check failures preserve the entire selection file. Comments and remaining entries are retained. Open PRs remain selected even if their fixes are incorporated through another branch.
python3 tests/install-repositories-test.py
python3 tests/install-test.py
python3 tests/self-update-test.py
python3 tests/extra-prs-test.py
bash tests/skill-refresh-test.sh
python3 tests/package-version-merge-test.py
python3 tests/dev-package-sources-test.py
python3 tests/shell-color-compat-test.py
bash tests/quirks-test.sh
bash tests/restart-live-shell-test.sh
bash tests/package-state-test.sh
python3 tests/sync-runtime-test.pyThese tests cover selected PR inclusion, runtime refresh with zero helper skew, Qt/patch/package changes, unchanged-build skipping, and failure handling without touching the real desktop or package database.
- The working tree of the Omarchy checkout must be clean.
- Dev package refresh compares every checkout
bin/omarchy-*command and file underinstall/helpers/with its installed copy, detecting missing files as well as changed contents. It also checks packaging recipe fingerprints. This catches newly added migration helpers even when no existing privileged command changes. Runtime package refresh checks its own recipe, installed version, and declared ABI dependencies.--no-pkgskips all package work. The first package-enabled sync establishes fingerprints, so it rebuilds packages once even if a matching local rebuild was previously installed by hand. - Package workspaces live under
${XDG_CACHE_HOME:-$HOME/.cache}/omarchy-dev-sync/builds, avoiding/tmpquotas. Normal exits, errors and handled interruptions remove the current workspace; the next package-enabled run removes abandoned workspaces. A lock prevents concurrent package builds from deleting each other's files. Older untracked/tmp/omarchy-dev-sync-*directories are left alone because they may belong to a still-running older version. - The omarchy-pkgs PR merge is local only: nothing is pushed. Fetch failures and unresolved merge conflicts stop package refresh so packaging patches cannot silently disappear. For the two dev PKGBUILDs, independent upstream
pkgverchanges and PRpkgrelincreases are combined automatically, preserving the upstream version and PR release bump; all remaining content must merge cleanly with Git. Git rerere can also replay a resolution you have verified by hand. With PR merging enabled, recipes come from a disposable worktree of the freshly fetched default branch even when no PR is open; the original checkout stays untouched. - This is not part of Omarchy itself. It is a personal workflow published in case it is useful to other people with a stack of open PRs.
Sync now runs the integrated checkout’s bin/omarchy-update -y after integration and mirror alignment, before package builds and shell restart. This includes system packages and migrations. Skip with --no-system-update, config system_update=0, or OMARCHY_DEV_SYNC_SYSTEM_UPDATE=0. --no-pkg and --no-restart only skip their respective steps.
Failures launch Omarchy’s default agent with a private transcript under ${XDG_STATE_HOME:-~/.local/state}/omarchy-dev-sync/logs, the failed phase, and checkout paths. Cleanup and build-lock release happen first. The original failure exit status is preserved; interruptions do not launch an agent. Skip with --no-agent, config agent_on_failure=0, or OMARCHY_DEV_SYNC_AGENT_ON_FAILURE=0. Agent retries inherit OMARCHY_DEV_SYNC_TROUBLESHOOTING=1 to prevent recursive launches. A configured default agent and omarchy-agent are required.