-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample_configuration.yaml
196 lines (153 loc) · 6.26 KB
/
sample_configuration.yaml
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
# Profile Name: If one is not provided, one will be generated from the
# current Unix timestamp
profile_name:
Karaml Config
# Optional: include title for ruleset (recommended)
title:
KaramlConfig
parameters:
{
"basic.to_if_alone_timeout_milliseconds": 100,
"basic.to_if_held_down_threshold_milliseconds": 101,
basic.to_delayed_action_delay_milliseconds: 150,
"basic.simultaneous_threshold_milliseconds": 75,
"mouse_motion_to_scroll.speed": 100,
}
# NOTE: This configuration uses the original <mods-key> syntax
# for specifying keys with modifiers. See the docs for other
# valid syntaxes, e.g. `mods | key`
/base/:
caps_lock: [escape, /nav/] # tap: escape, hold: /nav/
<oc-n>: /nav/ # left_opt + left_control + n toggles /nav/
escape: [null, mute, mute] # Mute on hold, unmute on release
# Space-Cadet shifts
left_shift: [(, left_shift] # Using `(` alias for <s-9>
# this is a YAML sequence equivalent to YAML array - use whatever looks cleaner
right_shift:
- <s-0> # No alias, 'explicit' mapping
- right_shift
<o-right_shift>: sticky(left_shift, toggle)
<o-s>: var(sys_layer, 1) # left_opt + s to turn /sys/ layer on
<o-s> + n: /sys/ + /nav/ # Toggle /sys/ and /nav/
<c-w>: <o-backspace> # left_control + w to left_option + backspace
<o-q>: escape # left_option + q to escape
<O-q>: <m-q> # right_option + q to left_command + q
<r-h>: backspace # control (either side) + h to backspace
<o-c>: <ms-c> # left_option + c to left_command + left_shift + c
<C-right_shift>: <gar-shift> # from: right_control + right_shift
# to: command + option + control + shift (hyper)
grave: [grave, <moc-left_shift>] # tap for grave, hold for hyper
# enter (any modifier) to enter when tapped, control when held,
# with lazy opt and mapping-specific parameters
<(x)-enter>:
- enter
- left_control
- null
- [+lazy] # - [ null ] or null to omit options
- { a: 100, s: 50, d: 500, h: 100 }
# Simultaneous keys and multiple 'to' events
j+k: escape
d + i + w: <o-backspace> + <o-delete> # 'Delete Inner Word'
# g + h opens github on key-up, with simul threshold of 150ms
g + h: [ null, null, open(https://github.com), [ null ], { s: 150} ]
<o-h>: string(hello world)
# Adding frontmost_app_if/unless conditions
<c-u>: { unless Terminal$ iterm2$ kitty$: <g-backspace> }
<a-g>: {
if Terminal$ iterm2$ kitty$: [string(git ), string(checkout )],
if CotEditor$: <g-l> # 'go to line' alternate shortcut
}
# Escaping special characters (check YAML documentation)
"!": {if iCal$: button2 }
"'": {if firefox$: home }
/nav/:
<(x)-h>: left # vim navigation with any optional mods
<(x)-j>: down
<(x)-k>: up
<(x)-l>: right
# App launchers
c: app(Kitty)
f: app(Firefox)
g: open(https://github.com) # open github.com in default browser
# Tap for Safari, hold for /sys/ layer w/ notification
s:
- app(Safari)
- /sys/ + notify(sysNotification,"System Layer Enabled")
# Three ways to disable notification:
- notifyOff(sysNotification) # notifyOff() with notification id as arg
# - notify(sysNotification, null # notify() with null id as first, null as second arg
# - notify(sysNotification) # notify() with notification id as first arg
m: /mouse/ # Toggle /mouse/ layer
/sys/:
<o-s>: var(sys_layer, 0) # Turn /sys/ layer off
j: volume_increment
k: volume_decrement
# Shell commands
f: shell(open ~)
v: shell(open -b com.apple.ScreenSaver.Engine)
# Notification changes when pressed, when released
<o-h>: ["notify(idHello, Hello!)", null, "notify(idHello)"]
# For delay opt, ints in the opt-list in the fourth position
<mocs-q>: [ null, <sm-q>, null, [2000] ] # 2s delay on Log-Out
# Change language inputs
# Language regex shorthand
<o-e>: input(en)
# More specific dictionary
<o-g>: 'input({ "input_source_id": "com.apple.keylayout.GreekPolytonic", "language": "el" })'
# Change language inputs with AppleScript style notification using shnotify()
# shnotify() args can be passed as positional args or as a dict
# 1. shnotify(message, title, subtitle, sound)
# 2. shnotify({ "msg": "message", "title": "title", "subtitle": "subtitle", "sound": "sound" })
# Positional args with msg and title
<o-e>: shnotify(English, ==KEYBOARD==) + input(en)
<o-g>: 'shnotify(GreekPolytonic, ==KEYBOARD==) + input({ "input_source_id": "com.apple.keylayout.GreekPolytonic", "language": "el" })'
# Positional args with message only
<O-e>: 'shnotify(ABC Extended) + input({"input_source_id": "com.apple.keylayout.USExtended"})'
# If using positional args, skip arguments with 'null'
<o-a>:
'shnotify(Arabic, ==KEYBOARD==, null, glass)
+ input({ "input_source_id": "com.apple.keylayout.Arabic-AZERTY" })'
# Dict as only arg
<O-a>: 'shnotify({
"msg": "Arabic",
"title": "==KEYBOARD==",
"subtitle": "AZERTY",
"sound": "glass"
})
+ input({
"language": "ar",
"input_source_id": "com.apple.keylayout.Arabic-AZERTY"
})'
<o-r>: 'shnotify(Russian, null, null, frog) + input(ru)'
<O-r>: 'shnotify({"msg": "Russian", "sound": "frog"}) + input(ru)'
# Require multiple layers
/sys/ + /nav/:
m: mute
/mouse/:
spacebar: button1
<s-spacebar>: button2
h: mouse(x, -2000)
j: mouse(y, 2000)
k: mouse(y, -2000)
l: mouse(x, 2000)
<c-h>: mouse(horizontal_wheel, 100)
<c-j>: mouse(vertical_wheel, 180)
<c-k>: mouse(vertical_wheel, -180)
<c-l>: mouse(horizontal_wheel, -100)
s: mouse(speed_multiplier, 2.5)
<c-1>: 'softFunc("set_mouse_cursor_position": { "x": 0, "y": 0, "screen": 0 } })'
json:
- {
description: "Right Control to > if tapped, control if held",
from: { key_code: right_control },
to: { key_code: right_control, lazy: true },
to_if_alone: { key_code: period, modifiers: [right_control] },
type: basic,
}
- {
"description": "Left Control to < if tapped, control if held",
"from": { "key_code": "left_control" },
"to": { "key_code": "left_control", "lazy": true },
"to_if_alone": { "key_code": "comma", "modifiers": ["left_control"] },
"type": "basic",
}