3 616e27e6 2022-07-29 op Switches the mice and keyboard back and forth from my custom setup to a
10 616e27e6 2022-07-29 op btn1=$(xmodmap -pp | awk '/ 1 / {print $2}')
11 616e27e6 2022-07-29 op if [ "$btn1" = 3 ]; then # switch to dx mouse + us
12 616e27e6 2022-07-29 op xmodmap -e 'pointer = 1 2 3'
14 616e27e6 2022-07-29 op else # switch to sx mouse + dvp-eu
15 616e27e6 2022-07-29 op xmodmap -e 'pointer = 3 2 1'
16 616e27e6 2022-07-29 op grep ^setxkbmap ~/.xsession | sh
19 616e27e6 2022-07-29 op cwm sometime needs an "encouragement" when switching keyboard layout.
21 616e27e6 2022-07-29 op pkill -HUP cwm || true