Need to copy configs from $OMARCHY_PATH so it'll work with the dev link

This commit is contained in:
David Heinemeier Hansson
2026-06-22 18:30:16 +02:00
parent 383423036f
commit 62ada9e9ec
4 changed files with 47 additions and 7 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ To copy a default config to user config with automatic backup:
omarchy-refresh-config hypr/hyprlock.conf omarchy-refresh-config hypr/hyprlock.conf
``` ```
This copies `/etc/skel/.config/hypr/hyprlock.conf` to `~/.config/hypr/hyprlock.conf`. This copies `$OMARCHY_PATH/config/hypr/hyprlock.conf` to `~/.config/hypr/hyprlock.conf`.
# Migrations # Migrations
+3 -3
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# omarchy:summary=Copy a shipped user config from /etc/skel/.config into ~/.config (backs up your version). # omarchy:summary=Copy a shipped user config from $OMARCHY_PATH/config into ~/.config (backs up your version).
# omarchy:args=<config-path> # omarchy:args=<config-path>
config_file=${1:-} config_file=${1:-}
@@ -10,7 +10,7 @@ if [[ -z $config_file ]]; then
Usage: $0 [config_file] Usage: $0 [config_file]
Must provide a file path relative to .config to be refreshed. Must provide a file path relative to .config to be refreshed.
To copy /etc/skel/.config/hypr/hyprland.lua to ~/.config/hypr/hyprland.lua: To copy $OMARCHY_PATH/config/hypr/hyprland.lua to ~/.config/hypr/hyprland.lua:
$0 hypr/hyprland.lua $0 hypr/hyprland.lua
USAGE USAGE
@@ -18,7 +18,7 @@ USAGE
fi fi
user_config_file="${HOME}/.config/$config_file" user_config_file="${HOME}/.config/$config_file"
default_config_file="/etc/skel/.config/$config_file" default_config_file="$OMARCHY_PATH/config/$config_file"
backup_config_file="$user_config_file.bak.$(date +%s)" backup_config_file="$user_config_file.bak.$(date +%s)"
if [[ ! -e $default_config_file ]]; then if [[ ! -e $default_config_file ]]; then
+3 -3
View File
@@ -58,7 +58,7 @@ This directory contains Omarchy's source files managed by git. Any changes will
**Reading `/usr/share/omarchy/` is SAFE and useful** - do it freely to: **Reading `/usr/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)` - Understand how omarchy commands work: `omarchy theme set --help` or `cat $(which omarchy-theme-set)`
- See default configs before customizing: `cat /usr/share/omarchy/config/omarchy/shell.json` - See default configs before customizing: `cat "$OMARCHY_PATH/config/omarchy/shell.json"`
- Check stock theme files to copy for customization - Check stock theme files to copy for customization
- Reference default hyprland settings: `cat /usr/share/omarchy/default/hypr/*` - Reference default hyprland settings: `cat /usr/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[] ~/.config/omarchy/shell.json # User overrides: bar.position, bar.layout, plugins[]
/usr/share/omarchy/config/omarchy/shell.json # Canonical defaults $OMARCHY_PATH/config/omarchy/shell.json # Canonical defaults
``` ```
The shell hot-reloads `shell.json` on save — no restart needed for layout The shell hot-reloads `shell.json` on save — no restart needed for layout
@@ -243,7 +243,7 @@ omarchy refresh hyprland
# The refresh command: # The refresh command:
# 1. Backs up current config with timestamp # 1. Backs up current config with timestamp
# 2. Copies default from /usr/share/omarchy/config/ # 2. Copies default from $OMARCHY_PATH/config/
# 3. Restarts the component # 3. Restarts the component
``` ```
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
home="$tmpdir/home"
omarchy_path="$tmpdir/omarchy"
mkdir -p "$home/.config/hypr" "$omarchy_path/config/hypr"
cat >"$omarchy_path/config/hypr/bindings.lua" <<'EOF'
-- refreshed from OMARCHY_PATH
EOF
cat >"$home/.config/hypr/bindings.lua" <<'EOF'
-- existing user config
EOF
HOME="$home" OMARCHY_PATH="$omarchy_path" "$ROOT/bin/omarchy-refresh-config" hypr/bindings.lua >/dev/null
cmp -s "$omarchy_path/config/hypr/bindings.lua" "$home/.config/hypr/bindings.lua" ||
fail "refresh-config copies from OMARCHY_PATH/config"
backup=$(find "$home/.config/hypr" -name 'bindings.lua.bak.*' -print -quit)
[[ -n $backup ]] || fail "refresh-config backs up replaced user config"
grep -Fq -- '-- existing user config' "$backup" ||
fail "refresh-config backup contains previous user config"
pass "refresh-config copies from OMARCHY_PATH/config and backs up existing files"
if HOME="$home" OMARCHY_PATH="$omarchy_path" "$ROOT/bin/omarchy-refresh-config" hypr/missing.lua >"$tmpdir/out" 2>"$tmpdir/err"; then
fail "refresh-config rejects configs missing from OMARCHY_PATH/config"
fi
grep -Fq 'Not a shipped user config: hypr/missing.lua' "$tmpdir/err" ||
fail "refresh-config reports missing shipped config"
pass "refresh-config validates against OMARCHY_PATH/config"