-
Notifications
You must be signed in to change notification settings - Fork 0
/
karabiner.edn
156 lines (134 loc) · 5.19 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
{
;; rule [:period ["media-mode" 1] nil {:afterup ["media-mode" 0] :alone :period}]
;; |_____| |_______________| |_| |_________________________________________|
;; <from> <to> <conditions> <other options>
;; :japanese_kana {:label "かなキー" :display true}
;; https://github.com/yqrashawn/GokuRakuJoudo/blob/master/src/karabiner_configurator/keys_info.clj
;; chrome-mode
;; https://github.com/LcitsChan/dotfiles/blob/01c8ef75147cb67302824772004a51486eccbffb/goku/karabiner.edn
;; this is a little bit weird, but it's convenient
;; the rule [:!Ca :!T1]
;; means from command a to control 1
;; :!Ca is keycode :a and prefix a with !C
;; here's the definition
;; ! | means mandatory
;; # | means optional
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
;; E | right_option
;; R | right_shift
;; P | caps_lock
;; !! | mandatory command + control + optional + shift (hyper)
;; ## | optional any
;; examples
;; !CTSequal_sign | mandatory command control shift =
;; | which is command control +
;; !O#Sright_arrow | mandatory option optional any right_arrow
;; karabiner definition of mandatory and optional
;; https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/from/modifiers/
;; rule [<from> <to>]
;; if simplified modifier is used in <to>, optional(#) definition will be
;; ignored.
:applications {
:chrome ["^com\\.google\\.Chrome$"]
:slack ["^com\\.tinyspeck\\.slackmacgap$"]
:iterm ["^com.googlecode.iterm2$"]
}
:templates {
:open "open -a '%s'" ;; :open "Safari"
:openApp "open \"%s\"" ;; :open "/Applications/Safari.app"
:yabai "/opt/homebrew/bin/yabai -m %s" ;; :open "/Applications/Safari.app"
:yabai2 "/opt/homebrew/bin/yabai -m %s; /opt/homebrew/bin/yabai -m %s" ;; :open "/Applications/Safari.app"
}
:layers {
:hyper-mode {
:key :caps_lock :alone {:key :caps_lock}
}
}
:simlayers {
:d-mode {:key :d}
}
:main [
{
:des "easier polish signs"
:rules [
[:right_command :right_option]
[:right_option :right_command]
]
},
{
:des "hyper-mode"
:rules [
:hyper-mode
;;[:##h :left_arrow]
;;[:##j :down_arrow]
;;[:##k :up_arrow]
;;[:##l :right_arrow]
;;[:##f :left_option]
;;[:##d :left_shift]
[:i [:open "IntelliJ IDEA Ultimate"]]
[:p [:open "PyCharm Professional Edition"]]
[:b [:open "Google Chrome"]]
[:s [:open "Slack"]]
[:f [:open "Finder"]]
[:t [:open "iterm"]]
[:y [:open "Microsoft Teams"]]
[:right_arrow :!CSTOright_arrow]
[:left_arrow :!CSTOleft_arrow]
[:m [:yabai "space --focus 1"]]
[:a :left_option]
[:1 [:yabai "display --focus 2"]]
[:2 [:yabai "display --focus 1"]]
[:!Oleft_arrow [:yabai2 "window --display 2" "display --focus 2"]]
[:!Oright_arrow [:yabai2 "window --display 1" "display --focus 1"]]
[:!Oreturn_or_enter [:yabai "window --grid 1:1:0:0:1:1"]]
[:!Cleft_arrow [:yabai "window --grid 1:2:0:0:1:1"]]
[:!Cright_arrow [:yabai "window --grid 1:2:1:0:1:1"]]
]
},
{
:des "chrome overrides"
:rules [
:chrome
[:!Te :!CSa]
[:!TSf :slash] ;; search
[:!CSleft_arrow :!Tpage_up] ;; tab leftaa
[:!CSright_arrow :!Tpage_down] ;; tab right
;;[:p "open ~/Applications/JetBrains\\ Toolbox/PyCharm\\ Professional\\ Edition.app"]
]
},
{
:des "slack overrides"
:rules [
:slack
[:!CTleft_arrow :!Copen_bracket] ;; history back
[:!CTright_arrow :!Cclose_bracket] ;; history forward
[:!TSf :!Cg] ;; search
;;[:p "open ~/Applications/JetBrains\\ Toolbox/PyCharm\\ Professional\\ Edition.app"]
]
},
{
:des "iterm"
:rules [
:iterm
[:!COleft_arrow :!Cleft_arrow] ;; tab left
[:!COright_arrow :!Cright_arrow] ;; tab right
;;[:p "open ~/Applications/JetBrains\\ Toolbox/PyCharm\\ Professional\\ Edition.app"]
]
},
{
:des "mouse"
:rules [
:d-mode
[:i :!Ckeypad_hyphen] ; Zoom out
[:o :!Ckeypad_plus] ; Zoom inT
[:j {:mkey {:vwheel 60}}] ; Scroll down
[:k {:mkey {:vwheel -60}}] ; Scroll up
]
}
]}