Files

22 lines
924 B
Bash
Executable File

#!/usr/bin/env bash
# X11 native grabs under the rig's Xwayland; portal actions need real Hyprland.
set -euo pipefail
command -v xdotool >/dev/null || { echo "Install xdotool to inject X11 hotkeys" >&2; exit 127; }
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cargo build --locked -p clipbin-core --example hotkeys --manifest-path "${repo}/Cargo.toml"
export CLIPBIN_HOTKEY_REPO="${repo}"
"${repo}/scripts/rig/headless.sh" --x11 bash <<'INNER'
set -euo pipefail
log="${CLIPBIN_RIG_DIR}/hotkeys.log"
env -u WAYLAND_DISPLAY "${CLIPBIN_HOTKEY_REPO}/target/debug/examples/hotkeys" > "${log}" 2>&1 & helper=$!
trap 'kill "${helper}" 2>/dev/null || true' EXIT
sleep 2
swaymsg '[title="clipbin-test-game"] focus' > /dev/null
xdotool key ctrl+shift+F9
sleep 0.3
xdotool key ctrl+shift+F10
if ! wait "${helper}"; then cat "${log}"; exit 1; fi
cat "${log}"
grep -q 'PASS native clip and bookmark hotkeys' "${log}"
INNER