#!/bin/bash set -euo pipefail source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" test_tmp=$(mktemp -d) trap 'rm -rf "$test_tmp"' EXIT mock_bin="$test_tmp/bin" mkdir -p "$mock_bin" cat >"$mock_bin/hyprctl" <<'SH' #!/bin/bash if [[ $1 == "clients" ]]; then printf '[{"address":"0xabc","class":"chromium"}]\n' elif [[ $1 == "dispatch" ]]; then printf '%s\n' "$2" >"$OMARCHY_TEST_FOCUS_DISPATCH" fi SH chmod +x "$mock_bin/hyprctl" dispatch_log="$test_tmp/dispatch" PATH="$mock_bin:$PATH" OMARCHY_TEST_FOCUS_DISPATCH="$dispatch_log" \ bash "$ROOT/bin/omarchy-hyprland-focus-app" chromium grep -F 'hl.dsp.focus({ window = "address:0xabc" })' "$dispatch_log" >/dev/null || \ fail "app focus uses the workspace-aware Hyprland dispatcher" pass "app focus follows windows across workspaces"