From: Ian Kelling Date: Fri, 9 Sep 2016 21:42:14 +0000 (-0700) Subject: input-setup dependency to git X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=431c65df440c854db2aa154a38fe6e33428d98c7 input-setup dependency to git --- diff --git a/desktop-20-autostart.sh b/desktop-20-autostart.sh index 66b7607..dd4d9a8 100755 --- a/desktop-20-autostart.sh +++ b/desktop-20-autostart.sh @@ -31,7 +31,7 @@ elif (( x == 2 )); then --output $middle --mode 2560x1600 --pos 1600x0 --rotate left fi -/a/bin/input-setup.sh +/a/bin/distro-setup/input-setup if isarch; then pulseaudio --start fi diff --git a/distro-begin b/distro-begin index 921464c..3997217 100755 --- a/distro-begin +++ b/distro-begin @@ -135,15 +135,14 @@ fi install-myqueue if iank-dev; then - desktop=$(ssh root@iankelling.org grep desktop /etc/hosts | grep -o "^.* ") + desktop=DESKTOP_DOMAIN # TODO, broken. rethink this next time it's used if $bootstrapfs; then - # for bootstrapping at a new job: + # TODO: broken. need to copy files in this directory too, probably rethink this. cp="scp $desktop:" # for moving to a new hd, change $cp to move between filesystems mkdir -p /a/bin chown -R ian:ian /a # probably needs to be removed $cp/a/c /a - $cp/a/c/bin/{bash-programs-by-ian,distro-begin,distro-functions,input-setup.sh} /a/bin echo -e \\n\\n\\n | ssh-keygen -t rsa fi fi diff --git a/input-setup b/input-setup new file mode 100755 index 0000000..6744451 --- /dev/null +++ b/input-setup @@ -0,0 +1,120 @@ +#!/bin/bash -l +#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" +} +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" +} +set_device_id() { + if device_id=$(xinput --list | grep -m 1 "$1"); then + device_id=${device_id##*id=} + device_id=${device_id%%[[:space:]]*} + else + return 1 + fi +} + +case $HOSTNAME in + treetowl*|iank-dev|frodo) + # todo, differentiate for work pc + #/a/bin/radl + if [[ -z $DISPLAY ]]; then + echo "error. empty DISPLAY var" >> /a/gdm-keyboard-error.log + else + xkbcomp /a/c/.Xkeymap $DISPLAY + + xkbset m # setup mouse keys, which I have altered + + xkbset exp =m # stop mousekeys expiring after a timeout + + xset r rate 200 13 # decrease rate delay + xbindkeys # configured to grab left and right scroll button presses + fi + + + #right scroll wheel, change from button 4 & 5 to 13 and 14. + # also changes the middle click to 12, even though I'm not using it anymore + if set_device_id "04d9:048e"; then + xinput --set-button-map "$device_id" 1 12 3 13 14 6 7 + fi + + ms 'Kensington Kensington Slimblade Trackball' 100 4000/1 7 6.5 1.5 + xinput --set-button-map 'Kensington Kensington Slimblade Trackball' 0 0 0 4 5 6 7 0 9 10 11 12 + + # 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 of my mouse-wheel only mouse + if set_device_id "USB Optical Mouse"; then + xinput --set-prop "$device_id" 'Device Accel Constant Deceleration' 10000 + # 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*) + ;; +esac + +# for desktop and htpc +set_device_id "Logitech Unifying Device" +xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1 + + +#ms 'Kensington Kensington Slimblade Trackball' 1 7/2 2 4 5 = 2.01 +# ms 9 10 20/1 6 4 .2 +#ms 9 10 35/1 6 5 .2 = 1.82 +#ms 9 10 1200/1 7 5 .2 = 1.82 after a practice round +# +#ms 9 10 140/1 6 7 .1 = 2.0 after a practice round. +#feels like the slow is finally too slow, and fast too fast +# ms 9 10 50/1 6 6 .2 = 1.83 after +# ms 9 10 90/1 6 6 .1 = 1.86 +#ms 9 10 3000/1 7 6 .1 = 1.81 +#ms 9 1 15/1 3 6 3 = 2.0 +#ms 9 1 10/1 3 4 2 = 1.91 +#ms 9 1 8/1 3 5 4 = 1.98 +#ms 9 1 10/2 2 5 2.5 = 1.99 +#ms 9 100 3000/1 7 5 1 = 1.86 +#ms 9 100 1500/1 7 5 1.5 = 1.87 +#ms 9 100 2200/1 7 6 1.5 = 1.81 +#ms 9 100 2200/1 7 5 1.5 = 1.83 +#ms 9 100 3000/1 7 6 1.5 = 1.88 +#ms 9 1 100/1 4 6 15 = 1.85 +#ms 9 100 3000/1 7 7 1.5 = 1.85, but had a 1.76 on first try... +# ms 9 100 3500/1 7 7 1.5 = 1.73, 1.68 a1 1.74, 1.83, 1.75, 1.78, 1.76 +# ms 9 100 4000/1 7 7 1.5 = 1.80 +# ms 9 100 4000/1 7 8 1.5 = 1.78 +# ms 9 100 4000/1 7 8 1.8 = 1.88 +# ms 9 100 4800/1 7 8 1.5 = 1.85 +# ms 9 100 4000/1 7 6.5 1.5 = 1.83. stickig with this, upped speeds a bit to make it more practical for normal windows +# new day +# ms 9 100 3500/1 7 7 1.5 = 1.92 +# ms 9 1 7/2 2 5 5 = 1.9 +# ms 9 100 3500/1 7 7 1.5 = 1.62 +# felt like having it a bit faster for a while, but switched back +#ms 'Kensington Kensington Slimblade Trackball' 100 3500/1 7 5 1.5 + + +#set +x