summaryrefslogtreecommitdiff
path: root/bin/.local/bin/keyboard
blob: 3bf410d8128c7f126d265ede5c9386927623727e (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash

# Key repeat rate
xset r rate 400 50

# Kill xcape
# ('pgrep -l xcape' can be used to list the processes)
pkill xcape

# Compose key on left control
# https://vi.stackexchange.com/questions/2254/what-is-the-easiest-way-to-insert-unicode-characters-into-a-document
setxkbmap -option compose:ralt

# Dvorak programer
setxkbmap us -variant dvp

# Make Control_L and 'key 94' (Mode_switch, Multi_key)
# https://unix.stackexchange.com/questions/55076/what-is-the-mode-switch-modifier-for
xmodmap -e "remove Control = Control_L"
xmodmap -e "keycode 94 = Mode_switch"
xmodmap -e "keysym Control_L = Mode_switch"
xcape -e 'Mode_switch=Multi_key'

# Make Caps_Lock (Control_L, Escape)
xmodmap -e "clear Lock"
xmodmap -e "keysym Caps_Lock = Control_L Control_L"
xmodmap -e "add Control = Control_L"
xcape -e 'Control_L=Escape'

# Set Caps_Lock on escape
xmodmap -e "keysym Print = Print Caps_Lock"
xmodmap -e "add Lock = Caps_Lock"

# Make Shift (Shift, :) (for vim)
xcape -e 'Shift_L=Shift_L|semicolon'

# Make Tab (Alt_L, Tab)
# xmodmap -e "keysym Tab = Alt_L"
# xmodmap -e "keycode any = Tab"
# xcape -e 'Alt_L=Tab'

# Make space (Super_L, space)
xmodmap -e "keysym space = Super_L"
xmodmap -e "add mod4 = Super_L"
xmodmap -e "keycode any = space"
xcape -e 'Super_L=space'

# Make return (Control_R, Return)
# xmodmap -e "keysym Return = Control_R"
# xmodmap -e "add Control = Control_R"
# xmodmap -e "keycode any = Return"
# xcape -e 'Control_R=Return'

# Make eject and Home an Insert
xmodmap -e "keysym XF86Eject = Insert"
xmodmap -e "keysym Home = Insert"
xmodmap -e "keysym End = Caps_Lock"

# Numbers
xmodmap -e "keysym d = d D 0"
xmodmap -e "keysym m = m M 1"
xmodmap -e "keysym w = w W 2"
xmodmap -e "keysym v = v V 3"
xmodmap -e "keysym h = h H 4"
xmodmap -e "keysym t = t T 5"
xmodmap -e "keysym n = n N 6"
xmodmap -e "keysym g = g G 7"
xmodmap -e "keysym c = c C 8"
xmodmap -e "keysym r = r R 9"