minor improvements
[distro-setup] / input-setup
index 9cff413c2d4da99c2a1e3450b6af97746dffaa1c..1a762e9f9e1f6cb4ceea75b549ee8289f22b2026 100755 (executable)
@@ -15,16 +15,16 @@ set -x
 # limitations under the License.
 
 # set to oppsite if the order is flipped.
-k2flip=falsesf-
+k2flip=true
 if $k2flip; then
-k2inorder=false
+    k2inorder=false
 else
     k2inorder=true
-    fi
+fi
 
 case $HOSTNAME in
-    x2|tp) type=laptop ;;
-    treetowl*|iank-dev|frodo) type=kinesis ;;
+    some_x200_laptop) type=laptop ;;
+    hosts_with_keyboards_attached) type=kinesis ;;
 esac
 
 
@@ -32,6 +32,7 @@ esac
 case $1 in
     l) type=laptop ;;
     k) type=kinesis ;;
+    m) type=model01 ;;
 esac
 
 #set -x
@@ -62,7 +63,28 @@ set_device_id() {
     fi
 }
 
+# default via xset q is 660 25. (delay for autorepeat, repeat rate)
+# was at 200 13, but while learning to use keyboardio, i hold keys a bit longer sometimes.
+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" 1 7/2 2 2.5 2
+
+    # makes it compatible with what windows sends using synergy
+    # commented out because i never expect to use windows again
+    #xinput --set-button-map "$device_id" 1 2 3 4 5 6 7 6 7 10 11 12 13 14 15
+
+    # 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
+
 case $type in
+    model01)
+        xkbcomp /a/c/model01.xkb $DISPLAY
+        ;;
     laptop)
        # original saved with: xkbcomp $DISPLAY /a/c/stretch-11-2016.xkb
        xkbcomp /a/c/x2.xkb $DISPLAY
@@ -81,7 +103,6 @@ case $type in
 
             xkbset exp =m  # stop mousekeys expiring after a timeout
 
-            xset r rate 200 13 # decrease rate delay
             cd / # so xbindkeys does not hold open mountpoints
             killall xbindkeys # having some lag, thinking this might help.
             xbindkeys # configured to grab left and right scroll button presses
@@ -107,18 +128,6 @@ case $type in
         # razer naga middle mouse stopped working. it's settings were:
         #ms "$device_id" 100 1000/1 7 4 1
 
-        if set_device_id "SteelSeries World of Warcraft MMO Gaming Mouse"; then
-            ms "$device_id" 100 1000/1 7 4 1
-            #ms "$device_id" 1 7/2 2 2.5 2
-
-            # makes it compatible with what windows sends using synergy
-            xinput --set-button-map "$device_id" 1 2 3 4 5 6 7 6 7 10 11 12 13 14 15
-
-            # 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
 
 
         # disable the mouse movements mouse wheel
@@ -141,9 +150,9 @@ case $type in
 esac
 
 # for desktop and htpc
-set_device_id "Logitech Unifying Device"
+if set_device_id "Logitech Unifying Device"; then
 xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
-
+fi
 
 #ms 'Kensington Kensington Slimblade Trackball' 1 7/2 2 4 5 = 2.01
 # ms 9 10 20/1 6 4 .2
@@ -181,3 +190,4 @@ xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
 
 
 #set +x
+exit 0