-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi3-config
executable file
·213 lines (172 loc) · 7.17 KB
/
i3-config
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# http://i3wm.org/docs/userguide.html
# Mod1 = alt (aka meta)
# Mod2 = number lock
# Mod4 = super (aka windows)
# Mod5 = level 3 shift (aka AltGr, Opt)
set $mod Mod1
workspace_layout tabbed
# 這種字體被廣泛安裝,提供了大量的 unicode 字形、從右到左的文字渲染以及在
# retina/hidpi 顯示器上的可擴展性(感謝 pango)。 此尺寸用於 I3 選項卡
font pango:DejaVu Sans Mono 10
# 使用滑鼠+$mod將浮動視窗拖曳到想要的位置您也可以使用$mod+右鍵單擊來調整浮動視窗的大小
floating_modifier $mod
bindsym $mod+Return exec $HOME/.scripts/choose_terminal.sh
bindsym $mod+Shift+semicolon kill
bindsym $mod+h split h
bindsym $mod+v split v
bindsym Mod1+Mod4+f fullscreen toggle
bindsym Mod1+Mod4+s layout stacking
bindsym Mod1+Mod4+w layout tabbed
bindsym Mod1+Mod4+e layout toggle split
bindsym $mod+Shift+space floating toggle
# 在平鋪/浮動視窗之間更改焦點
bindsym $mod+space focus mode_toggle
bindsym $mod+p focus child
set $ws0 "0"
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $wsq "q"
set $wsw "w"
set $wse "e"
set $wsr "r"
set $wsa "a"
set $wss "s"
set $wsf "f"
set $wsg "g"
# 切換到工作區
bindsym $mod+grave workspace $ws0
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+q workspace $wsq
bindsym $mod+w workspace $wsw
bindsym $mod+e workspace $wse
bindsym $mod+r workspace $wsr
bindsym $mod+a workspace $wsa
bindsym $mod+s workspace $wss
bindsym $mod+f workspace $wsf
bindsym $mod+g workspace $wsg
# 將焦點容器移到工作區
bindsym $mod+Shift+grave move container to workspace $ws0
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
bindsym $mod+Shift+q move container to workspace $wsq
bindsym $mod+Shift+w move container to workspace $wsw
bindsym $mod+Shift+e move container to workspace $wse
bindsym $mod+Shift+r move container to workspace $wsr
bindsym $mod+Shift+a move container to workspace $wsa
bindsym $mod+Shift+s move container to workspace $wss
bindsym $mod+Shift+f move container to workspace $wsf
bindsym $mod+Shift+g move container to workspace $wsg
# 就地重新啟動 i3(保留您的佈局/會話,可用於升級 i3)
bindsym Mod1+Mod4+r restart
# exit i3(退出 X 會話)
bindsym Mod1+Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# 調整視窗大小(您也可以使用滑鼠)
mode "resize" {
# 按下左鍵將縮小視窗的寬度。
# 按下向右將增加視窗的寬度。
# 向上按會縮小視窗的高度。
# 按下將增加視窗的高度。
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# 恢復正常:進入或退出
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym Mod1+Mod4+k mode "resize"
bindsym Mod1+z mode "lite"
mode "lite" {
bindsym Mod1+x mode "default"
bindsym $mod+Shift+Left exec focus parent; focus left
bindsym $mod+Shift+Right exec focus parent; focus right
}
bindsym $mod+Shift+Left exec focus parent; focus left
bindsym $mod+Shift+Right exec focus parent; focus right
new_window 1pixel
# 顏色 邊界 背景 文字 指標
client.focused #000000 #000000 #ffffff #000000
client.focused_inactive #000000 #222222 #ffffff #222222
client.unfocused #888888 #666666 #ffffff #222222
client.urgent #900000 #900000 #ffffff #900000
bindsym --release $mod+Shift+m exec "$HOME/.displays/same.sh &>> /tmp/i3-log"
bindsym --release $mod+m exec "$HOME/.displays/right.sh &>> /tmp/i3-log"
bindsym --release $mod+Shift+o exec "systemctl suspend &>> /tmp/i3-log"
bindsym --release $mod+Shift+n exec "dunstctl set-paused true; notify-send 'Time' &>> /tmp/i3-log"
bindsym --release $mod+Shift+h exec "i3-msg move workspace to output left &>> /tmp/i3-log"
bindsym --release $mod+Shift+l exec "i3-msg move workspace to output right &>> /tmp/i3-log"
# 運行 xprop 以取得班級或頭銜
assign [class="Google Chrome"] $ws2
assign [class="Slack"] $ws4
assign [title="Zoom"] $ws5
for_window [title="LibreOffice"] move workspace $wsr
for_window [title="鎖定畫面 — 1Password"] floating enable, move workspace $wsf
for_window [title="Zoom"] floating disable
for_window [title="Android Emulator"] floating enable
for_window [title="Android Virtual Device Manager"] floating enable
for_window [title="ImageMagick"] floating enable, move position 0 0
bindsym Mod4+BackSpace kill
bindsym --release Mod1+Shift+b exec "$HOME/development/environment/src/scripts/misc/take_screenshot.sh &>> /tmp/i3-log"
bindsym Mod1+d exec "rofi -show combi -font 'hack 20' -combi-modi drun,window,ssh"
bindsym Mod1+c exec "rofi -show window -font 'hack 20' -theme-str 'window { background-color:#cfc;}'"
bindsym Mod1+Shift+d exec "rofi -show combi -font 'hack 20' -combi-modi drun,window,ssh \
-run-command 'lxqt-sudo {cmd}' -theme-str 'window { background-color:#fcc;}'"
bindsym $mod+Tab workspace back_and_forth
bar {
binding_mode_indicator no # 否則改變模式時顯示緊急
font pango:Monospace 10
mode hide
status_command i3blocks
modifier Mod4
separator_symbol " | "
strip_workspace_numbers yes
tray_padding 3
colors {
separator #444444
background #eeeeee
statusline #333333
focused_workspace #cecece #333333 #f1f1f1
active_workspace #333333 #333333 #888888
inactive_workspace #cecece #cecece #000000
urgent_workspace #eb709b #eb709b #ffffff
}
}
bindsym Mod4+Shift+c exec --no-startup-id "i3-msg bar mode toggle"
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% # 增加音量
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% # 降低音量
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # 靜音
exec_always --no-startup-id sh $HOME/.scripts/gui_daemons.sh
exec_always --no-startup-id sh $HOME/development/environment/src/scripts/misc/i3_dock.sh
exec_always --no-startup-id bash -c "/run/current-system/sw/bin/pasystray || true"
exec $HOME/development/environment/src/scripts/misc/wallpaper_update.sh
# 啟動時打開以使用 ssh 訪問
exec /run/current-system/sw/bin/1password