-
Notifications
You must be signed in to change notification settings - Fork 0
/
.khdrc
260 lines (214 loc) · 11.6 KB
/
.khdrc
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
248
249
250
251
252
253
254
255
256
257
258
259
# sample config for khd
# NOTE(koekeishiya): A bind is written in the form:
# <keysym> [!] [<app list>] [->] : <command>
# where
# <keysym> = mode + mod + ... + mod - literal
#
# <keysym> = mode + mod + ... + mod - keycode
# keycode must have 0x prefix
#
# <keysym> = mode + mod + ... + mod - button#
# replace '#' with mouse-button id; id >= 3
#
# modifier only binding
# <keysym> = mode + mod + ... + mod
#
# literal only binding
# <keysym> = - literal
#
# keycode only binding
# <keysym> = - keycode
#
# [<app,
# app, = optional list '[app1, ..., appN]' of applications
# app>] that this bind will be activated for. if the
# focused application is not contained in this list,
# the associated command will not be triggered, and
# the keypress will be passed through as normal.
#
# [!] = optional operator '!' negates the behaviour when a
# list of applications is given. this marks the bind
# as 'Hotkey_Exclude', causing the bind to not work
# when the focused application is in the given list.
#
# [->] = optional operator '->' that marks this bind as
# 'passthrough'. this causes the key to be passed
# through to the system, instead of being consumed.
#
# <command> = command is executed through '$SHELL -c' and
# follows valid shell syntax. if the $SHELL environment
# variable is not set, it will default to '/bin/bash'.
# when bash is used, the ';' delimeter can be specified
# to chain commands.
#
# to allow a command to extend into multiple lines,
# prepend '\' at the end of the previous line.
#
# an EOL character signifies the end of the bind.
# NOTE(koekeishiya) Example of passthrough
# cmd - m -> : echo "alert and minimize window" | alerter -title Test passthrough -timeout 2
# NOTE(koekeishiya) Example of app list
# alt - e [
# iTerm2,
# Terminal,
# HyperTerm
# ]
# : echo "so this is how deep the rabbit hole goes.." |\
# alerter -title Test passthrough -timeout 2
# NOTE(koekeishiya) Example of negated app list
# alt - e [
# iTerm2,
# Terminal,
# HyperTerm
# ] !
# : echo "blue pill, i choose you!" |\
# alerter -title Test passthrough -timeout 2
# NOTE(koekeishiya) Modifier only binding
# left shift -> ( right shift -> )
# left cmd -> { right cmd -> }
# khd mod_trigger_timeout 0.1
# suppress unregistered keybinds outside default mode
# enabled by default! must be explicitly set to 'off'
# khd void_unlisted_bind off
# # set border color for different modes
# khd mode default on_enter kwmc config border focused color 0xddd5c4a1
# khd mode switcher on_enter kwmc config border focused color 0xddbdd322
# khd mode ytd on_enter kwmc config border focused color 0xddd75f5f
# khd mode swap on_enter kwmc config border focused color 0xdd458588
# khd mode tree on_enter kwmc config border focused color 0xddfabd2f
# khd mode space on_enter kwmc config border focused color 0xddb16286
# khd mode info on_enter kwmc config border focused color 0xddcd950c
##
# vi-mode for non-terminal applications
##
# lctrl - h ![HyperTerm,Terminal,iTerm2] : khd -p "- left"
##
# chunkwm
##
# open apps
ctrl + alt - return : open -na /Applications/iTerm.app
# ctrl + shift - return : open -na /Applications/Google\ Chrome.app
# use switcher mode as a tmux-like prefix
ctrl - return : khd -e "mode activate switcher"
# it's persistent until escaped
switcher - escape : khd -e "mode activate default"
# window commands
# https://github.com/koekeishiya/chunkwm/blob/master/src/plugins/tiling/README.md#window-commands
# focus window
ctrl + shift - h : chunkc tiling::window --focus west
ctrl + shift - j : chunkc tiling::window --focus south
ctrl + shift - k : chunkc tiling::window --focus north
ctrl + shift - l : chunkc tiling::window --focus east
switcher - h : chunkc tiling::window --focus west
switcher - j : chunkc tiling::window --focus south
switcher - k : chunkc tiling::window --focus north
switcher - l : chunkc tiling::window --focus east
ctrl + shift - tab : chunkc tiling::window --focus prev
switcher - tab : chunkc tiling::window --focus prev
switcher + shift - tab : chunkc tiling::window --focus next
# swap (move) window
ctrl + shift + alt - h : chunkc tiling::window --swap west
ctrl + shift + alt - j : chunkc tiling::window --swap south
ctrl + shift + alt - k : chunkc tiling::window --swap north
ctrl + shift + alt - l : chunkc tiling::window --swap east
switcher + alt - h : chunkc tiling::window --swap west
switcher + alt - j : chunkc tiling::window --swap south
switcher + alt - k : chunkc tiling::window --swap north
switcher + alt - l : chunkc tiling::window --swap east
# close window
ctrl + shift - q : chunkc tiling::window --close
switcher - q : chunkc tiling::window --close
# toggle window fullscreen
ctrl + shift - return : chunkc tiling::window --toggle fullscreen
switcher - return : chunkc tiling::window --toggle fullscreen
# toggle window native (macOS) fullscreen
ctrl + shift + alt - return : chunkc tiling::window --toggle native-fullscreen
switcher + alt - return : chunkc tiling::window --toggle native-fullscreen
# toggle window split type with \
ctrl + shift - 0x31 : chunkc tiling::window --toggle split
switcher - 0x31 : chunkc tiling::window --toggle split
# equalize size of windows with =
ctrl + shift - 0x18 : chunkc tiling::desktop --equalize
switcher - 0x18 : chunkc tiling::desktop --equalize
# float / unfloat window with `
ctrl + shift - 0x32 : chunkc tiling::window --toggle float
switcher - 0x32 : chunkc tiling::window --toggle float
# move floating windows / windows on a floating space
# TODO: not working. is this even that useful?
## these will conflict with current adjust-window-edge
# switcher - up : chunkc tiling::window --warp-floating fullscreen
# switcher - left : chunkc tiling::window --warp-floating left
# switcher - right : chunkc tiling::window --warp-floating right
# switcher + shift - left : chunkc tiling::window --warp-floating top-left
# switcher + shift - up : chunkc tiling::window --warp-floating top-right
# switcher + shift - down : chunkc tiling::window --warp-floating bottom-left
# switcher + shift - right : chunkc tiling::window --warp-floating bottom-right
# send window to desktop
# shift + alt - x : chunkc tiling::window --send-to-desktop $(chunkc get _last_active_desktop)
ctrl + shift - left : chunkc tiling::window --send-to-desktop prev
ctrl + shift - right : chunkc tiling::window --send-to-desktop next
switcher - left : chunkc tiling::window --send-to-desktop prev
switcher - right : chunkc tiling::window --send-to-desktop next
switcher - 1 : chunkc tiling::window --send-to-desktop 1
switcher - 2 : chunkc tiling::window --send-to-desktop 2
switcher - 3 : chunkc tiling::window --send-to-desktop 3
switcher - 4 : chunkc tiling::window --send-to-desktop 4
switcher - 5 : chunkc tiling::window --send-to-desktop 5
# monitors - focus with ; move windows with P and /
ctrl + shift - 0x29 : chunkc tiling::monitor -f next
switcher - 0x29 : chunkc tiling::monitor -f next
ctrl + shift - p : chunkc tiling::window --send-to-monitor prev; chunkc tiling::monitor -f prev
ctrl + shift - 0x2C : chunkc tiling::window --send-to-monitor next; chunkc tiling::monitor -f next
ctrl + shift - p : chunkc tiling::window --send-to-monitor prev; chunkc tiling::monitor -f prev
ctrl + shift - 0x2C : chunkc tiling::window --send-to-monitor next; chunkc tiling::monitor -f next
# # send window to monitor and follow focus
# ctrl + cmd - z : chunkc tiling::window --send-to-monitor prev; chunkc tiling::monitor -f prev
# ctrl + cmd - c : chunkc tiling::window --send-to-monitor next; chunkc tiling::monitor -f next
# ctrl + cmd - 1 : chunkc tiling::window --send-to-monitor 1; chunkc tiling::monitor -f 1
# ctrl + cmd - 2 : chunkc tiling::window --send-to-monitor 2; chunkc tiling::monitor -f 2
# ctrl + cmd - 3 : chunkc tiling::window --send-to-monitor 3; chunkc tiling::monitor -f 3
# # increase region size
ctrl + shift - y : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge west
ctrl + shift - u : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge south
ctrl + shift - i : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge north
ctrl + shift - o : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge east
switcher - y : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge west
switcher - u : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge south
switcher - i : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge north
switcher - o : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge east
# # decrease region size - n m , .
ctrl + shift - n : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge west
ctrl + shift - m : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge south
ctrl + shift - 0x2B : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge north
ctrl + shift - 0x2F : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge east
switcher - n : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge west
switcher - m : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge south
switcher - 0x2B : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge north
switcher - 0x2F : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge east
# # set insertion point for focused container
# ctrl + alt - f : chunkc tiling::window --use-insertion-point cancel
# ctrl + alt - h : chunkc tiling::window --use-insertion-point west
# ctrl + alt - j : chunkc tiling::window --use-insertion-point south
# ctrl + alt - k : chunkc tiling::window --use-insertion-point north
# ctrl + alt - l : chunkc tiling::window --use-insertion-point east
# rotate tree with { and }
ctrl + shift - 0x1E : chunkc tiling::desktop --rotate 90
ctrl + shift - 0x21 : chunkc tiling::desktop --rotate -90
switcher - 0x1E : chunkc tiling::desktop --rotate 90
switcher - 0x21 : chunkc tiling::desktop --rotate -90
# # mirror tree y-axis
# alt - y : chunkc tiling::desktop --mirror vertical
# # mirror tree x-axis
# alt - x : chunkc tiling::desktop --mirror horizontal
# # toggle desktop offset
# switcher - m : chunkc tiling::desktop --toggle offset
# # float next window to be tiled
# TODO: not working
ctrl + shift - space : chunkc set window_float_next 1
# # change layout of desktop
# ctrl + alt - a : chunkc tiling::desktop --layout bsp
# ctrl + alt - s : chunkc tiling::desktop --layout monocle
# ctrl + alt - d : chunkc tiling::desktop --layout float
# toggle sticky, float and resize to picture-in-picture size
# alt - s : chunkc tiling::window --toggle sticky;\
# chunkc tiling::window --warp-floating pip-right