buster + fixes
[distro-setup] / input-setup
index d3388c62dc73bcd5788752276b5470445c85580b..ba390dad1adf5e2ca5747bf430c5c53c6ba16bfd 100755 (executable)
@@ -17,45 +17,45 @@ set -x
 # set to oppsite if the order is flipped.
 k2flip=true
 if $k2flip; then
-    k2inorder=false
+  k2inorder=false
 else
-    k2inorder=true
+  k2inorder=true
 fi
 
 type=model01
 
 case $1 in
-    l) type=laptop ;;
-    k) type=kinesis ;;
-    m) type=model01 ;;
+  l) type=laptop ;;
+  k) type=kinesis ;;
+  m) type=model01 ;;
 esac
 
 #set -x
 mi() {
-    xinput --get-feedbacks "$1" | grep "threshold"
-    xinput --get-feedbacks "$1" | grep "accelNum\|accelDenom"
-    xinput --list-props "$1" | grep "Device Accel Profile\|Device Accel Constant Deceleration\|Device Accel Velocity Scaling"
+  xinput --get-feedbacks "$1" | grep "threshold"
+  xinput --get-feedbacks "$1" | grep "accelNum\|accelDenom"
+  xinput --list-props "$1" | grep "Device Accel Profile\|Device Accel Constant Deceleration\|Device Accel Velocity Scaling"
 }
 ms() {
-    xinput --set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
-    xinput --set-prop "$1" 'Device Accel Profile'  $4
-    xinput --set-prop "$1" 'Device Accel Constant Deceleration' $5
-    xinput --set-prop "$1" 'Device Accel Velocity Scaling' $6
-    mi "$1"
+  xinput --set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
+  xinput --set-prop "$1" 'Device Accel Profile'  $4
+  xinput --set-prop "$1" 'Device Accel Constant Deceleration' $5
+  xinput --set-prop "$1" 'Device Accel Velocity Scaling' $6
+  mi "$1"
 }
 set_device_id() {
-    if [[ $2 ]] && $2; then
-        cmd="tail -n1"
-    else
-        cmd="head -n1"
-    fi
-    if device_id=$(xinput --list | grep "$1" | $cmd); then
-        device_id=${device_id##*id=}
-        device_id=${device_id%%[[:space:]]*}
-        echo "2:$2 device_id=$device_id"
-    else
-        return 1
-    fi
+  if [[ $2 ]] && $2; then
+    cmd="tail -n1"
+  else
+    cmd="head -n1"
+  fi
+  if device_id=$(xinput --list | grep "$1" | $cmd); then
+    device_id=${device_id##*id=}
+    device_id=${device_id%%[[:space:]]*}
+    echo "2:$2 device_id=$device_id"
+  else
+    return 1
+  fi
 }
 
 # default via xset q is 660 25. (delay for autorepeat, repeat rate)
@@ -63,32 +63,32 @@ set_device_id() {
 xset r rate 400 13 # decrease rate delay
 
 if set_device_id "SteelSeries World of Warcraft MMO Gaming Mouse"; then
-    ms "$device_id" 100 1000/1 7 4 1
+  ms "$device_id" 100 1000/1 7 4 1
 
-    # under the new "improved" libinput, the mouse speed/accel has
-    # changed all around and is much more limited.
-    # Other xinput commands will fail and this will succeed.
-    xinput --set-prop "$device_id" "libinput Accel Speed" '.8'
+  # under the new "improved" libinput, the mouse speed/accel has
+  # changed all around and is much more limited.
+  # Other xinput commands will fail and this will succeed.
+  xinput --set-prop "$device_id" "libinput Accel Speed" '.8'
 fi
 
 # todo, differentiate for work pc
 #/a/bin/radl
 
 case $type in
-    model01)
-        xkbcomp /a/c/model01.xkb $DISPLAY
-        . /a/bin/bash_unpublished/duplicity-gpg-agent-setup
-        ;;
-    laptop)
-       # original saved with: xkbcomp $DISPLAY /a/c/stretch-11-2016.xkb
-       xkbcomp /a/c/x2.xkb $DISPLAY
-
-        ;;
+  model01)
+    # original saved with: xkbcomp $DISPLAY /a/c/flidas-2017-12.xkb
+    xkbcomp /a/c/model01.xkb $DISPLAY
+    . /a/bin/bash_unpublished/duplicity-gpg-agent-setup
+    ;;
+  laptop)
+    xkbcomp /a/c/x2.xkb $DISPLAY
+
+    ;;
 esac
 
 # for desktop and htpc
 if set_device_id "Logitech Unifying Device"; then
-xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
+  xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
 fi