-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathkarabiner.edn
247 lines (234 loc) · 15.9 KB
/
karabiner.edn
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
{:profiles
{:Default {:default true
:sim 50
:delay 50
:alone 100
:held 50}}
:templates {:alfred "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"
:beep "osascript -e 'beep 1'"
:beep2 "osascript -e 'beep 2'" }
:simlayers {
; :f-mode {:key :f}
; :o-mode {:key :o}
; :h-mode {:key :h}
:q-mode {:key :q}
}
:devices {:apple-internal [{:vendor_id 1452 :product_id 635}]
:filco-bt [{:vendor_id 2652 :product_id 34050}]
:keychron-k12 [{:vendor_id 1452 :product_id 591}]
:keychron-k6-pro [{:vendor_id 13364 :product_id 608}]
; All QMK/ZMK keyboards I own
:lily-58-zmk [{:vendor_id 7504 :product_id 24926}]
:qmk [{:vendor_id 936 :product_id 44545} ; Planck Rev4
{:vendor_id 936 :product_id 42233} ; Planck Rev6
{:vendor_id 936 :product_id 48802} ; Planck Light
{:vendor_id 65261 :product_id 25700} ; Ergodox Infinity
{:vendor_id 7185 :product_id 45133} ; Ergodox Infinity (Macbook)
{:vendor_id 1240 :product_id 60205} ; Lily 58 Pro
{:vendor_id 2007} ; BLKM
;; {:vendor_id 13364 :product_id 608} ; Keychron K6 Pro
]}
:input-sources {:colemak {:input_source_id "org.sil.ukelele.keyboardlayout.com.colemak.dhm.colemakdhm" :language "en"}}
;; :input-sources {:colemak {:input_source_id "org.sil.ukelele.keyboardlayout.colemakdh-ansi.colemakdhm*" :language "en"}}
:main [
; Non QMK Rules (Avoid modifier keys collide with QMK keebs)
{:des "Cmd -> Cmd / Underscore" :rules [:!qmk [:##left_command :left_command nil {:alone :!Shyphen}]]}
{:des "Delete -> F19" :rules [[:condi :!qmk :!lily-58-zmk] [:##delete_or_backspace [:f19]]]}
{:des "ROption -> Option / Cmb+Tab (Colemak)" :rules [:colemak :!qmk :!filco-bt [:##right_option :right_option nil {:held :right_option :alone :!Ctab}]]}
{:des "ROption -> Option / Delete (Filco)" :rules [:colemak :filco-bt [:##right_option :right_option nil {:held :right_option :alone :delete_or_backspace}]]}
; Swap Quotes with Ctrl-Option-Command + '
{:des "Disable Swap Quote" :rules [:!disable-swap-quote [:!CTOquote [{:set ["disable-swap-quote" 1]} [:beep]]]]}
{:des "Enable Swap Quote" :rules [:disable-swap-quote [:!CTOquote [{:set ["disable-swap-quote" 0]} [:beep2]]]]}
{:des "Disable swapping quote" :rules [:colemak :disable-swap-quote [:##quote :quote]]}
{:des "' <-> \" (Colemak)" :rules [:colemak [:quote :!Squote] [:!Squote :quote]]}
; Esc -> Grave on Keychron
{:des "Esc -> Grave" :rules [:keychron-k12 [:##escape :grave_accent_and_tilde]]}
; General
{:des "; <-> : (Colemak)" :rules [:colemak [:p :!Sp] [:!Sp :p]]}
{:des "Swap Option / Command on certain devices" :rules [
[:##left_command :left_option [:filco-bt]]
[:##left_option :left_command [:filco-bt] {:alone :!Shyphen}]]}
{:des "Caps -> Hyper / Esc" :rules [[:##caps_lock :!CTOleft_shift nil {:alone :escape}]]}
{:des "RCmd -> Delete" :rules [[:##right_command :delete_or_backspace]]}
{:des "LShift -> Shift / (" :rules [[:##left_shift :right_shift nil {:held :left_shift :alone :!S9}]]}
{:des "RShift -> Shift / )" :rules [[:##right_shift :left_shift nil {:held :right_shift :alone :!S0}]]}
{:des "LOption -> Option / -" :rules [[:##left_option :left_option nil {:held :left_option :alone :hyphen}]]}
; {:des "F-L -> Delete Word" :rules [:f-mode [:l :!Odelete_or_backspace]]}
; {:des "F-; -> Delete Line" :rules [:f-mode [:semicolon :!Cdelete_or_backspace]]}
; Delete mode with F+J
; {:des "Delete <- F+J" :rules [[{:sim [:f :j]
; :simo {:interrupt true
; :dorder :insensitive
; :uorder :insensitive
; :afterup {:set ["delete-mode" 0]}}} [:delete_or_backspace {:set ["delete-mode" 1]}]]]}
; {:des "Delmode F/J/K -> Delete" :rules [:delete-mode [:f :delete_or_backspace] [:j :delete_or_backspace] [:k :delete_or_backspace]]}
; SuperDuper Mode with S+D (Non-QMK)
{:des "SuperDuper <- S+D" :rules [[:condi :!qmk :!lily-58-zmk] [{:sim [:s :d]
:simo {:interrupt true
:dorder :insensitive
:uorder :insensitive
:afterup {:set ["superduper-mode" 0]}}} {:set ["superduper-mode" 1]}]]}
{:des "A+S+D -> SD+Option" :rules [[:condi :!qmk :!lily-58-zmk] [{:sim [:a :s :d]
:simo {:interrupt true
:dorder :insensitive
:uorder :insensitive
:afterup {:set ["superduper-mode" 0]}}} [{:set ["superduper-mode" 1]} :left_option]]]}
{:des "A+S+D+F-> SD+Option" :rules [[:condi :!qmk :!lily-58-zmk] [{:sim [:a :s :d :f]
:simo {:interrupt true
:dorder :insensitive
:uorder :insensitive
:afterup {:set ["superduper-mode" 0]}}} [{:set ["superduper-mode" 1]} :!Odelete_or_backspace]]]}
{:des "SuperDuper H -> Left" :rules [:superduper-mode [:##h :left_arrow]]}
{:des "SuperDuper J -> Down" :rules [:superduper-mode [:##j :down_arrow]]}
{:des "SuperDuper K -> Up" :rules [:superduper-mode [:##k :up_arrow]]}
{:des "SuperDuper L -> Right" :rules [:superduper-mode [:##l :right_arrow]]}
{:des "SuperDuper F -> Delete" :rules [:superduper-mode [:##f :delete_or_backspace]]}
{:des "SuperDuper ; -> Forward Delete" :rules [:superduper-mode [:##semicolon :delete_forward]]}
{:des "SuperDuper I -> Prev Tab" :rules [:superduper-mode [:##i :!CSopen_bracket]]}
{:des "SuperDuper O -> Next Tab" :rules [:superduper-mode [:##o :!CSclose_bracket]]}
{:des "SuperDuper A -> Option" :rules [:superduper-mode [:##a :left_option]]}
{:des "SuperDuper V -> Shift" :rules [:superduper-mode [:##v :left_shift]]}
{:des "SuperDuper B -> Ctrl+B (Tmux prefix)" :rules [:superduper-mode [:##b :!Tb]]}
{:des "SuperDuper Z -> Undo" :rules [:superduper-mode [:##z :!Cz]]}
; Colemak Mod-DH(m) in standard Colemak
; Commenting this out since I've done changing the layout
; {:des "Disable Mod-DHm" :rules [:!disable-mod-dh [:!CTOq [{:set ["disable-mod-dh" 1]} [:beep]]]]}
; {:des "Enable Mod-DHm" :rules [:disable-mod-dh [:!CTOq [{:set ["disable-mod-dh" 0]} [:beep2]]]]}
; {:des "Colemak Mod-DHm Disabled passthrough" :rules [:colemak :disable-mod-dh
; [:##t :t]
; [:##g :g]
; [:##v :v]
; [:##b :b]
; [:##h :h]
; [:##m :m]
; ]}
; {:des "Colemak Mod-DHm SuperDuper passthrough" :rules [:colemak :superduper-mode
; [:##t :t]
; [:##g :g]
; [:##v :v]
; [:##b :b]
; [:##h :h]
; [:##m :m]
; ]}
; {:des "Colemak Mod-DHm" :rules [:colemak
; [:##t :b] ; G -> B
; [:##g :t] ; D -> G
; [:!Cv :!Cv] ; Keep Cmd + V
; [:##v :g] ; V -> D
; [:!Cb :!Cg] ; Cmd+B -> Cmd+D
; [:##b :v] ; B -> V
; [:##h :m] ; H -> M
; [:##m :h] ; M -> H
; ]}
; H for Hyper
; {:des "H for Hyper" :rules [:h-mode
; [:a :!!a]
; [:b :!!b]
; [:c :!!c]
; [:d :!!d]
; [:e :!!e]
; [:f :!!f]
; [:g :!!g]
; [:i :!!i]
; [:j :!!j]
; [:k :!!k]
; [:l :!!l]
; [:m :!!m]
; [:n :!!n]
; [:o :!!o]
; [:p :!!p]
; [:q :!!q]
; [:r :!!r]
; [:s :!!s]
; [:t :!!t]
; [:u :!!u]
; [:v :!!v]
; [:w :!!w]
; [:x :!!x]
; [:y :!!y]
; [:z :!!z]
; ]}
; Z for Dev Mode
; ,-----------------------------------------------------------------------------------.
; | | | - | + | ( | ) | |
; |------+------+------+------+------+-------------+------+------+------+------+------|
; | N/A | _ | [ | ] | { | } | |
; |------+------+------+------+------+------|------+------+------+------+------+------|
; | | = | | | < | > | ? | |
; |------+------+------+------+------+------+------+------+------+------+------+------
{:des "Q Dev Mode" :rules [:q-mode
[:u :hyphen]
[:i :!Sequal_sign] ; +
[:o :!S9] ; (
[:p :!S0] ; )
[:h :!Shyphen] ; _
[:j :open_bracket]
[:k :close_bracket]
[:l :!Sopen_bracket] ; {
[:semicolon :!Sclose_bracket] ; }
[:n :equal_sign]
[:m :!Sbackslash] ; |
[:comma :!Scomma] ; <
[:period :!Speriod] ; >
[:slash :!Sslash] ; ?
]}
; ThumbSense (rev 3) https://pqrs.org/osx/karabiner/complex_modifications/#thumbsense
{:des "ThumbSense Mode" :rules [[:c :!Cc ["multitouch_extension_finger_count_total" 1]]
[:v :!Cv ["multitouch_extension_finger_count_total" 1]]
[:f {:pkey :button1} ["multitouch_extension_finger_count_total" 1]]
[:j {:pkey :button1} ["multitouch_extension_finger_count_total" 1]]
[:spacebar {:pkey :button1} ["multitouch_extension_finger_count_total" 1]]
[:d {:pkey :button2} ["multitouch_extension_finger_count_total" 1]]
[:k {:pkey :button2} ["multitouch_extension_finger_count_total" 1]]
[:g :!Copen_bracket ["multitouch_extension_finger_count_total" 1]]
[:h :!Cclose_bracket ["multitouch_extension_finger_count_total" 1]]
[:w :!Cw ["multitouch_extension_finger_count_total" 1]]
]}
; Function keys
{:des "Function Keys" :rules [:!apple-internal [:f1 :f1]
[:f2 :f2]
[:f3 :f3]
[:f4 :f4]
[:f5 :f5]
[:f6 :f6]
[:f7 :f7]
[:f8 :f8]
[:f9 :f9]
[:f10 :f10]
[:f11 :f11]
[:f12 :f12] ]}
{:des "Alt + Function Keys -> Media Keys" :rules [:!apple-internal [:!Of1 {:ckey :display_brightness_decrement}]
[:!Of2 {:ckey :display_brightness_increment}]
[:!Of3 :mission_control]
;; [:!Of4 :f4]
;; [:!Of5 :f5]
;; [:!Of6 :f6]
[:!Of7 {:ckey :rewind}]
[:!Of8 {:ckey :play_or_pause}]
;; [:!Of9 {:ckey :fastforward}]
[:!Of10 {:ckey :mute}]
[:!Of11 {:ckey :volume_decrement}]
[:!Of12 {:ckey :volume_increment}] ]}
]
;; code won't read cheatsheet section
;; ! stand for mandatory
;; # stand for optional
;; C T O S for left command control optional shift
;; F for fn
;; need to prefix C T O S F with ! or #
:cheatsheet {:!Ca "command a" ;; mandatory left_command
:!Ta "control a" ;; mandatory left_control
:!Oa "option a"
:!Sa "shift a"
:#Sa "shift a" ;; keycode a, optional left_shift
:!CTOa "command control option a"
:!Cspacebar "command space"
:!Fa "fn a"
:##a "keycode a optional any"
:!!a "mandatory hyper(control command option shift) a "
:sample-configurations [
{:des "Caps lock mode / Esc" :rules [[:##caps_lock {:set ["caps-lock-mode" 1]} nil {:alone :escape :afterup {:set ["caps-lock-mode" 0]}}]]}
{:des "Caps vim navigation" :rules [:caps-lock-mode [:h :left_arrow] [:j :down_arrow] [:k :up_arrow] [:l :right_arrow]]}
]
}}