Files
clipbin-desktop/scripts/rig/keys.sh
T
harry 178c400eeb
Rust checks / windows-cross-check (push) Successful in 1m6s
Rust checks / linux (push) Failing after 5m44s
fix: share reliable virtual key delivery across Linux rigs
2026-10-08 19:38:35 +02:00

15 lines
614 B
Bash

#!/usr/bin/env bash
# Source inside the headless rig; accepts a key and an optional modifier.
rig_key() {
local key="$1" modifier="${2:-}"
# Destroying rig-pointer's virtual seat can clear keyboard focus in Sway.
swaymsg '[app_id="dev.clipbin.Clipbin"] focus' >/dev/null
sleep .2
# Let the virtual keymap settle, then hold the key through a UI dispatch.
local args=(-s 200)
if [[ -n "${modifier}" ]]; then args+=(-M "${modifier}" -s 100); fi
args+=(-P "${key}" -s 100 -p "${key}")
if [[ -n "${modifier}" ]]; then args+=(-m "${modifier}"); fi
timeout 10 wtype "${args[@]}"
}