-
Notifications
You must be signed in to change notification settings - Fork 1
/
login_input
executable file
·54 lines (47 loc) · 1.93 KB
/
login_input
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# allow two-finger and edge scrolling vertically and horizontally:
#xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Edge Scrolling" 1 1 0
#xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 1
#xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Scrolling Distance" 86 120
# disable tapping completely:
#xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 0 0 0 0 0 0
#xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Click Action" 0 0 0
# set keyboard map (effect on login is to allow switching):
#model is logitech_g15 or thinkpad60
# updates seem to be missed without piping to xkbcomp
setxkbmap -layout cyborg16,ch\
-variant colemak4_ch,de\
-option grp:sclk_toggle,grp_led:caps,compose:menu,compose:prsc\
-model pc105\
# -print | xkbcomp - $DISPLAY
#,lv3:rwin_switch,lv3:ralt_switch
# swap page up/down and home/end on new thinkpad
# TODO: this really the ID for the new Thinkpad keyboard (~2013)?
DEVICE=$(xinput list | egrep 'AT Translated Set 2 keyboard' | egrep 'id=[0-9]+' -o | cut -d= -f2)
if [ ! "x$DEVICE" = x ]; then
#TODO: can the model not affect these keys?
# echo "Swapping page up/down with home/end on device $DEVICE"
# setxkbmap -device $DEVICE -model swap_pgupdn_homeend
echo -n "";
fi
# enable key repeat on capslock (still needs to be done repeatedly?)
xset r 66
#while true; do xset r 66; sleep 5; done &
if [ -f ~/.Xmodmap ]
then
xmodmap ~/.Xmodmap
fi
if [ -f ~/.xbindkeysrc ]
then
killall xbindkeys
xbindkeys
fi
#Logitech G9 horiz scrolling:
# Note: Can't use string ID because we have two identical strings. Do a bit of
# jiggery-pokery instead to get a numerical ID.
G9ID="$(xinput --list --long | egrep "Buttons supported: 24" -B3 | egrep "Logitech G9" | cut -f2 | cut -d= -f2)"
if [ -n "$G9ID" ]
then
# found the G9 with the correct number of buttons; do mapping:
xinput set-button-map "$G9ID" 1 2 3 4 5 11 12 8 9 10 6 7
fi