-
Notifications
You must be signed in to change notification settings - Fork 0
/
i3cfg
351 lines (284 loc) · 11 KB
/
i3cfg
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
340
341
342
343
344
345
346
347
348
349
350
351
# vim: foldmethod=marker ft=i3 commentstring=#\ %s
# i3 config file (v4)
set $mod Mod4
# quickswitch from https://github.com/stagnation/quickswitch-for-i3 # fork for workspace numbering in the window names
# fzf_selector from https://github.com/stagnation/floating_fzf
set $quickswitch ~/bin/gits/quickswitch-for-i3/quickswitch.py --dmenu fzf_selector.sh --show-workspace-number
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below. ISO 10646 = Unicode
#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, if you need a lot of unicode glyphs or
# right-to-left text rendering, you should instead use pango for rendering and
# chose a FreeType font, such as:
font pango:DejaVu Sans Mono 9
floating_modifier $mod
focus_follows_mouse no
workspace_auto_back_and_forth yes
new_window pixel 3
set $c_unfocus #4F4445
set $c_focus #ad7094
set $bar_background "#080808"
set $bar_focus "#5f005f"
# colors colours
# class border backgr. text indicator
client.focused $c_focus $c_focus $c_unfocus #beaa10
client.focused_inactive $c_unfocus $c_unfocus #dddddd #181e20
client.unfocused $c_unfocus $c_unfocus #666666 #191d1e
client.urgent #2f343a #900000 #ffffff #900000
# client.background #123456
bindsym $mod+Shift+Return exec /usr/bin/urxvt
# NB(nils): start a terminal with same working dir, using https://github.com/schischi-a/xcwd
bindsym $mod+Return exec ~/bin/newterm.sh
bindsym $mod+Control+Return exec ~/bin/newranger.sh
# move window to new empty workspace
bindsym $mod+Shift+m exec "$quickswitch -je"
bindsym $mod+Shift+q kill
# menmonic: u : urgent
bindsym $mod+u [urgent=latest] focus
# mod+a is the default bind for parrent
bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child
bindsym $mod+space exec fzf_launcher.sh
# quickswitch binds
bindsym $mod+Tab exec $quickswitch
bindsym $mod+m exec $quickswitch -e
bindsym $mod+Control+m exec $quickswitch -et
bindsym $mod+n exec $quickswitch -n
bindsym $mod+p exec $quickswitch -p
# startup items {{{
exec --no-startup-id nm-applet
exec --no-startup-id ~/bin/uskb
exec --no-startup-id sh ~/dotfiles/bin/uskb.sh
exec --no-startup-id redshift -l 59.33:18.07
# xinput settings - disable touchpad tap click
exec --no-startup-id xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Tap Time" 0
# faster key repeat
exec --no-startup-id xset r rate 250 25
exec --no-startup-id feh --bg-center /home/spill/Pictures/withhearstowardnone.jpeg
# }}} startup
# movement {{{
# move 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 move left
bindsym $mod+Shift+J move down
bindsym $mod+Shift+K move up
bindsym $mod+Shift+L move 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
# move current workspace between monitors
bindsym $mod+Control+h move workspace to output left
bindsym $mod+Control+j move workspace to output down
bindsym $mod+Control+k move workspace to output up
bindsym $mod+Control+l move workspace to output right
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod-` workspace 9
# section key, paragraph, keycode 49
bindsym $mod+0x60 workspace 9
# toggle between last workspaces, acute ´ keycode 21
bindsym $mod+0xb4 workspace back_and_forth
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# }}} movement
# split, focus and layout binds {{{
# split in horizontal orientation
bindsym $mod+z split h
bindsym $mod+y split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# 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+d focus child
# toggle focus (for floating or non-floating)
bindsym $mod+Control+space focus mode_toggle
# }}} split, focus layout
bindsym $mod+i exec mpvclip
# bindsym $mod+o exec /home/spill/bin/playclip
# 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 "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'"
# resize mode {{{
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym h resize shrink width 10 px or 10 ppt
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 Shift+H resize shrink width 5 px or 5 ppt
bindsym Shift+J resize grow height 5 px or 5 ppt
bindsym Shift+K resize shrink height 5 px or 5 ppt
bindsym Shift+L resize grow width 5 px or 5 ppt
# same bindings, but for the arrow keys
bindsym 113 resize shrink width 3 px or 3 ppt
bindsym 116 resize grow height 3 px or 3 ppt
bindsym 111 resize shrink height 3 px or 3 ppt
bindsym 114 resize grow width 3 px or 3 ppt
# back to normal: Enter or Escape (control + leftbracket, keycode 34)
bindcode Control+34 mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# }}} resize
# print screen mode {{{
mode "print" {
# --release executes after the key has been released, which should avoid
# errors of "resource is busy" in scrot
# mnemonics:
# * r: region
# * f: full
# * s: screen
bindsym --release r exec sh ~/dotfiles/bin/print-region.sh > /tmp/p.log 2>&1 ; mode "default"
bindsym --release f exec ~/dotfiles/bin/print-screen.sh ; mode "default"
bindsym --release s exec ~/dotfiles/bin/print-screen.sh ; mode "default"
# back to normal: Enter or Escape (control + leftbracket, keycode 34)
bindcode Control+34 mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+o mode "print"
# }}}
# bar settings {{{
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# bar {
# status_command i3status
# workspace_buttons yes
# bindsym button5 nop
# # wheel_up_cmd nop
# # wheel_down_cmd nop
# bindsym button4 nop
# # status_command i3bar.sh
# colors {
# background #000000
# statusline #999999
# separator #000000
# focused_workspace #ffffff #285577
# active_workspace #ffffff #333333
# inactive_workspace #888888 #222222
# urgent_workspace #ffffff #900000
# }
# }
bar {
separator_symbol :
strip_workspace_numbers yes
status_command python3 ~/dotfiles/py3status.py
workspace_buttons yes
colors {
background $bar_background
statusline #7890a0
focused_workspace $bar_focus $bar_focus #000000
active_workspace #ffffff #333333
inactive_workspace $bar_background $bar_background #7890a0
urgent_workspace #ffffff #900000
}
}
# }}} bar
# Scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
bindsym $mod+equal [title="ncmpcpp"] scratchpad show
bindsym $mod+shift+plus [title="mosh"] scratchpad show
# volume key bindings
# -c 1 for sound card with index 1.
bindsym XF86AudioRaiseVolume exec amixer -c 1 -q set Master 3%+ unmute
bindsym XF86AudioLowerVolume exec amixer -c 1 -q set Master 3%- unmute
bindsym XF86AudioMute exec amixer -q -D pulse set Master toggle
# brightness key bindings
bindsym XF86MonBrightnessUp exec /usr/bin/xbacklight -inc 10
bindsym XF86MonBrightnessDown exec /usr/bin/xbacklight -dec 5
# window rules {{{
assign [class="Vlc"] 9
assign [class="mpv"] 9
# fullscreen for games
for_window [title="^Warsow$"] fullscreen
for_window [title="^ioquake3$"] fullscreen
for_window [class="Firefox"] border pixel 3
# for_window [class="^.*"] border pixel 3
# floating enable; move right 400; move down 400
for_window [class = "URxvt" instance = "UrxvtFloat$"] floating enable
# for_window [class = "URxvt" instance = "float_term$"] border 1 pixel ; move scratchpad
# for_window [class = "URxvt" instance = "aelv$"] title_format ">> ssh aelv" ; border normal
# }}} window rules
# marks {{{
# vim-like marks
# bindsym $mod+m exec i3-input -F 'mark %s' -l 1 -P 'Mark: '
# bindsym $mod+n exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Go to: '
# bindsym $mod+Shift+I mark i
bindsym $mod+Shift+G mark g
# bindsym $mod+Shift+Q mark q
# bindsym $mod+Shift+O mark o
# bindsym $mod+Shift+P mark p
# bindsym $mod+Shift+M mark m
bindsym $mod+Shift+semicolon mark ";"
bindsym $mod+Shift+apostrophe mark "'"
bindsym $mod+Shift+comma mark ","
# bindsym $mod+i [con_mark="i"] focus
bindsym $mod+g [con_mark="g"] focus
# bindsym $mod+q [con_mark="q"] focus
# bindsym $mod+o [con_mark="o"] focus
# bindsym $mod+p [con_mark="p"] focus
# bindsym $mod+m [con_mark="m"] focus
bindsym $mod+semicolon [con_mark=";"] focus
bindsym $mod+apostrophe [con_mark="'"] focus
bindsym $mod+comma [con_mark=","] focus
# }}}
# force workspace 2 to internal monitor
# used for IRC
# workspace 2 output eDP1
# i3 gaps {{{
set $gap 10
gaps inner $gap
gaps outer -$gap
smart_gaps on
# }}}