diff --git a/bin/omarchy-style-bar-position b/bin/omarchy-style-bar-position index af3a83e2..2ef44675 100755 --- a/bin/omarchy-style-bar-position +++ b/bin/omarchy-style-bar-position @@ -7,6 +7,7 @@ set -e CONFIG_FILE="$HOME/.config/omarchy/shell.json" +DEFAULTS_FILE="${OMARCHY_PATH:-$HOME/.local/share/omarchy}/default/quickshell/omarchy-shell/shell-defaults.json" position=$1 if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then @@ -17,14 +18,20 @@ fi mkdir -p "$(dirname "$CONFIG_FILE")" tmp=$(mktemp) +# Seed from shell-defaults.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. if [[ -s $CONFIG_FILE ]] && jq -e 'type == "object"' "$CONFIG_FILE" >/dev/null 2>&1; then - jq --arg position "$position" ' - .version = 1 | - .bar = ((.bar // {}) | if type == "object" then . else {} end) | - .bar.position = $position - ' "$CONFIG_FILE" >"$tmp" + source="$CONFIG_FILE" else - jq -n --arg position "$position" '{ version: 1, bar: { position: $position } }' >"$tmp" + source="$DEFAULTS_FILE" fi +jq --arg position "$position" ' + .version = 1 | + .bar = ((.bar // {}) | if type == "object" then . else {} end) | + .bar.position = $position +' "$source" >"$tmp" + mv "$tmp" "$CONFIG_FILE" diff --git a/default/hypr/apps/omarchy-bar-settings.lua b/default/hypr/apps/omarchy-bar-settings.lua deleted file mode 100644 index 22728d23..00000000 --- a/default/hypr/apps/omarchy-bar-settings.lua +++ /dev/null @@ -1,4 +0,0 @@ -hl.window_rule({ match = { title = "^Omarchy bar settings$" }, tag = "+floating-window" }) -hl.window_rule({ match = { title = "^Omarchy bar settings$" }, size = { 720, 720 } }) -hl.window_rule({ match = { title = "^Widget settings " }, tag = "+floating-window" }) -hl.window_rule({ match = { title = "^Widget settings " }, size = { 380, 320 } }) diff --git a/default/hypr/apps/omarchy-shell.lua b/default/hypr/apps/omarchy-shell.lua index 2623aab9..76576db6 100644 --- a/default/hypr/apps/omarchy-shell.lua +++ b/default/hypr/apps/omarchy-shell.lua @@ -13,3 +13,8 @@ hl.layer_rule({ match = { namespace = "omarchy-image-selector" }, no_anim = true hl.window_rule({ match = { class = "^org.quickshell$", title = "^Omarchy Settings$" }, float = true }) hl.window_rule({ match = { class = "^org.quickshell$", title = "^Omarchy Settings$" }, center = true }) hl.window_rule({ match = { class = "^org.quickshell$", title = "^Omarchy Settings$" }, size = { 960, 700 } }) + +-- Per-widget settings dialog opens as a smaller FloatingWindow off the +-- settings panel; keep it floating with its own default size. +hl.window_rule({ match = { class = "^org.quickshell$", title = "^Widget settings " }, float = true }) +hl.window_rule({ match = { class = "^org.quickshell$", title = "^Widget settings " }, size = { 380, 320 } }) diff --git a/default/quickshell/omarchy-shell/README.md b/default/quickshell/omarchy-shell/README.md index 1c40b759..947af156 100644 --- a/default/quickshell/omarchy-shell/README.md +++ b/default/quickshell/omarchy-shell/README.md @@ -72,6 +72,7 @@ Supported `kinds`: | `overlay` | A fullscreen overlay (e.g. background switcher) | | `menu` | A summoned menu surface | | `service` | A headless singleton, no UI | +| `bar` | Reserved for the first-party bar host (`omarchy.bar`). Third-party plugins should ship `bar-widget`s; they do not replace the host bar. | `activation` is either `persistent` (loaded on startup, never unloaded) or `on-demand` (loaded by `shell summon ` and unloaded by `shell hide`).