From 5329e4a34d75f32370236a095abd57da12bc3d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C4=99dzim=C4=85=C5=BC?= Date: Sat, 26 Sep 2026 07:33:21 +0200 Subject: [PATCH] fix: caps-remap restarts only its own xcape instance pkill -x xcape also killed unrelated xcape instances (e.g. a Super_L tap binding). Match our Hyper_L invocation instead; xcape rewrites its argv so '=' appears as a space. --- x11/caps-remap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x11/caps-remap.sh b/x11/caps-remap.sh index 9bb2f16..437d961 100755 --- a/x11/caps-remap.sh +++ b/x11/caps-remap.sh @@ -41,8 +41,10 @@ xmodmap -e "add Control = Hyper_L" || true # (Re)start xcape. -t 200: taps shorter than 200 ms produce Escape; anything # longer is treated as a Ctrl hold. Raise to 300-500 if taps feel missed. +# Only our own instance is replaced: other tools may run xcape for other keys +# (xcape rewrites its argv in place, so '=' shows up as a space). if command -v xcape >/dev/null 2>&1; then - pkill -x xcape 2>/dev/null || true + pkill -f '^xcape .*-e Hyper_L' 2>/dev/null || true xcape -t 200 -e 'Hyper_L=Escape' else echo "caps-remap: xcape not found - tap-to-Escape will not work" >&2