1 # NOTE(koekeishiya): A list of all built-in modifier and literal keywords can
2 # be found at https://github.com/koekeishiya/skhd/issues/1
4 # A hotkey is written according to the following rules:
6 # hotkey = <mode> '<' <action> | <action>
8 # mode = 'name of mode' | <mode> ',' <mode>
10 # action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']'
11 # <keysym> ':' <command> | <keysym> '->' ':' <command>
12 # <keysym> ';' <mode> | <keysym> '->' ';' <mode>
14 # keysym = <mod> '-' <key> | <key>
16 # mod = 'modifier keyword' | <mod> '+' <mod>
18 # key = <literal> | <keycode>
20 # literal = 'single letter or built-in keyword'
22 # keycode = 'apple keyboard kVK_<Key> values (0x3C)'
24 # proc_map_lst = * <proc_map>
26 # proc_map = <string> ':' <command> | <string> '~' |
27 # '*' ':' <command> | '*' '~'
29 # string = '"' 'sequence of characters' '"'
31 # command = command is executed through '$SHELL -c' and
32 # follows valid shell syntax. if the $SHELL environment
33 # variable is not set, it will default to '/bin/bash'.
34 # when bash is used, the ';' delimeter can be specified
37 # to allow a command to extend into multiple lines,
38 # prepend '\' at the end of the previous line.
40 # an EOL character signifies the end of the bind.
42 # -> = keypress is not consumed by skhd
44 # * = matches every application not specified in <proc_map_lst>
46 # ~ = application is unbound and keypress is forwarded per usual, when specified in a <proc_map>
48 # NOTE(koekeishiya): A mode is declared according to the following rules:
50 # mode_decl = '::' <name> '@' ':' <command> | '::' <name> ':' <command> |
51 # '::' <name> '@' | '::' <name>
53 # name = desired name for this mode,
55 # @ = capture keypresses regardless of being bound to an action
57 # command = command is executed through '$SHELL -c' and
58 # follows valid shell syntax. if the $SHELL environment
59 # variable is not set, it will default to '/bin/bash'.
60 # when bash is used, the ';' delimeter can be specified
63 # to allow a command to extend into multiple lines,
64 # prepend '\' at the end of the previous line.
66 # an EOL character signifies the end of the bind.
68 # add an on_enter command to the default mode
69 # :: default : chunkc border::color 0xff775759
71 # defines a new mode 'test' with an on_enter command, that captures keypresses
72 # :: test @ : chunkc border::color 0xff24ccaa
74 # from 'default' mode, activate mode 'test'
77 # from 'test' mode, activate mode 'default'
78 # test < cmd - x ; default
80 # launch a new terminal instance when in either 'default' or 'test' mode
81 # default, test < cmd - return : open -na /Applications/Terminal.app
83 # application specific bindings
86 # "kitty" : echo "hello kitty"
87 # * : echo "hello everyone"
88 # "qutebrowser" : echo "hello qutebrowser"
93 # specify a file that should be included as an additional config-file.
94 # treated as an absolutepath if the filename begins with '/' otherwise
95 # the file is relative to the path of the config-file it was loaded from.
97 # .load "/Users/Koe/.config/partial_skhdrc"
98 # .load "partial_skhdrc"
100 # prevent skhd from monitoring events for specific applications.
108 # open terminal, blazingly fast compared to iTerm/Hyper
109 alt - return : /Applications/kitty.app/Contents/MacOS/kitty --single-instance -d ~
112 # cmd + shift - return : ~/Scripts/qtb.sh
115 # cmd - m : open -na /Applications/mpv.app $(pbpaste)
118 alt - h : yabai -m window --focus west
119 alt - j : yabai -m window --focus south
120 alt - k : yabai -m window --focus north
121 alt - l : yabai -m window --focus east
123 # swap managed window
124 shift + alt - h : yabai -m window --swap west
125 shift + alt - j : yabai -m window --swap south
126 shift + alt - k : yabai -m window --swap north
127 shift + alt - l : yabai -m window --swap east
129 # move managed window
130 shift + ctrl + alt - h : yabai -m window --warp west
131 shift + ctrl + alt - j : yabai -m window --warp south
132 shift + ctrl + alt - k : yabai -m window --warp north
133 shift + ctrl + alt - l : yabai -m window --warp east
135 # balance size of windows
136 shift + ctrl + alt - 0 : yabai -m space --balance
138 # make floating window fill screen
139 shift + alt - up : yabai -m window --grid 1:1:0:0:1:1
141 # make floating window fill left-half of screen
142 shift + alt - left : yabai -m window --grid 1:2:0:0:1:1
143 shift + alt - right : yabai -m window --grid 1:2:1:0:1:1
145 # create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
146 # shift + cmd - n : yabai -m space --create && \
147 # index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \
148 # yabai -m window --space "${index}" && \
149 # yabai -m space --focus "${index}"
152 # cmd + alt - x : yabai -m space --focus recent
153 # cmd + alt - 1 : yabai -m space --focus 1
155 # send window to desktop and follow focus
156 # shift + cmd - z : yabai -m window --space next; yabai -m space --focus next
157 shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1
158 shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2
159 shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3
160 shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4
161 shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5
162 shift + alt - 6 : yabai -m window --space 6; yabai -m space --focus 6
163 shift + alt - 7 : yabai -m window --space 7; yabai -m space --focus 7
164 shift + alt - 8 : yabai -m window --space 8; yabai -m space --focus 8
165 shift + alt - 9 : yabai -m window --space 9; yabai -m space --focus 9
166 shift + alt - 0 : yabai -m window --space 10; yabai -m space --focus 10
169 # ctrl + alt - z : yabai -m display --focus prev
170 shift + ctrl - 1 : yabai -m display --focus 1
171 shift + ctrl - 2 : yabai -m display --focus 2
172 shift + ctrl - 3 : yabai -m display --focus 3
174 # send window to monitor and follow focus
175 # ctrl + cmd - c : yabai -m window --display next; yabai -m display --focus next
176 # ctrl + cmd - 1 : yabai -m window --display 1; yabai -m display --focus 1
177 shift + ctrl + alt - 1 : yabai -m window --display 1; yabai -m display --focus 1
178 shift + ctrl + alt - 2 : yabai -m window --display 2; yabai -m display --focus 2
179 shift + ctrl + alt - 3 : yabai -m window --display 3; yabai -m display --focus 3
181 # move floating window
182 # shift + ctrl - a : yabai -m window --move rel:-20:0
183 # shift + ctrl - s : yabai -m window --move rel:0:20
185 # increase window size
186 shift + alt - a : yabai -m window --resize --left:-20:0
187 shift + alt - s : yabai -m window --resize --bottom:0:20
188 shift + alt - w : yabai -m window --resize --top:0:-20
189 shift + alt - d : yabai -m window --resize --right:20:0
191 # decrease window size
192 # shift + cmd - s : yabai -m window --resize bottom:0:-20
193 # shift + cmd - w : yabai -m window --resize top:0:20
194 shift + ctrl+ alt - a : yabai -m window --resize --right:-20:0
195 shift + ctrl+ alt - s : yabai -m window --resize --top:0:20
196 shift + ctrl+ alt - w : yabai -m window --resize --bottom:0:-20
197 shift + ctrl+ alt - d : yabai -m window --resize --left:20:0
199 # set insertion point in focused container
200 ctrl + alt - h : yabai -m window --insert west
201 ctrl + alt - j : yabai -m window --insert south
202 ctrl + alt - k : yabai -m window --insert north
203 ctrl + alt - l : yabai -m window --insert east
206 shift + alt - z : yabai -m window --toggle zoom-parent
207 shift + ctrl + alt - z : yabai -m window --toggle zoom-fullscreen
209 # toggle window split type
210 shift + alt - e : yabai -m window --toggle split
212 # float / unfloat window and center on screen
213 shift + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2
215 # toggle sticky(+float), topmost, picture-in-picture
216 shift + alt - p : yabai -m window --toggle sticky --toggle topmost --toggle pip
219 shift + alt - r : yabai -m space --rotate 90
222 shift + alt - y : yabai -m space --mirror y-axis
225 shift + alt - x : yabai -m space --mirror x-axis