From 0dd91106e7bd80558150a1a0409fcd545d1a906c Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Thu, 21 May 2026 11:55:26 -0400 Subject: [PATCH] omarchy-first-run: run setup-user first; fix gdk-scale.sh for lua config Two bugs caused fresh users to land without branding files / AI skill symlinks / nautilus extensions / xdg dirs / etc.: 1. install/first-run/gdk-scale.sh sed-edited ~/.config/hypr/monitors.conf, but the lua-based config flow uses ~/.config/hypr/monitors.lua. sed -i on the missing .conf returned non-zero, set -e fired, omarchy-first-run aborted mid-block AFTER deleting ~/.local/state/omarchy/first-run.mode. omarchy-setup-user (called at the bottom of the script, outside the if-block) never ran, so setup-user.done never got written and the per-user defaults (~/.config/omarchy/branding/*, ~/.agents/skills/omarchy, xdg dirs, etc.) never got created. Replace the .conf sed with a call to omarchy-hyprland-monitor-scaling which already knows how to persist into monitors.lua. 2. Move 'omarchy-setup-user || true' to the TOP of omarchy-first-run, before the privileged first-run block. setup-user is idempotent and gated on its own marker, so running it first is safe and means a failure in any of the privileged steps can't prevent user setup from completing. --- bin/omarchy-first-run | 10 ++++++---- install/first-run/gdk-scale.sh | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/omarchy-first-run b/bin/omarchy-first-run index dc800baf..db885b67 100755 --- a/bin/omarchy-first-run +++ b/bin/omarchy-first-run @@ -5,6 +5,12 @@ set -e +# Run user-level setup FIRST so its outcome (→ branding files, AI skill +# symlinks, xdg dirs, etc.) isn't held hostage to whether one of the +# privileged first-run steps below aborts under set -e. omarchy-setup-user +# is idempotent and gated on its own marker. +omarchy-setup-user || true + FIRST_RUN_MODE=~/.local/state/omarchy/first-run.mode if [[ -f $FIRST_RUN_MODE ]]; then @@ -23,7 +29,3 @@ if [[ -f $FIRST_RUN_MODE ]]; then bash "$OMARCHY_PATH/install/first-run/welcome.sh" bash "$OMARCHY_PATH/install/first-run/wifi.sh" fi - -# omarchy-setup-user is idempotent (gated on its own marker), so this is -# safe to call on every invocation — it'll no-op once user setup is done. -omarchy-setup-user || true diff --git a/install/first-run/gdk-scale.sh b/install/first-run/gdk-scale.sh index ee42e4a4..0da4a7d6 100644 --- a/install/first-run/gdk-scale.sh +++ b/install/first-run/gdk-scale.sh @@ -1,4 +1,8 @@ -# Set the default GDK_SCALE from what the monitor is currently reporting - -scale=$(omarchy-hyprland-monitor-scaling) -sed -i -E "s|^local omarchy_gdk_scale = .*|local omarchy_gdk_scale = ${scale}|" "$HOME/.config/hypr/monitors.lua" +# Persist the detected monitor scale (and matching GDK_SCALE) into +# ~/.config/hypr/monitors.lua. omarchy-hyprland-monitor-scaling with no args +# returns the closest preset to whatever Hyprland chose at startup; passing +# that value back in updates both `omarchy_monitor_scale` and +# `omarchy_gdk_scale` in the lua config so the choice survives a reboot. +scale=$(omarchy-hyprland-monitor-scaling 2>/dev/null || true) +[[ -n $scale ]] || exit 0 +omarchy-hyprland-monitor-scaling "$scale" >/dev/null 2>&1 || true