From 701ef5a7f74606cfad5dec71187b22260a510e8c Mon Sep 17 00:00:00 2001 From: MineralwaterXu Date: Wed, 9 Dec 2020 23:14:02 +0800 Subject: get the id of Logitech MX Anywhere 2S and change the mapping --- setxmodmap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setxmodmap.sh b/setxmodmap.sh index 27a1efc..d8359d1 100755 --- a/setxmodmap.sh +++ b/setxmodmap.sh @@ -1,4 +1,6 @@ #!/bin/bash setxkbmap us -option -option caps:swapescape -xinput set-button-map 13 1 2 3 4 5 2 2 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +for id in $(xinput list | grep 'Logitech MX Anywhere 2S' | grep pointer | cut -d '=' -f 2 | cut -f 1); + do xinput --set-button-map $id 1 2 3 4 5 2 2 7 8 9 10 11 12 13 14 15 16 17 18 19 20; +done -- cgit v1.2.1