lots of stuff lumped together
[distro-setup] / input-setup
index 9f93cde1f3dc2750951203cd162e8d25a980e5dc..91bede690083f595581a6237530a7768d96b4e93 100755 (executable)
@@ -1,4 +1,30 @@
 #!/bin/bash -l
+# Copyright (C) 2016 Ian Kelling
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+case $HOSTNAME in
+    x2|tp) type=laptop ;;
+    treetowl*|iank-dev|frodo) type=kinesis ;;
+esac
+
+
+
+case $1 in
+    l) type=laptop ;;
+    k) type=kinesis ;;
+esac
+
 #set -x
 mi() {
     xinput --get-feedbacks "$1" | grep "threshold"
@@ -21,12 +47,14 @@ set_device_id() {
     fi
 }
 
-case $HOSTNAME in
-       tp|x2)
-               # original saved with: xkbcomp $DISPLAY /a/c/stretch-9-2016.xkb
-               xkbcomp /a/c/tp.xkb $DISPLAY
-               ;;
-    treetowl*|iank-dev|frodo)
+case $type in
+    laptop)
+       # original saved with: xkbcomp $DISPLAY /a/c/stretch-11-2016.xkb
+       xkbcomp /a/c/x2.xkb $DISPLAY
+        xkbset -m # remove mouse keys
+
+       ;;
+    kinesis)
         # todo, differentiate for work pc
        #/a/bin/radl
         if [[ -z $DISPLAY ]]; then
@@ -39,6 +67,7 @@ case $HOSTNAME 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
             xbindkeys # configured to grab left and right scroll button presses
         fi
 
@@ -75,9 +104,7 @@ case $HOSTNAME in
             # 12 is to effectively disable the middle click button
             xinput --set-button-map "$device_id" 1 12 3 10 11 6 7
         fi
-        /a/bin/bash_unpublished/gpg
-        ;;
-    frodo*)
+        . /a/bin/bash_unpublished/duplicity-gpg-agent-setup
         ;;
 esac