-
Notifications
You must be signed in to change notification settings - Fork 0
/
skhdrc
executable file
·64 lines (52 loc) · 2.97 KB
/
skhdrc
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
# Open alacritty
ctrl + cmd - return : open --new -a /Applications/Alacritty.app/Contents/MacOS/alacritty
# Minimize window
cmd - m: yabai -m window --minimize && yabai -m window --focus prev || yabai -m window --focus first
# Focus window [north|south|west|east], support multiple monitors
cmd - j : yabai -m window --focus south || \
yabai -m window --focus $(yabai -m query --windows --display south | \
jq 'map(select(.visible == 1)) | sort_by(.frame.x, .frame.y) | last | .id') || \
yabai -m display --focus south
cmd - k : yabai -m window --focus north || \
yabai -m window --focus $(yabai -m query --windows --display north | \
jq 'map(select(.visible == 1)) | sort_by(.frame.x, .frame.y) | last | .id') || \
yabai -m display --focus north
cmd - h : yabai -m window --focus west || \
yabai -m window --focus $(yabai -m query --windows --display west | \
jq 'map(select(.visible == 1)) | sort_by(.frame.x, .frame.y) | last | .id') || \
yabai -m display --focus west
cmd - l : yabai -m window --focus east || \
yabai -m window --focus $(yabai -m query --windows --display east | \
jq 'map(select(.visible == 1)) | sort_by(.frame.x, .frame.y) | first | .id') || \
yabai -m display --focus east
# Send window to monitor and follow focus
cmd + ctrl - l : yabai -m window --display next; yabai -m display --focus next
cmd + ctrl - h : yabai -m window --display prev; yabai -m display --focus prev
cmd + ctrl - j : yabai -m window --display south; yabai -m display --focus south
cmd + ctrl - k : yabai -m window --display north; yabai -m display --focus north
# Swap window left/right
alt - s : yabai -m window --swap first || yabai -m window --swap last
# Balance windows
alt - r : yabai -m space --balance
# Fullscreen
alt - f : yabai -m window --toggle zoom-fullscreen
# increase/decrease right window
alt - a : yabai -m window --resize left:-100:0
alt + cmd - a : yabai -m window --resize left:+100:0
# increase/decrease left window
alt - d : yabai -m window --resize right:+100:0
alt + cmd - d : yabai -m window --resize right:-100:0
# Cycle through spaces (in the same display)
alt - c : id="$(yabai -m query --spaces --display | jq 'sort_by(.index) | reverse | .[map(."has-focus") | index(true) - 1].index')" && yabai -m space --focus "${id}"
# Create space, move window and follow focus
alt - t : yabai -m space --create && \
index=$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index') && \
yabai -m window --space "${index}" && \
yabai -m space --focus ${index}
# Destroy space
alt - q : yabai -m space --destroy
# Restart yabai
cmd + alt - r : \
/usr/bin/env osascript <<< \
"display notification \"Restarting Yabai\" with title \"Yabai\""; \
launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"