-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdot_skhdrc
170 lines (133 loc) · 6.68 KB
/
dot_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
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
# white
:: default
: yabai -m config active_window_border_color 0xffebdbb2 ; \
~/.config/ubersicht/widgets/simple-bar/lib/scripts/yabai-set-mode.sh "default"
# red
:: tree
: yabai -m config active_window_border_color 0xccd75f5f ; \
~/.config/ubersicht/widgets/simple-bar/lib/scripts/yabai-set-mode.sh "tree" blue
ctrl - f ; tree
tree < ctrl - f -> ; default
tree < 0x35 ; default
cmd - 9 : skhd --text "[email protected]"
cmd - 0 : skhd --text "[email protected]"
# use escape to reload skhd
default, tree < cmd - 0x35 : skhd --restart-service
tree < cmd - 0x35 ; default
rcmd + shift - 3
: screencapture ~/Downloads/screenshot-$(date +%d%m%y-%H-%M-%S).png
# take a screenshot and try to recognize text
rcmd + shift - 6 : ~/.bin/ocr
# lcmd is always open new terminal; pass through rcmd+return on some apps that have bindings for it.
lcmd - return : if ! alacritty msg create-window; then open -a /Applications/Alacritty.app; fi
rcmd - return [
"Microsoft Outlook" ~
"Code" ~
* : if ! alacritty msg create-window; then open -a /Applications/Alacritty.app; fi
]
cmd + ctrl - return : open ~/
cmd + alt + ctrl - l : ~/.bin/lock
# cycle - IGNORE floating windows
lalt - n : yabai -m query --windows --space \
| jq -sr 'add | map(select((.["is-floating"] == false) and (.["is-minimized"] == false))) | sort_by(.frame.x, .frame.y, .["stack-index"], .id) | reverse | nth(map(.["has-focus"] == true) | index(true) - 1) | .id' \
| xargs -I{} yabai -m window --focus {}
# cycle backward (especially helpful for stacks)
lalt + shift - n : yabai -m query --windows --space \
| jq -sr 'add | map(select((.["is-floating"] == false) and (.["is-minimized"] == false))) | sort_by(.frame.x, .frame.y, .["stack-index"], .id) | nth(map(.["has-focus"] == true) | index(true) - 1) | .id' \
| xargs -I{} yabai -m window --focus {}
# cycle WITHOUT ignoring floating windows
lalt - m : yabai -m query --windows --space \
| jq -sr 'add | map(select(.["is-minimized"] == false))' \
| jq -sre 'add | sort_by(.display, .frame.x, .frame.y, .id) | reverse | nth(index(map(select(.["has-focus"] == true))) - 1).id' \
| xargs -I{} yabai -m window --focus {}
# cycle across windows spanning multiple displays.
lalt + shift - m : yabai -m query --windows \
| jq -sr 'add | map(select(.["is-visible"] == true))' \
| jq -sre 'add | sort_by(.display, .frame.x, .frame.y, .id) | reverse | nth(index(map(select(.["has-focus"] == true))) - 1).id' \
| xargs -I{} yabai -m window --focus {}
lcmd - h : yabai -m window --focus west
lcmd - j : yabai -m window --focus south
lcmd - k : yabai -m window --focus north
lcmd - l : yabai -m window --focus east
# equalize size of windows
shift + alt - 0 : yabai -m space --balance
# increase region size (floating or nonfloating)
lalt - h : yabai -m window --resize left:-30:0
lalt - j : yabai -m window --resize bottom:0:30
lalt - k : yabai -m window --resize top:0:-30
lalt - l : yabai -m window --resize right:30:0
# decrease region size (floating or nonfloating)
shift + lalt - h : yabai -m window --resize left:30:0
shift + lalt - j : yabai -m window --resize bottom:0:-30
shift + lalt - k : yabai -m window --resize top:0:30
shift + lalt - l : yabai -m window --resize right:-30:0
# swap window
ctrl + lalt - h : yabai -m window --swap west
ctrl + lalt - j : yabai -m window --swap south
ctrl + lalt - k : yabai -m window --swap north
ctrl + lalt - l : yabai -m window --swap east
# reinsert window
lcmd + shift - h : yabai -m window --warp west
lcmd + shift - j : yabai -m window --warp south
lcmd + shift - k : yabai -m window --warp north
lcmd + shift - l : yabai -m window --warp east
# set insertion point for focused container
lcmd + ctrl - h : yabai -m window --insert west
lcmd + ctrl - j : yabai -m window --insert south
lcmd + ctrl - k : yabai -m window --insert north
lcmd + ctrl - l : yabai -m window --insert east
lcmd + ctrl - o : yabai -m window --insert stack
# move around floating windows
cmd + shift - left : yabai -m window --move rel:-30:0
cmd + shift - down : yabai -m window --move rel:0:30
cmd + shift - up : yabai -m window --move rel:0:-30
cmd + shift - right : yabai -m window --move rel:30:0
# send window to desktop and follow focus
lcmd + shift - 1 : yabai -m window --space 1; skhd --key "cmd - 1"
lcmd + shift - 2 : yabai -m window --space 2; skhd --key "cmd - 2"
lcmd + shift - 3 : yabai -m window --space 3; skhd --key "cmd - 3"
lcmd + shift - 4 : yabai -m window --space 4; skhd --key "cmd - 4"
lcmd + shift - 5 : yabai -m window --space 5; skhd --key "cmd - 5"
lcmd + shift - 6 : yabai -m window --space 6; skhd --key "cmd - 6"
# focus monitor
ctrl - 1 : yabai -m display --focus 1
ctrl - 2 : yabai -m display --focus 2
ctrl - 3 : yabai -m display --focus 3
# send window to monitor (don't follow focus)
ctrl + shift - 1 : yabai -m window --display 1
ctrl + shift - 2 : yabai -m window --display 2
ctrl + shift - 3 : yabai -m window --display 3
####
## Tree
####
# dropdown
lalt - space : ~/.bin/floatng-alacritty
# toggle float
lalt - t : yabai -m window --toggle float
# center a floating window
alt - c : ~/.bin/yabai-center
# toggle window split type (like a container rotation)
alt - e : yabai -m window --toggle split
# toggle window fullscreen
lcmd - g : yabai -m window --toggle zoom-fullscreen
# toggle window parent zoom
tree < p : yabai -m window --toggle zoom-parent
# presets for floating windows
lcmd + shift - g : if [[ $(yabai -m query --windows --window | jq '.["is-floating"]') == "false" ]]; then yabai -m window --toggle float; fi; yabai -m window --grid 100:100:25:25:50:50; ~/.bin/yabai-center
tree < q : yabai -m window --grid 100:100:57:6:37:42
tree < e : yabai -m window --grid 100:100:25:2:50:93
tree < s : skhd --key "ctrl - f"; ~/.bin/spongify --copy
tree < l : skhd --key "ctrl - f"; ~/.bin/spacify --copy
tree < h : skhd --key "ctrl - f"; skhd --text "¯\_(ツ)_/¯"
tree < v : skhd --key "ctrl - f"; ~/.bin/codify
# change layout of desktop
tree < b : yabai -m space --layout bsp ; skhd --key "ctrl - f"
tree < shift - f : yabai -m space --layout float ; skhd --key "ctrl - f"
tree < m : yabai -m space --layout stack ; skhd --key "ctrl - f"
# 0x2C is '/', so shift - 0x2C is '?'
tree < shift - 0x2C : osascript -e "display notification \"b / shift-f / m\" with title \"tree\""
# stack windows
tree < left : yabai -m window --stack west ; skhd --key "ctrl - f"
tree < down : yabai -m window --stack south ; skhd --key "ctrl - f"
tree < up : yabai -m window --stack north ; skhd --key "ctrl - f"
tree < right : yabai -m window --stack east ; skhd --key "ctrl - f"