-
Notifications
You must be signed in to change notification settings - Fork 0
/
.skhdrc
executable file
·72 lines (57 loc) · 3.5 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
65
66
67
68
69
70
71
72
# focus window
alt - k : win_id=$(yabai -m query --windows --space \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) | . as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $has_index > 0 then nth($has_index - 1).id else nth($array_length - 1).id end');\
yabai -m window --focus $win_id
alt - j : win_id=$(yabai -m query --windows --space \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) | . as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $array_length - 1 > $has_index then nth($has_index + 1).id else nth(0).id end');\
yabai -m window --focus $win_id
# swap window
alt + shift - k : yabai -m query --spaces --space \
| jq -re ".index" \
| xargs -I{} yabai -m query --windows --space {} \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) | . as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $has_index > 0 then nth($has_index - 1).id else nth($array_length - 1).id end' \
| xargs -I{} yabai -m window --swap {}
alt + shift - j : yabai -m query --spaces --space \
| jq -re ".index" \
| xargs -I{} yabai -m query --windows --space {} \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) |. as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $array_length - 1 > $has_index then nth($has_index + 1).id else nth(0).id end' \
| xargs -I{} yabai -m window --swap {}
# toggle layouts
alt - s : yabai -m space --layout stack
alt - t : yabai -m space --layout bsp
alt - f : yabai -m space --layout float; sketchybar --trigger window_focus
alt - r : yabai -m space --rotate 90
# focus display
alt - 0x2B : yabai -m display --focus prev
alt - 0x2F : yabai -m display --focus next
# move managed window to other display
shift + alt - 0x2B : yabai -m window --warp next
shift + alt - 0x2F : yabai -m window --warp prev
# move window and focus desktop
shift + alt - 1 : yabai -m window --space 1
shift + alt - 2 : yabai -m window --space 2
shift + alt - 3 : yabai -m window --space 3
shift + alt - 4 : yabai -m window --space 4
shift + alt - 5 : yabai -m window --space 5
shift + alt - 6 : yabai -m window --space 6
shift + alt - 7 : yabai -m window --space 7
shift + alt - 8 : yabai -m window --space 8
shift + alt - 9 : yabai -m window --space 9
alt - 1 : yabai -m space --focus 1
alt - 2 : yabai -m space --focus 2
alt - 3 : yabai -m space --focus 3
alt - 4 : yabai -m space --focus 4
alt - 5 : yabai -m space --focus 5
alt - 6 : yabai -m space --focus 6
alt - 7 : yabai -m space --focus 7
alt - 8 : yabai -m space --focus 8
alt - 9 : yabai -m space --focus 9
shift + alt - c : yabai -m window --close
alt - w : open -na /Applications/Firefox.app
alt - 0x24 : open -na /Applications/Alacritty.app
shift + alt - f : yabai -m window --toggle native-fullscreen
alt + shift - r: brew services restart yabai; brew services restart skhd
shift + alt - h : yabai -m window west --resize right:-40:0 2> /dev/null || yabai -m window --resize right:-40:0
shift + alt - j : yabai -m window north --resize bottom:0:40 2> /dev/null || yabai -m window --resize bottom:0:40
shift + alt - k : yabai -m window south --resize top:0:-40 2> /dev/null || yabai -m window --resize top:0:-40
shift + alt - l : yabai -m window east --resize left:40:0 2> /dev/null || yabai -m window --resize left:40:0