From aa5c4beb50af71e387890f3169dbcdebe5ca4129 Mon Sep 17 00:00:00 2001 From: Spencer Bull Date: Mon, 21 Sep 2026 19:33:42 -0500 Subject: [PATCH] Re-point the Elsewhen link stranded by the package's move The 2026-09-19 revision of this migration, and a symlink then shipped under config/, pointed every install's ~/.config/omarchy/plugins/omacom.elsewhen at /usr/share/omarchy/plugins/omacom.elsewhen. elsewhen 1.0.0-2 moved to shell/plugins, so the link dangles, the shell lists the plugin as enabled but never loads it, and the bar carries an empty slot. The migration kept any existing link, resolving or not, so a rerun could not repair it. A link into /usr/share/omarchy that no longer resolves is Omarchy's own and is re-pointed; a link the user made is still left alone. --- migrations/1789581661.sh | 9 ++++++++- test/shell.d/elsewhen-default-migration-test.sh | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/migrations/1789581661.sh b/migrations/1789581661.sh index cc881c26..8dce1c3e 100644 --- a/migrations/1789581661.sh +++ b/migrations/1789581661.sh @@ -2,9 +2,16 @@ echo "Install Elsewhen, the world clock plugin" omarchy-pkg-add elsewhen -# Dev checkouts do not contain plugins installed by system packages. packaged_plugin="/usr/share/omarchy/shell/plugins/omacom.elsewhen" user_plugin="$HOME/.config/omarchy/plugins/omacom.elsewhen" + +# The package moved from plugins/ to shell/plugins/ once, stranding the link an +# earlier run made to the old path. A link the user made is left alone. +if [[ -L $user_plugin && ! -e $user_plugin && $(readlink "$user_plugin") == /usr/share/omarchy/* && -d $packaged_plugin ]]; then + ln -sfn "$packaged_plugin" "$user_plugin" +fi + +# Dev checkouts do not contain plugins installed by system packages. if [[ ! $OMARCHY_PATH -ef /usr/share/omarchy && -d $packaged_plugin && ! -e $user_plugin && ! -L $user_plugin ]]; then mkdir -p "${user_plugin%/*}" ln -s "$packaged_plugin" "$user_plugin" diff --git a/test/shell.d/elsewhen-default-migration-test.sh b/test/shell.d/elsewhen-default-migration-test.sh index 2775e1bb..78dc69a9 100644 --- a/test/shell.d/elsewhen-default-migration-test.sh +++ b/test/shell.d/elsewhen-default-migration-test.sh @@ -90,6 +90,16 @@ run_migration "$ROOT" [[ $(readlink "$plugin") == "$test_dir/custom-plugin" ]] || fail "existing symlink is preserved" pass "existing symlink is preserved, including a missing target" +# An earlier revision, and a symlink once shipped under config/, pointed every +# install at the package's old path. +for tree in "$ROOT" "$test_dir/packaged"; do + ln -sfn "$test_dir/packaged/plugins/omacom.elsewhen" "$plugin" + run_migration "$tree" + [[ $(readlink "$plugin") == "$test_dir/packaged/shell/plugins/omacom.elsewhen" ]] || + fail "a stranded link to the package's old path is re-pointed (OMARCHY_PATH=$tree)" "$(readlink "$plugin")" +done +pass "a stranded link to the package's old path is re-pointed on every install" +rm "$plugin" if env TEST_PUT_RESULT=unknown HOME="$test_dir/home" OMARCHY_PATH="$ROOT" PATH="$test_dir/bin:$ROOT/bin:$PATH" \ bash -euo pipefail "$test_dir/migration.sh" >"$test_dir/output" 2>&1; then