Make defaults live where defaults always live

This commit is contained in:
David Heinemeier Hansson
2026-05-23 11:28:36 +02:00
parent 4cd6593ba3
commit 5fc4921cfc
10 changed files with 18 additions and 19 deletions
+2 -3
View File
@@ -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/<id>/` | 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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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.
+2 -2
View File
@@ -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
}
}
-60
View File
@@ -1,60 +0,0 @@
{
"version": 1,
"idle": {
"screensaver": 150,
"lock": 300
},
"bar": {
"position": "top",
"transparent": false,
"centerAnchor": "omarchy.clock",
"layout": {
"left": [
{
"id": "omarchy.menu"
},
{
"id": "omarchy.workspaces"
}
],
"center": [
{
"id": "omarchy.clock",
"format": "dddd HH:mm",
"formatAlt": "dd MMMM 'W'ww yyyy",
"verticalFormat": "HH\n\u2014\nmm"
},
{
"id": "omarchy.weather"
},
{
"id": "omarchy.indicators"
},
{
"id": "omarchy.system-update"
}
],
"right": [
{
"id": "omarchy.tray"
},
{
"id": "omarchy.bluetooth"
},
{
"id": "omarchy.network"
},
{
"id": "omarchy.audio"
},
{
"id": "omarchy.monitor"
},
{
"id": "omarchy.power"
}
]
}
},
"plugins": []
}
+4 -4
View File
@@ -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()