-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi3config
339 lines (266 loc) · 10.9 KB
/
i3config
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# 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 http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# color config
set $bg-color #eeeeee
set $bg-color-highlight #eeeeee
set $inactive-bg-color #000000
set $text-color #000000
set $inactive-text-color #cccccc
set $urgent-bg-color #E53935
# window colors
# border background text indicator
client.focused $bg-color-highlight $bg-color $text-color #999999
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #999999
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #999999
client.urgent $urgent-bg-color $urgent-bg-color $text-color #999999
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# font pango: System San Francisco Display 10
# 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 10
# Leave fullscreen on encountering popups
popup_during_fullscreen leave_fullscreen
# No title bars.
new_window pixel 2
# Setup borders
hide_edge_borders none
# Set max float size
floating_maximum_size 5000 x 5000
# NUMERIC SHORTCUTS
# -----------------
# TODO: Make snippets a part of copyq
bindsym $mod+1 exec "$HOME/dotfiles/utils/snippets.py"
bindsym $mod+2 exec emacsclient -c -e '(mu4e-compose-new)'
bindsym $mod+3 exec --no-startup-id "~/dotfiles/utils/search_mail.sh"
bindsym $mod+4 exec --no-startup-id "~/dotfiles/utils/add_journal.sh"
bindsym $mod+5 exec --no-startup-id "~/dotfiles/utils/add_task.sh"
bindsym $mod+6 exec "~/dotfiles/utils/term.sh"
# bindsym $mod+Shift+6 exec gnome-terminal -e "bash"
bindsym $mod+7 exec "~/dotfiles/utils/open-chrome.sh"
bindsym $mod+Shift+7 exec "~/dotfiles/utils/search-chrome.sh"
bindsym $mod+8 exec emacsclient -c --alternate-editor=""
# FOCUS KEYBINDINGS
# -----------------
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+h focus left
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+d focus child
# focus the alerted window
bindsym $mod+y [urgent=latest] focus
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# Move to the other workspace
bindsym $mod+o move workspace to output left
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# Make current container a centered, floating column.
bindsym $mod+c floating enable; resize set 1000 1900; move position center
# List/edit keybindings
bindsym $mod+slash exec "$HOME/dotfiles/utils/i3_keybindings.sh"
# move focused window
bindsym $mod+Shift+j move down 200 px
bindsym $mod+Shift+k move up 200 px
bindsym $mod+Shift+l move right 200 px
bindsym $mod+Shift+h move left 200 px
# kill focused window
bindsym $mod+Shift+q kill
# MODALS
# ------
# Enter focused mode for current container.
bindsym $mod+Shift+f exec "$HOME/dotfiles/utils/focus.sh"
# Select working mode
bindsym $mod+Shift+m exec "$HOME/dotfiles/utils/projects.sh"
# Clipboard manager
bindsym $mod+Shift+c exec "copyq show '&clipboard'"
# Cycle wallpaper
bindsym $mod+Shift+w exec "feh --randomize --bg-fill ~/Wallpapers/* &"
# CHANGE LAYOUTS
# --------------
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking; \
exec "notify-send 'Enabled stacked layout' --expire-time=2000"
bindsym $mod+t layout tabbed; \
exec "notify-send 'Enabled tabbed layout' --expire-time=2000"
bindsym $mod+e layout toggle split; \
exec "notify-send 'Enabled split layout' --expire-time=2000"
# Make current window a container and apply layout.
bindsym $mod+Shift+s split v; layout stacking; \
exec "notify-send 'This is now a stacked container.' --expire-time=2000"
bindsym $mod+Shift+t split v; layout tabbed; \
exec "notify-send 'This is now a tabbed container.' --expire-time=2000"
bindsym $mod+Shift+e split v; \
exec "notify-send 'This is now a split container.' --expire-time=2000"
# shortcut for picture-in-picture
# Float, resize, reposition and make sticky.
bindsym $mod+Shift+i floating enable; resize set 900 600; move absolute position 1500 px 900 px; sticky enable
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# lock machine
bindsym $mod+x exec "~/dotfiles/utils/screen-lock"
# suspend
bindsym $mod+Shift+x exec i3lock --color 475263 && dbus-send --system \
--dest=org.freedesktop.UPower --type=method_call --print-reply \
/org/freedesktop/UPower org.freedesktop.UPower.Suspend
# lock automatically after inactivity
exec xautolock -time 4 -locker "~/dotfiles/utils/screen-lock" &
# MOUSE BINDINGS
# --------------
# toggle floating with right click
bindsym button3 floating toggle
# middle click to kill window
bindsym button2 kill
# Switch and kill windows
bindsym $mod+Return exec --no-startup-id "rofi -combi-modi window,drun -show combi -modi combi"
# Workspace 6 is the window purgatory.
bindsym $mod+Shift+1 move to workspace 6
# Workspace 8 is special - float everything in that ws.
for_window [workspace="8"] floating enable
# APP-SPECIFIC BEHAVIORS
# ----------------------
for_window [class="copyq"] floating enable
for_window [class="copyq"] resize set 1500 1000
for_window [class="copyq"] move position center
for_window [title="Signal" class="Google-chrome"] floating enable
for_window [title="Synergy"] floating enable
for_window [class="Gvim"] floating enable
for_window [class="Gvim"] move position center
for_window [class="Gnome-terminal"] floating enable
for_window [class="Gnome-terminal"] resize set 1600 1000
for_window [class="Gnome-terminal"] move position center
for_window [class="Gnome-terminal"] move scratchpad
# SCRATCHPAD
# ----------
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus [class="Gnome-terminal"] scratchpad show
bindsym $mod+0 [class="Google-chrome"] scratchpad show
bindsym $mod+apostrophe scratchpad show
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# power menu
bindsym $mod+Shift+p exec "$HOME/dotfiles/utils/power_menu"
# passthrough mode (pass through i3 keybindings).
mode "passthrough" {
bindsym Escape mode "default"
}
bindsym $mod+p mode "passthrough"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing down will grow the window’s height.
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym h resize shrink width 10 px or 10 ppt
bindsym Shift+j resize grow height 150 px or 150 ppt
bindsym Shift+k resize shrink height 150 px or 150 ppt
bindsym Shift+l resize grow width 150 px or 150 ppt
bindsym Shift+h resize shrink width 150 px or 150 ppt
# blow up window (for floating windows)
bindsym b resize set 1600 1400; move absolute position center
# resize to a standard column
bindsym c floating enable; resize set 1000 1900; move position center
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
mode "mouse" {
set $slow 5
set $quick 100
set $fast 200
# Mouse movement (slow/fine-tuned) -- vim keybindings
bindsym Shift+h exec xdotool mousemove_relative -- -$slow 0
bindsym Shift+j exec xdotool mousemove_relative 0 $slow
bindsym Shift+k exec xdotool mousemove_relative -- 0 -$slow
bindsym Shift+l exec xdotool mousemove_relative $slow 0
# Mouse movement (quicker) -- vim keybindings
bindsym h exec xdotool mousemove_relative -- -$quick 0
bindsym j exec xdotool mousemove_relative 0 $quick
bindsym k exec xdotool mousemove_relative -- 0 -$quick
bindsym l exec xdotool mousemove_relative $quick 0
# Mouse movement (fast) -- vim keybindings
bindsym Control+h exec xdotool mousemove_relative -- -$fast 0
bindsym Control+j exec xdotool mousemove_relative 0 $fast
bindsym Control+k exec xdotool mousemove_relative -- 0 -$fast
bindsym Control+l exec xdotool mousemove_relative $fast 0
# Left Click
bindsym f exec xdotool click 1
# Middle Click
bindsym d exec xdotool click 2
# Right Click
bindsym s exec xdotool click 3
# Left Click-and-drag
bindsym Shift+f exec xdotool mousedown 1
# Middle Click-and-drag
bindsym Shift+d exec xdotool mousedown 2
# Right Click-and-drag
bindsym Shift+s exec xdotool mousedown 3
# Left Drag release
bindsym Control+f exec xdotool mouseup 1
# Middle Drag release
bindsym Control+d exec xdotool mouseup 2
# Right Drag release
bindsym Control+s exec xdotool mouseup 3
# return to normal keybindings -- IMPORTANT!!
bindsym Escape mode "default"
}
bindsym $mod+m mode "mouse"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
font pango: Cousine for Powerline 10
status_command i3blocks || i3status
#tray_output primary
colors {
background $inactive-bg-color
separator #757575
# border background text
focused_workspace $bg-color-highlight $bg-color $text-color
inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $text-color
}
position bottom
mode hide
modifier Control
workspace_buttons no
binding_mode_indicator yes
}
# Add keybindings for media and special function keys.
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/dotfiles/utils/volume up 5%
bindsym XF86AudioLowerVolume exec --no-startup-id ~/dotfiles/utils/volume down 5%
bindsym XF86AudioMute exec --no-startup-id ~/dotfiles/utils/volume mute
# Screen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 1 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 1 # decrease screen brightness
# Touchpad controls
# bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# Run startup programs
exec --no-startup-id ~/startup.sh
# Machine specific commands
exec --no-startup-id ~/startup.local.sh
# Run small i3 customizations.
exec_always --no-startup-id ~/py3env/bin/python3 ~/dotfiles/utils/i3utils.py
# i3gaps settings.
# gaps inner 15
# gaps outer 0