-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskhdrc
114 lines (90 loc) · 5.07 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
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
# _ _ _
# _ __ ___ _ _ ___| | _| |__ __| |_ __ ___
#| '_ ` _ \| | | | / __| |/ / '_ \ / _` | '__/ __|
#| | | | | | |_| | \__ \ <| | | | (_| | | | (__
#|_| |_| |_|\__, | |___/_|\_\_| |_|\__,_|_| \___|
# |___/
#
#SKHD STUFF
# if you're having troubles finding key codes for a key just type skhd --observe in a terminal and type a key. Pretty cool! Or just check the wiki.
## HYPER == SHIFT + CMD + ALT + OPTION
### ============================================================================ ###
### My Settings ###
### ============================================================================ ###
# Close active application (快速关闭窗口)
ctrl + alt - backspace : $(yabai -m window $(yabai -m query --windows --window | jq -re ".id") --close)
# Equalize size of windows (平铺当前界面所有窗口)
ctrl + alt - 0 : yabai -m space --balance
# full screen / un-full screen(切换窗口全屏) 0x24 表示回车
ctrl + alt - 0x24 : yabai -m window --toggle zoom-fullscreen
# window resize
cmd + shift - k : yabai -m window --resize top:0:-20 || yabai -m window --resize bottom:0:-20
cmd + shift - j : yabai -m window --resize top:0:20 || yabai -m window --resize bottom:0:20
cmd + shift - h : yabai -m window --resize left:-20:0 || yabai -m window --resize right:-20:0
cmd + shift - l : yabai -m window --resize right:20:0 || yabai -m window --resize left:20:0
# swap window & move window in floating mode (移动窗口)
shift + alt - k : yabai -m window --swap north
shift + alt - j : yabai -m window --swap south
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east
# 在 9 个桌面之间切换
cmd - 1 : yabai -m space --focus 1
cmd - 2 : yabai -m space --focus 2
cmd - 3 : yabai -m space --focus 3
cmd - 4 : yabai -m space --focus 4
cmd - 5 : yabai -m space --focus 5
cmd - 6 : yabai -m space --focus 6
cmd - 7 : yabai -m space --focus 7
cmd - 8 : yabai -m space --focus 8
cmd - 9 : yabai -m space --focus 9
# 将窗口发送到某个其他桌面
alt + shift - 1 : yabai -m window --space 1
alt + shift - 2 : yabai -m window --space 2
alt + shift - 3 : yabai -m window --space 3
alt + shift - 4 : yabai -m window --space 4
alt + shift - 5 : yabai -m window --space 5
alt + shift - 6 : yabai -m window --space 6
alt + shift - 7 : yabai -m window --space 7
alt + shift - 8 : yabai -m window --space 8
alt + shift - 9 : yabai -m window --space 9
ctrl + shift - 1 : yabai -m window --space 1 && yabai -m space --focus 1
ctrl + shift - 2 : yabai -m window --space 2 && yabai -m space --focus 2
ctrl + shift - 3 : yabai -m window --space 3 && yabai -m space --focus 3
ctrl + shift - 4 : yabai -m window --space 4 && yabai -m space --focus 4
ctrl + shift - 5 : yabai -m window --space 5 && yabai -m space --focus 5
ctrl + shift - 6 : yabai -m window --space 6 && yabai -m space --focus 6
ctrl + shift - 7 : yabai -m window --space 7 && yabai -m space --focus 7
ctrl + shift - 8 : yabai -m window --space 8 && yabai -m space --focus 8
ctrl + shift - 9 : yabai -m window --space 9 && yabai -m space --focus 9
# Rotate windows clockwise and anticlockwise (旋转窗口)
cmd + shift - e : yabai -m space --rotate 90
cmd + shift - r : yabai -m space --rotate 270
# float / Unfloat window (切换窗口浮动)
ctrl + alt - space : yabai -m window --toggle float ; yabai -m window --grid 12:12:1:1:9:9
# ================================ 打开终端 ================================
# 启动终端
cmd + shift - return : open -a kitty
cmd + shift - w : open -a wechat
cmd + shift - m : open -a mattermost
cmd + shift - c : open -a google\ chrome
cmd + shift - s : open -a safari
# ================================ 窗口设置 ================================
# =============== 为了避免快捷键冲突改用了 ctrl 作为 modifier =================
# ctrl + e 切换为平铺模式
ctrl - e : yabai -m space --layout bsp
# ctrl + s 切换为堆叠模式
ctrl - s : yabai -m space --layout stack
# 浮动/不浮动窗口 float
ctrl - f : yabai -m window --toggle float
# ================================ 多桌面配置 ================================
# 创建一个新桌面,并把当前活动的窗口发送到新桌面,并且自动跳转到新桌面. 需要 jq 支持 brew install jq
shift + alt - n : index="$(yabai -m query --spaces --display | jq '.| length')" && yabai -m space --create && yabai -m window --space "${index}" && yabai -m space --focus "${index}" && yabai -m space --layout bsp
# 在 stack 模式下通过方向键切换窗口
cmd - j : yabai -m window --focus stack.next || yabai -m window --focus south
cmd - k : yabai -m window --focus stack.prev || yabai -m window --focus north
# 在 bsp 模式下通过方向键切换窗口
cmd - h : yabai -m window --focus west
cmd - l : yabai -m window --focus east
# send window to next monitor and follow focus (将窗口发送到另一个显示器)
ctrl + alt - left : sh ~/.config/dotfiles/yabai/script/move_window_to_left.sh display
ctrl + alt - right : sh ~/.config/dotfiles/yabai/script/move_window_to_right.sh display