-
Notifications
You must be signed in to change notification settings - Fork 0
/
config
251 lines (222 loc) · 11 KB
/
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Autoload
exec --no-startup-id bash ~/.config/i3/autostart.sh
# Settings
set $terminal alacritty
default_border pixel 3
default_floating_border pixel 3
smart_borders on
gaps inner 10px
# Rules
# WM_CLASS(STRING) = "instance", "class"
# Float and resize and center
for_window [class="spterm"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="Lxappearance"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="Arandr"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="Gnome-tweaks"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="flameshot" title="Save screenshot"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [window_role="GtkFileChooserDialog"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="Virt-manager" title="Virtual Machine Manager"] floating enable, resize set 50 ppt 50 ppt, move position center
for_window [class="ColorPicker"] floating enable, resize set 50 ppt 50 ppt, move position center
# Float and center
for_window [class="wechat"] floating enable, move position center
for_window [class="QQ"] floating enable, move position center
for_window [class="Clash for Windows"] floating enable, move position center
# Only float
for_window [class="flameshot"] floating enable
for_window [class="dosbox"] floating enable
for_window [class="spark-store"] floating enable
for_window [class="baidunetdisk"] floating enable
for_window [class="Yad"] floating enable
for_window [class="feh"] floating enable
# Others
for_window [class="ITK-SNAP"] border normal
set $mod Mod4
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
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"
# Rename
bindsym $mod+Shift+Control+1 rename workspace to $ws1
bindsym $mod+Shift+Control+2 rename workspace to $ws2
bindsym $mod+Shift+Control+3 rename workspace to $ws3
bindsym $mod+Shift+Control+4 rename workspace to $ws4
bindsym $mod+Shift+Control+5 rename workspace to $ws5
bindsym $mod+Shift+Control+6 rename workspace to $ws6
bindsym $mod+Shift+Control+7 rename workspace to $ws7
bindsym $mod+Shift+Control+8 rename workspace to $ws8
bindsym $mod+Shift+Control+9 rename workspace to $ws9
bindsym $mod+Control+Shift+q [workspace="__focused__"] kill
bindsym $mod+r exec --no-startup-id python3 ~/.config/i3/scripts/i3/bulkmove.py
bindsym $mod+g exec --no-startup-id python3 ~/.config/i3/scripts/i3/bulkmove.py -g
bindsym $mod+Shift+g exec --no-startup-id python3 ~/.config/i3/scripts/i3/bulkmove.py -c
# Switch
bindsym $mod+n workspace next
bindsym $mod+p workspace prev
bindsym $mod+Shift+n move container to workspace next; workspace next
bindsym $mod+Shift+p move container to workspace prev; workspace prev
bindsym $mod+Tab workspace back_and_forth
# bindsym Mod1+Tab exec --no-startup-id "killall -s SIGUSR1 i3expod"
bindsym $mod+Ctrl+h exec --no-startup-id python3 ~/.config/i3/scripts/i3/h_l.py -d h
bindsym $mod+Ctrl+l exec --no-startup-id python3 ~/.config/i3/scripts/i3/h_l.py -d l
bindsym $mod+Shift+Ctrl+h exec --no-startup-id python3 ~/.config/i3/scripts/i3/h_l.py -d h -c
bindsym $mod+Shift+Ctrl+l exec --no-startup-id python3 ~/.config/i3/scripts/i3/h_l.py -d l -c
# Resize
bindsym $mod+bracketleft resize shrink width 10 px or 10 ppt
bindsym $mod+bracketright resize grow width 10 px or 10 ppt
bindsym $mod+minus resize shrink height 10 px or 10 ppt
bindsym $mod+equal resize grow height 10 px or 10 ppt
# Scratchpad & Sticky
bindsym $mod+Shift+0 move scratchpad
bindsym $mod+0 scratchpad show; resize set 50 ppt 50 ppt; move position center
bindsym $mod+y exec --no-startup-id python3 ~/.config/i3/scripts/i3/toggle_scratchpad.py spterm
bindsym $mod+Shift+y exec --no-startup-id python3 ~/.config/i3/scripts/i3/toggle_scratchpad.py spterm -c
bindsym $mod+Ctrl+y exec --no-startup-id python3 ~/.config/i3/scripts/i3/toggle_scratchpad.py spterm -r
bindsym $mod+s exec --no-startup-id python3 ~/.config/i3/scripts/i3/toggle_sticky.py
# Flameshot
bindsym $mod+Ctrl+a exec --no-startup-id ~/.config/i3/scripts/i3/flameshot_wrapper.sh gui
bindsym $mod+Shift+Ctrl+a exec --no-startup-id ~/.config/i3/scripts/i3/flameshot_wrapper.sh launcher
bindsym $mod+z exec --no-startup-id bash ~/.config/i3/scripts/i3/flameshot_wrapper.sh gui eng
bindsym $mod+Ctrl+z exec --no-startup-id bash ~/.config/i3/scripts/i3/flameshot_wrapper.sh gui chi_sim
# === Mod1 ===
# Mouse drag
bindsym $mod+Mod1+h exec --no-startup-id xdotool mousedown 1 mousemove_relative -- -1 0 mouseup 1
bindsym $mod+Mod1+j exec --no-startup-id xdotool mousedown 1 mousemove_relative -- 0 1 mouseup 1
bindsym $mod+Mod1+k exec --no-startup-id xdotool mousedown 1 mousemove_relative -- 0 -1 mouseup 1
bindsym $mod+Mod1+l exec --no-startup-id xdotool mousedown 1 mousemove_relative -- 1 0 mouseup 1
# Volume & Brightness
bindsym $mod+Mod1+plus exec --no-startup-id brightnessctl set 5%+
bindsym $mod+Mod1+minus exec --no-startup-id brightnessctl set 5%-
bindsym $mod+Mod1+bracketright exec --no-startup-id amixer -q -M set Master 5%+ unmute && pkill -RTMIN+10 i3blocks
bindsym $mod+Mod1+bracketleft exec --no-startup-id amixer -q -M set Master 5%- unmute && pkill -RTMIN+10 i3blocks
bindsym $mod+Mod1+backslash exec --no-startup-id amixer -q -M set Master toggle && pkill -RTMIN+10 i3blocks
# Ref: https://i3wm.org/docs/userguide.html#client_colors
# class border backgr. text indicator child_border
client.focused #005577b0 #005577b0 #ffffffb0 #2e9ef4b0 #2e9ef4b0
client.unfocused #222222b0 #222222b0 #bbbbbbb0 #5f676ab0 #5f676ab0
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 15
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec --no-startup-id $terminal
# sudo apt install xcwd
bindsym $mod+Shift+Return exec --no-startup-id cd "$(xcwd)" && exec $terminal
# kill focused window
bindsym $mod+Shift+q exec --no-startup-id python3 ~/.config/i3/scripts/i3/kill.py
# start dmenu (a program launcher)
# bindsym $mod+d exec --no-startup-id dmenu_run -fn monospace:size=17
bindsym $mod+d exec --no-startup-id rofi -show combi -font "monospace 15"
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h exec --no-startup-id python3 ~/.config/i3/scripts/i3/move.py 'left'
bindsym $mod+Shift+j exec --no-startup-id python3 ~/.config/i3/scripts/i3/move.py 'down'
bindsym $mod+Shift+k exec --no-startup-id python3 ~/.config/i3/scripts/i3/move.py 'up'
bindsym $mod+Shift+l exec --no-startup-id python3 ~/.config/i3/scripts/i3/move.py 'right'
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+v split h
# split in vertical orientation
bindsym $mod+b split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+s layout stacking
bindsym $mod+w exec --no-startup-id python3 ~/.config/i3/scripts/i3/toggle_tabbed.py
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space fullscreen disable; sticky disable; floating toggle; resize set 50 ppt 50 ppt; move position center
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+x focus child
# switch to workspace
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
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec --no-startup-id bash ~/.config/i3/scripts/i3/exit.sh
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3blocks -c ~/.config/i3/i3blocks.conf
i3bar_command i3bar -t
position top
# Ref: https://i3wm.org/docs/userguide.html#_colors
colors {
background #222222b0
statusline #bbbbbbb0
# <colorclass> <border> <background> <text>
focused_workspace #005577b0 #005577b0 #ffffffb0
active_workspace #5f676ab0 #5f676ab0 #ffffffb0
inactive_workspace #222222b0 #222222b0 #bbbbbbb0
urgent_workspace #900000b0 #900000b0 #ffffffb0
binding_mode #900000b0 #900000b0 #ffffffb0
}
tray_output primary
workspace_min_width 40
}