diff --git a/shell/plugins/panels/elsewhen/Panel.qml b/shell/plugins/panels/elsewhen/Panel.qml index 74ebbf0a..8c01bb71 100644 --- a/shell/plugins/panels/elsewhen/Panel.qml +++ b/shell/plugins/panels/elsewhen/Panel.qml @@ -616,7 +616,7 @@ Panel { onTriggered: root.refresh() } - IpcHandler { + ShellIpc { target: root.ipcTarget function open(): void { root.open() } function close(): void { root.close() } diff --git a/test/shell.d/base-test.sh b/test/shell.d/base-test.sh index 670ec82d..476b8f83 100644 --- a/test/shell.d/base-test.sh +++ b/test/shell.d/base-test.sh @@ -27,6 +27,15 @@ fail() { exit 1 } +# The IPC socket a shell running an OMARCHY_PATH's config on this display +# serves, derived as omarchy-shell derives it. A test that starts the real +# shell removes it afterwards: killing the shell leaves the file behind. +shell_ipc_socket() { + local id + id=$(printf '%s\n%s' "$1/shell" "${WAYLAND_DISPLAY:-}" | md5sum) + printf '%s/omarchy-shell-%s.sock\n' "${XDG_RUNTIME_DIR:-/run/user/$UID}" "${id:0:16}" +} + require_command() { local command="$1" diff --git a/test/shell.d/runtime-smoke-test.sh b/test/shell.d/runtime-smoke-test.sh index c487eea2..db61f740 100755 --- a/test/shell.d/runtime-smoke-test.sh +++ b/test/shell.d/runtime-smoke-test.sh @@ -12,6 +12,7 @@ cleanup() { kill "$QS_PID" 2>/dev/null || true wait "$QS_PID" 2>/dev/null || true fi + [[ -n ${test_root:-} ]] && rm -f "$(shell_ipc_socket "$test_root")" [[ -n $TMPDIR && -d $TMPDIR ]] && rm -rf "$TMPDIR" return 0 } diff --git a/test/shell.d/screenshot-sanity-test.sh b/test/shell.d/screenshot-sanity-test.sh index d5775fa2..beb6009d 100755 --- a/test/shell.d/screenshot-sanity-test.sh +++ b/test/shell.d/screenshot-sanity-test.sh @@ -12,6 +12,7 @@ cleanup() { kill "$QS_PID" 2>/dev/null || true wait "$QS_PID" 2>/dev/null || true fi + [[ -n ${test_root:-} ]] && rm -f "$(shell_ipc_socket "$test_root")" if [[ -n $TMPDIR && -d $TMPDIR ]]; then rm -rf "$TMPDIR" fi diff --git a/test/shell.d/shell-ipc-socket-test.sh b/test/shell.d/shell-ipc-socket-test.sh index 5e3877a0..5c4937fc 100644 --- a/test/shell.d/shell-ipc-socket-test.sh +++ b/test/shell.d/shell-ipc-socket-test.sh @@ -22,8 +22,7 @@ touch "$root_dir/shell/shell.qml" # The shell names its socket after its config and display, as omarchy-shell # derives it. display="test-display" -socket_id=$(printf '%s\n%s' "$root_dir/shell" "$display" | md5sum) -socket="$run_dir/omarchy-shell-${socket_id:0:16}.sock" +socket=$(XDG_RUNTIME_DIR="$run_dir" WAYLAND_DISPLAY="$display" shell_ipc_socket "$root_dir") # qs is the fallback: it records that it ran and answers. cat >"$stub_bin/qs" <<'SH'