Omarchy

repository·quattro·Indexed 12 days ago

https://github.com/basecamp/omarchy

A modern, opinionated Linux distribution and desktop environment hosted within a single Quickshell instance. It features a plugin-based architecture for UI components and background services, including a highly customizable bar that supports custom Command and QML modules, a dedicated CLI for plugin management, and a suite of first-party plugins for system monitoring, notifications, and connectivity.

Tokens
105K
Snippets
429
Records
495
Agent score
98%

What's inside Omarchy

  1. Overview of the Omarchy shell architecture

    quattro

    The omarchy-shell is a single, long-running Quickshell instance that hosts the entire Omarchy desktop environment. Instead of running separate processes for the bar, background switcher, panels, and overlays, everything runs as a plugin inside this single shell process.

    Benefits of the single-shell model:

    • Shared Services: Singletons and services live once in memory rather than once per process.
    • Low Latency: Summoning a panel is a lightweight IPC call to an existing process, avoiding the cold start of a new quickshell instance.
    • Extensibility: Third-party plugins can be loaded from disk without modifying the core Omarchy source code.
  2. Note on Omarchy 4.0 upgrades

    quattro
    Upgrading to Omarchy 4.0 is handled via a specific command, not the standard migration runner. Do not write compatibility migrations for old installer layouts; those transitions should be implemented within the bin/omarchy-upgrade-to-quattro command.
  3. Understand First-party Plugins

    quattro

    First-party plugins are built-in components that ship with Omarchy and are automatically discovered by the shell at startup.

    Key Characteristics:

    • Discovery: They use the standard manifest.json contract but are flagged with __isFirstParty: true.
    • Lifecycle: Non-bar plugins are enabled by default unless explicitly listed in the disabledPlugins[] configuration. Services and 'keep-loaded' panels mount at startup, while other panels, overlays, and menus load on demand.
    • Bar Behavior: omarchy.bar is the default bar. It only becomes inactive if another plugin with kind: "bar" is selected.
    • Storage: While first-party plugins reside in the system directory, user-installed plugins are located at ~/.config/omarchy/plugins/<plugin-id>/.
  4. Understand the Omarchy file layout and package structure

    quattro

    Omarchy uses a two-package system to manage the transition from system-level configuration to user-level runtime environments:

    1. omarchy package: Contains runtime binaries (/usr/bin/omarchy-*), installation/finalization scripts, migrations, themes, and the Quickshell desktop. It depends on omarchy-settings.
    2. omarchy-settings package: Contains everything required before the main package installs. This includes /etc/skel/ defaults, system-wide /etc/ drop-ins, fonts, branding, bootloader (limine) and snapshot (snapper) configurations, and debug binaries (omarchy-debug, omarchy-debug-idle, omarchy-upload-log).

    User Home Directory ($HOME) Population Layers

    • Seed: omarchy-settings provides static defaults via /etc/skel/. These are copied to $HOME only during user creation (via useradd -m).
    • Finalize: omarchy-finalize-user runs once per user to handle tasks requiring $HOME expansion, runtime detection, or environment variables like $OMARCHY_PATH.
    • Resync: omarchy-reinstall-configs is a destructive command used by existing users to reset their configurations back to the shipped defaults.
  5. How speaker tunings interact with the audio graph

    quattro

    Understanding the audio routing is critical for developers working with Omarchy audio components:

    • Volume Control: Volume lives downstream of the tuning. The tuning acts as a virtual sink that becomes the default output. Changing the system volume alters the level going into the processing. omarchy-audio-output-sink is used to resolve the physical sink through any DSP layers.
    • Sink Visibility: The physical speaker sink is hidden from the user to prevent bypassing the tuning. omarchy-audio-sink-availability reports it as unavailable, and omarchy-audio-output-switch skips it.
    • Stream Movement: To prevent audio processing from being accidentally moved to headphones or causing feedback loops, the tuning sets node.dont-move. omarchy-audio-output-set-default is designed to only move streams that carry an application.name.
  6. Understand the Omarchy environment bootstrap process

    quattro

    Omarchy uses a single source of truth for environment variables, specifically OMARCHY_PATH and a dev-link-aware PATH, located at /usr/share/omarchy/default/bash/env-bootstrap.

    Key Behaviors

    • OMARCHY_PATH: Defaults to /usr/share/omarchy. If a developer uses omarchy-dev-link, this value is updated via /etc/omarchy.conf to point to the development checkout.
    • PATH: Prepends $OMARCHY_PATH/bin to the system PATH only if OMARCHY_PATH is not the production /usr/share/omarchy path. This allows developers to run local versions of omarchy binaries.
    • sudo compatibility: To ensure sudo omarchy-* works for unreleased binaries in a dev environment, omarchy-dev-link writes a drop-in to /etc/sudoers.d/omarchy-dev-path which updates the secure_path.

    Sourcing Points

    The bootstrap script is sourced by:

    • /etc/profile.d/omarchy.sh (system login shells)
    • /etc/skel/.bashrc (interactive shells)
    • /usr/share/uwsm/env.d/10-omarchy (Hyprland via uwsm)
    • /usr/share/omarchy/default/bash/envs (SSH / non-login bash)
  7. How omarchy handles system-owned /etc files via etc-overrides/

    quattro

    To avoid file conflicts with upstream Arch packages, Omarchy does not install directly over certain files in /etc/ (e.g., .bashrc, nsswitch.conf, os-release).

    Instead, these files are stored in /usr/share/omarchy/etc-overrides/. The omarchy-settings package uses post_install or post_upgrade scriptlets to cp -f these files into their proper locations in /etc/.

    Note: Any manual edits made to these files by the user will be overwritten whenever omarchy-settings is upgraded.

  8. How omarchy-shell and plugins work together

    quattro

    The omarchy-shell is a long-running Quickshell instance that hosts the Omarchy desktop environment. All desktop components—including the bar, panels, overlays, menus, and services—are implemented as plugins.

    Plugins are categorized by kinds, which determine how the shell manages them:

    • bar-widget: A component that the active bar drops into a specific section (left, center, or right).
    • bar: A full bar option that can replace the built-in omarchy.bar. Only one full bar is active at a time.
    • panel: A floating window (e.g., an On-Screen Display).
    • overlay: A fullscreen overlay (e.g., a background picker).
    • menu: A summoned menu surface.
    • service: A headless singleton with no UI, typically loaded at startup.

    Panels, overlays, and menus are loaded when summoned, but plugins can set keepLoaded: true to remain in memory between summons. First-party services are loaded automatically at startup.

    {
      "schemaVersion": 1,
      "id": "my.org.cool-clock",
      "name": "Cool clock",
      "version": "1.0.0",
      "author": "You",
      "description": "A clock that does cool things",
      "kinds": ["bar-widget"],
      "entryPoints": { "barWidget": "Widget.qml" }
    }
  9. Understand the Omarchy migration model

    quattro

    Omarchy migrations are one-time repair scripts used when package updates require state changes that pacman cannot manage (e.g., modifying ~/.config, user systemd units, or database state).

    Key characteristics:

    • Location: Scripts are stored in migrations/*.sh.
    • Execution: They run as the current user via omarchy-migrate.
    • Per-user state: Completion is tracked per-user in ~/.local/state/omarchy/migrations/<migration filename>. This means every user on a machine must run the migrations individually.
    • Idempotency Requirement: Migrations must be idempotent. If a migration performs a machine-wide repair, it must detect if that repair was already completed by another user and skip the operation to avoid side effects.
  10. Understand the Omarchy shell configuration and persisted state

    quattro

    Omarchy uses a single user configuration file to manage all customizations, including layout, per-entry settings, and the list of enabled plugins.

    Important Behavior:

    • If ~/.config/omarchy/shell.json does not exist, the shell uses shipped defaults.
    • Once you customize anything, shell.json becomes the authoritative source. The shell does not deep-merge defaults back into your custom file; it uses your file as-is.

    File Locations:

    • ~/.config/omarchy/shell.json: Stores full layout, per-entry settings, and enabled plugin list.
    • ~/.config/omarchy/plugins/<id>/: Directory for user-provided third-party plugin source files.
    {
      "version": 1,
      "idle": {
        "screensaver": 150,
        "lock": 300
      },
      "bar": {
        "id": "omarchy.bar",
        "position": "top",
        "transparent": false,
        "centerAnchor": "omarchy.clock",
        "layout": {
          "left":   [ { "id": "omarchy.menu" }, { "id": "omarchy.workspaces" } ],
          "center": [ { "id": "omarchy.clock", "format": "HH:mm" } ],
          "right": [ { "id": "omarchy.audio" } ]
        }
      },
      "plugins": []
    }
  11. Requirements and best practices for tuning graphs

    quattro

    When designing a filter-chain.conf, adhere to these two critical rules to prevent hardware damage or audio artifacts:

    1. End in a limiter: Ensure all peaks stay below 0 dBFS with sufficient headroom.
    2. Respect driver limits: Do not boost frequencies that the physical drivers cannot deliver. For example, the XPS 14 tuning cuts 40 Hz by ~18 dB to avoid distortion caused by excessive excursion.

    Compatibility Note: EasyEffects cannot coexist with an Omarchy tuning. Because EasyEffects reroutes streams to its own sink, it will bypass the tuning's filter-chain. The omarchy audio tuning on command will refuse to run if EasyEffects is active.