From ad9f509871af878e7fae50de7c9b441d9272c2b6 Mon Sep 17 00:00:00 2001 From: snailed Date: Wed, 13 Dec 2023 14:27:38 +0100 Subject: [PATCH] Improve remapd detection Previously remapd would trigger whenever a USB device was attached. This patch changes that to only trigger the script when the output of `xinput --list` changes. This has the added bonus of making the script posix compliant. --- .local/bin/remapd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/remapd b/.local/bin/remapd index ee4cf396..948fe662 100755 --- a/.local/bin/remapd +++ b/.local/bin/remapd @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # Rerun the remaps script whenever a new input device is added. while :; do remaps - grep -qP -m1 '[^un]bind.+\/[^:]+\(usb\)' <(udevadm monitor -u -t seat -s input -s usb) + watch -n1 -g xinput --list done