From 5fc4921cfc16b5801dede317184aa1406a92c3d9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 23 May 2026 11:28:36 +0200 Subject: [PATCH] Make defaults live where defaults always live --- bin/omarchy-plugin | 2 +- bin/omarchy-style-bar-position | 4 ++-- shell/shell-defaults.json => config/omarchy/shell.json | 0 default/omarchy-skill/SKILL.md | 4 ++-- docs/omarchy-shell.md | 2 +- shell/README.md | 5 ++--- shell/plugins/README.md | 4 ++-- shell/plugins/bar/README.md | 4 ++-- shell/plugins/settings/SettingsPanel.qml | 4 ++-- shell/shell.qml | 8 ++++---- 10 files changed, 18 insertions(+), 19 deletions(-) rename shell/shell-defaults.json => config/omarchy/shell.json (100%) diff --git a/bin/omarchy-plugin b/bin/omarchy-plugin index 6f66782a..bfe522e7 100755 --- a/bin/omarchy-plugin +++ b/bin/omarchy-plugin @@ -177,7 +177,7 @@ plugin_enabled() { config_source() { require_omarchy_path - local defaults_file="$OMARCHY_PATH/shell/shell-defaults.json" + local defaults_file="$OMARCHY_PATH/config/omarchy/shell.json" if [[ -s $CONFIG_FILE ]] && jq -e 'type == "object" and .version == 1' "$CONFIG_FILE" >/dev/null 2>&1; then printf '%s' "$CONFIG_FILE" diff --git a/bin/omarchy-style-bar-position b/bin/omarchy-style-bar-position index a5dd4317..e1e28a1b 100755 --- a/bin/omarchy-style-bar-position +++ b/bin/omarchy-style-bar-position @@ -7,7 +7,7 @@ set -e CONFIG_FILE="$HOME/.config/omarchy/shell.json" -DEFAULTS_FILE="$OMARCHY_PATH/shell/shell-defaults.json" +DEFAULTS_FILE="$OMARCHY_PATH/config/omarchy/shell.json" position=$1 if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then @@ -18,7 +18,7 @@ fi mkdir -p "$(dirname "$CONFIG_FILE")" tmp=$(mktemp) -# Seed from shell-defaults.json when the user has no shell.json yet (or it's +# Seed from the default shell.json when the user has no shell.json yet (or it's # malformed). Writing just `{ bar: { position } }` would leave the bar with # no layout, since the shell treats any valid user config as authoritative # and does not deep-merge defaults. diff --git a/shell/shell-defaults.json b/config/omarchy/shell.json similarity index 100% rename from shell/shell-defaults.json rename to config/omarchy/shell.json diff --git a/default/omarchy-skill/SKILL.md b/default/omarchy-skill/SKILL.md index 563a2d57..bb35d3e9 100644 --- a/default/omarchy-skill/SKILL.md +++ b/default/omarchy-skill/SKILL.md @@ -58,7 +58,7 @@ This directory contains Omarchy's source files managed by git. Any changes will **Reading `~/.local/share/omarchy/` is SAFE and useful** - do it freely to: - Understand how omarchy commands work: `omarchy theme set --help` or `cat $(which omarchy-theme-set)` -- See default configs before customizing: `cat ~/.local/share/omarchy/shell/shell-defaults.json` +- See default configs before customizing: `cat ~/.local/share/omarchy/config/omarchy/shell.json` - Check stock theme files to copy for customization - Reference default hyprland settings: `cat ~/.local/share/omarchy/default/hypr/*` @@ -154,7 +154,7 @@ inside a single long-running Quickshell process (`omarchy-shell`). ``` ~/.config/omarchy/shell.json # User overrides: bar.position, bar.layout, plugins[] -~/.local/share/omarchy/shell/shell-defaults.json # Canonical defaults +~/.local/share/omarchy/config/omarchy/shell.json # Canonical defaults ``` The shell hot-reloads `shell.json` on save — no restart needed for layout diff --git a/docs/omarchy-shell.md b/docs/omarchy-shell.md index dbd1fdbe..330ded37 100644 --- a/docs/omarchy-shell.md +++ b/docs/omarchy-shell.md @@ -106,7 +106,7 @@ Rules: 6. `idle.screensaver` and `idle.lock` are seconds since user idle began. 7. `version: 1` is required. -`shell-defaults.json` describes the fresh-install state. When no +`config/omarchy/shell.json` describes the fresh-install state. When no user `shell.json` exists, defaults are used verbatim. Once the user customizes, `shell.json` is canonical — there is no deep-merge. diff --git a/shell/README.md b/shell/README.md index 34de8a72..c7c73cdb 100644 --- a/shell/README.md +++ b/shell/README.md @@ -19,7 +19,6 @@ The runtime layout: ``` shell/ shell.qml entry point (ShellRoot) - shell-defaults.json canonical out-of-the-box config services/ PluginRegistry.qml discovers, validates plugins, looks up enabled state in shell.json BarWidgetRegistry.qml unified registry for bar widgets (1p + 3p) @@ -168,12 +167,12 @@ customization from the shipped defaults lives in it. | `~/.config/omarchy/shell.json` | the shell | full layout + per-entry settings + enabled plugin list | | `~/.config/omarchy/plugins//` | user | drop-in third-party plugin source files | -The `shell-defaults.json` bundled with the shell describes the +The `config/omarchy/shell.json` default config describes the fresh-install state. When the user has no `shell.json`, the shell uses the defaults verbatim. Once the user customizes anything, `shell.json` becomes the authoritative file — we do **not** deep-merge defaults back in. Pressing **Reset bar to defaults** in `omarchy launch bar settings` -rewrites the `bar` subtree from the current `shell-defaults.json`. +rewrites the `bar` subtree from the current default shell config. ### shell.json shape diff --git a/shell/plugins/README.md b/shell/plugins/README.md index 84af5d17..9decd141 100644 --- a/shell/plugins/README.md +++ b/shell/plugins/README.md @@ -35,8 +35,8 @@ own `manifest.json`. The status bar. Mounted at startup, lives forever. Layout lives in the top-level `bar:` subtree of `~/.config/omarchy/shell.json` (with the shell -providing [`shell-defaults.json`](../shell-defaults.json) when the user has -no file). See [`bar/README.md`](bar/README.md) for the widget catalogue +providing [`config/omarchy/shell.json`](../../config/omarchy/shell.json) when +the user has no file). See [`bar/README.md`](bar/README.md) for the widget catalogue and customization schema. ## Bar settings diff --git a/shell/plugins/bar/README.md b/shell/plugins/bar/README.md index 852aff4f..fabc0556 100644 --- a/shell/plugins/bar/README.md +++ b/shell/plugins/bar/README.md @@ -9,12 +9,12 @@ the shell for its whole session. - `Bar.qml` is Omarchy-owned bar engine code, loaded by the omarchy-shell host. Users should not edit it directly. - `widgets/` holds simple first-party bar widgets with sibling manifests. - Feature plugins such as `../audio/`, `../network/`, and `../power/` provide richer popup bar widgets. -- The bar receives its config from the host shell as a `barConfig` property; the host loads it from `~/.config/omarchy/shell.json` (or `shell-defaults.json` when the user has no file). +- The bar receives its config from the host shell as a `barConfig` property; the host loads it from `~/.config/omarchy/shell.json` (or `config/omarchy/shell.json` when the user has no file). - `omarchy-style-bar-position` updates only the user shell.json file. ## Customizing -The bar config lives under the `bar:` key of [`~/.config/omarchy/shell.json`](../../README.md#shelljson-shape). Out of the box the shell uses [`shell-defaults.json`](../../shell-defaults.json). Once you customize anything via `omarchy launch bar settings` or by editing shell.json directly, your file is canonical — there is no deep-merge. +The bar config lives under the `bar:` key of [`~/.config/omarchy/shell.json`](../../README.md#shelljson-shape). Out of the box the shell uses [`config/omarchy/shell.json`](../../../config/omarchy/shell.json). Once you customize anything via `omarchy launch bar settings` or by editing shell.json directly, your file is canonical — there is no deep-merge. Launch the visual editor with `omarchy launch bar settings` / `omarchy plugin bar edit` (or run `omarchy-launch-bar-settings`) to reorder widgets, add/remove them, and tweak per-widget options without editing JSON by hand. For scriptable changes, use `omarchy plugin bar list`, `omarchy plugin bar add`, `omarchy plugin bar move`, `omarchy plugin bar remove`, and `omarchy plugin bar set`. You can also right-click empty space to the left or right of the centered clock module to open it; double-left-click the same empty space to toggle bar transparency. diff --git a/shell/plugins/settings/SettingsPanel.qml b/shell/plugins/settings/SettingsPanel.qml index 1d00e086..15ee0c4a 100644 --- a/shell/plugins/settings/SettingsPanel.qml +++ b/shell/plugins/settings/SettingsPanel.qml @@ -35,7 +35,7 @@ Item { property string omarchyPath: Quickshell.env("OMARCHY_PATH") readonly property string home: Quickshell.env("HOME") readonly property string userConfigPath: home + "/.config/omarchy/shell.json" - readonly property string defaultsPath: omarchyPath + "/shell/shell-defaults.json" + readonly property string defaultsPath: omarchyPath + "/config/omarchy/shell.json" // ---------------- theme -------------------------------------------------- // Bar settings deliberately isn't a themable surface in shell.toml — it @@ -201,7 +201,7 @@ Item { var parsed = JSON.parse(diskText) if (Util.isPlainObject(parsed) && parsed.version === 1) defaults = parsed } catch (e) { - console.warn("Bad shell-defaults JSON, falling back to builtin:", e) + console.warn("Bad default shell JSON, falling back to builtin:", e) defaults = builtinShellConfig } } diff --git a/shell/shell.qml b/shell/shell.qml index 0019294b..ed2563d1 100644 --- a/shell/shell.qml +++ b/shell/shell.qml @@ -26,10 +26,10 @@ ShellRoot { property string omarchyPath: Quickshell.env("OMARCHY_PATH") readonly property string shellPath: omarchyPath + "/shell" readonly property string firstPartyPluginsDir: shellPath + "/plugins" - readonly property string defaultsPath: shellPath + "/shell-defaults.json" + readonly property string defaultsPath: omarchyPath + "/config/omarchy/shell.json" readonly property string userConfigPath: home + "/.config/omarchy/shell.json" - // Bundled fallback so the shell can start even when shell-defaults.json is + // Bundled fallback so the shell can start even when the default shell.json is // missing or unreadable. The bar config here mirrors the on-disk defaults // closely enough to render a usable bar; not authoritative. readonly property var builtinShellConfig: ({ @@ -85,7 +85,7 @@ ShellRoot { if (Util.isPlainObject(parsed) && parsed.version === 1) defaultsConfig = parsed else defaultsConfig = builtinShellConfig } catch (e) { - console.warn("shell-defaults.json parse failed, using builtin:", e) + console.warn("default shell.json parse failed, using builtin:", e) defaultsConfig = builtinShellConfig } applyShellConfig() @@ -107,7 +107,7 @@ ShellRoot { printErrors: false onLoaded: shell.loadDefaults(text()) onLoadFailed: function(error) { - console.warn("shell-defaults load failed: " + error + " path=" + shell.defaultsPath) + console.warn("default shell.json load failed: " + error + " path=" + shell.defaultsPath) shell.loadDefaults("") } onFileChanged: reload()