diff options
author | B. Stack <bgstack15@gmail.com> | 2023-08-04 09:06:41 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-08-04 09:06:41 -0400 |
commit | 416c4e874455cc75ec4b26f0ed2b2c2bd038e49a (patch) | |
tree | 865f41dce54c0f65d5e54298c059301792148aac /kvm-plugged-in.sh | |
parent | initial commit (diff) | |
download | kvm-mapping-416c4e874455cc75ec4b26f0ed2b2c2bd038e49a.tar.gz kvm-mapping-416c4e874455cc75ec4b26f0ed2b2c2bd038e49a.tar.bz2 kvm-mapping-416c4e874455cc75ec4b26f0ed2b2c2bd038e49a.zip |
Diffstat (limited to 'kvm-plugged-in.sh')
-rwxr-xr-x | kvm-plugged-in.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kvm-plugged-in.sh b/kvm-plugged-in.sh index ee1958c..5357909 100755 --- a/kvm-plugged-in.sh +++ b/kvm-plugged-in.sh @@ -7,6 +7,7 @@ # Project: kvm-mapping # Purpose: for vm2, run my keyboard input script. # History: +# 2023-08-04 updated regex to include Logitech K, and a short sleep for it # Usage: # called by kvm-user-daemon.sh when the trigger file is made by the udev rule+script # Reference: @@ -17,7 +18,9 @@ # running in user context, with XAUTHORITY and DISPLAY and probably more env vars # Documentation: # The contents can be whatever you want. On vm2, I want to set my keyboard mappings. -for word in $( xinput list | sed -r -n -e 's/.*USB.*Keyboard.*id=([0-9]+).*keyboard.*/\1/p;' ) ; +sleep 2 +for word in $( xinput list | sed -r -n -e 's/.*(Keyboard|Logitech K[0-9]+).*id=([0-9]+).*keyboard.*/\2/p;' ) ; do setxkbmap -device ${word} -option grp:switch,grp:shifts_toggle -layout 'us,us(dvorak)' done +#notify-send --transient --icon 'keyboard' 'kvm reconnected' 'applied keymaps' |