diff --git a/bin/omarchy-plugin-enable b/bin/omarchy-plugin-enable index ece1283d82e5..eacabf68393d 100755 --- a/bin/omarchy-plugin-enable +++ b/bin/omarchy-plugin-enable @@ -82,7 +82,9 @@ placement=$(jq -cn \ + (if $after == "" then {} else {after: $after} end) ') -result=$(omarchy-shell shell enablePlugin "$id" "$placement") +# Enabling usually follows a plugin add or change, and the reload that sets off +# can hold the shell past omarchy-shell's 2s default. +result=$(OMARCHY_SHELL_IPC_TIMEOUT=${OMARCHY_SHELL_IPC_TIMEOUT:-10s} omarchy-shell shell enablePlugin "$id" "$placement") if [[ $result == "unknown" ]]; then fail "plugin '$id' is not known; run: omarchy-shell shell rescanPlugins" elif [[ $result != "ok" ]]; then diff --git a/test/shell.d/plugin-enable-test.sh b/test/shell.d/plugin-enable-test.sh index 48872522e63f..17799f8b4e70 100644 --- a/test/shell.d/plugin-enable-test.sh +++ b/test/shell.d/plugin-enable-test.sh @@ -12,6 +12,7 @@ calls="$TMPDIR/calls" cat >"$TMPDIR/bin/omarchy-shell" <<'SH' #!/bin/bash printf '%s\n' "$*" >>"$OMARCHY_TEST_CALLS" +printf '%s\n' "${OMARCHY_SHELL_IPC_TIMEOUT:-}" >>"$OMARCHY_TEST_CALLS.timeout" printf 'ok\n' SH chmod +x "$TMPDIR/bin/omarchy-shell" @@ -20,6 +21,7 @@ run_enable() { HOME="$TMPDIR/home" \ OMARCHY_PATH="$ROOT" \ OMARCHY_TEST_CALLS="$calls" \ + OMARCHY_SHELL_IPC_TIMEOUT="${IPC_TIMEOUT:-}" \ PATH="$TMPDIR/bin:$ROOT/bin:$PATH" \ omarchy-plugin-enable "$@" } @@ -39,6 +41,13 @@ grep -Fqx 'shell enablePlugin omarchy.dropbox {}' "$calls" || fail "plugin enable did not use manifest-default placement" pass "plugin enable leaves default placement to the registry" +[[ $(tail -n1 "$calls.timeout") == "10s" ]] || + fail "plugin enable gave the shell only the default IPC timeout" +IPC_TIMEOUT=3s run_enable omarchy.dropbox >/dev/null +[[ $(tail -n1 "$calls.timeout") == "3s" ]] || + fail "plugin enable overrode an explicit IPC timeout" +pass "plugin enable gives the shell 10s unless told otherwise" + if run_enable omarchy.bar --section right >/dev/null 2>&1; then fail "plugin enable accepted placement for a full bar" fi