From 88477d849770561382157667e8d804e3ed8addfc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Feb 2023 11:52:47 -0500 Subject: [PATCH] use bash procsub --- .local/bin/remapd | 8 +++----- .local/bin/remaps | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.local/bin/remapd b/.local/bin/remapd index 14ae239..ee4cf39 100755 --- a/.local/bin/remapd +++ b/.local/bin/remapd @@ -1,10 +1,8 @@ -#!/bin/sh +#!/bin/bash # Rerun the remaps script whenever a new input device is added. while :; do - udevadm monitor -u -t seat -s input -s usb | grep --line-buffer -m1 -P '[^un]bind' - sleep 1 - remaps us:dvorak + remaps + grep -qP -m1 '[^un]bind.+\/[^:]+\(usb\)' <(udevadm monitor -u -t seat -s input -s usb) done - diff --git a/.local/bin/remaps b/.local/bin/remaps index c95ac84..6d7d54e 100755 --- a/.local/bin/remaps +++ b/.local/bin/remaps @@ -8,4 +8,4 @@ setxkbmap -option caps:super,altwin:menu_win # When caps lock is pressed only once, treat it as escape. killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' # Turn off caps lock if on since there is no longer a key for it. -xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock +xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock