summaryrefslogtreecommitdiff
path: root/.config/i3/config
blob: ef20aa14cadd94a7b48fa8eae1b6cb81f8e23943 (plain)
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Cousine 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 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.

# class                 border  bground text    indicator child_border
client.focused          #000000 #B4EEB4 #000000 #B4EEB4   #000000
client.focused_inactive #000000 #FFFFF6 #000000 #BFBFBF   #E5E5E5
client.unfocused        #000000 #E5E5E5 #000000 #E5E5E5   #E5E5E5
client.urgent           #000000 #900000 #FFFFF6 #900000   #900000
client.placeholder      #000000 #000000 #FFFFF6 #000000   #000000

client.background       #FFFFF6

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# default workspace layout
workspace_layout tabbed

# this is so that C-i o will stay within the same output; I have convenient
# bindings to get to other outputs so no need for directional movement to
# permit moving between outputs (it would be even better if we could just
# toggle this setting around the execution of C-i o, however)
focus_wrapping workspace

# Put bindings I don't need to repeat under C-i, so that we have enough keys
# left on the right hand that caps lock can be our only Super modifier, yet we
# do not need any one-handed chording.  *Only* bindings I might want to hit more
# than once in a row should be outside of this C-i map
mode "Window management" {
	# make a fresh Emacs frame -- typically this gets invoked only on
	# empty workspaces, as otherwise I use commands under `C-x 5` to get
	# more Emacs frames
	bindsym Return exec emacsclient -a "" -nc, mode "default"

        # start a terminal emulator
        bindsym BackSpace exec xfce4-terminal, mode "default"

        # make a fresh browser window
        bindsym b exec firefox -new-window, mode "default"

        # lock screen -- relies on xss-lock
        # note that this won't lock other VTs (lock-session*s*
        # requires root password)
        bindsym l exec loginctl lock-session \
                && sleep 0.5 && xset dpms force standby, \
                mode "default"

        # go to sleep -- xss-lock will lock screen
        bindsym Shift+l exec systemctl suspend, mode "default"

        # kill focused window
        bindsym k kill, mode "default"

        # start dmenu (a program launcher)
        bindsym Shift+p exec dmenu_run \
                -nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000', \
                mode "default"

        # 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 p exec --no-startup-id i3-dmenu-desktop \
                --dmenu="dmenu -i -nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000'", \
                mode "default"

	bindsym s exec dmenu_ssh \
		-nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000', \
                mode "default"

        # split in horizontal orientation
        bindsym h split h, mode "default"

        # split in vertical orientation
        bindsym v split v, mode "default"

        # enter fullscreen mode for the focused container
        bindsym f fullscreen toggle, mode "default"

        # change container layout (stacked, tabbed, toggle split)
        # bindsym s layout stacking, mode "default"
        bindsym w layout tabbed, mode "default"

        # toggle tiling / floating
        bindsym t floating toggle, mode "default"

        # change focus between tiling / floating windows
        bindsym Tab focus mode_toggle, mode "default"

        # focus the parent container
        bindsym a focus parent, mode "default"
	bindsym u focus parent, mode "default"

        # focus the child container
        bindsym d focus child, mode "default"

        # when screen is divided into two containers where at least one has
        # several tabs, as I usually have it on a small laptop screen, this
        # works well to go back and forth
        bindsym o focus parent, focus right, mode "default"

        # switch to workspace
        bindsym 1 workspace 1, mode "default"
        bindsym 2 workspace 2, mode "default"
        bindsym 3 workspace 3, mode "default"
        bindsym 4 workspace 4, mode "default"
        bindsym 5 workspace 5, mode "default"
        bindsym 6 workspace 6, mode "default"
        bindsym 7 workspace 7, mode "default"
        bindsym 8 workspace 8, mode "default"
        bindsym 9 workspace 9, mode "default"
        bindsym 0 workspace 10, mode "default"
        bindsym F1 workspace 11:F1, mode "default"
        bindsym F2 workspace 12:F2, mode "default"
        bindsym F3 workspace 13:F3, mode "default"
        bindsym F4 workspace 14:F4, mode "default"
        bindsym F5 workspace 15:F5, mode "default"
        bindsym F6 workspace 16:F6, mode "default"
        bindsym F7 workspace 17:F7, mode "default"
        bindsym F8 workspace 18:F8, mode "default"
        bindsym F9 workspace 19:F9, mode "default"
        bindsym F10 workspace 20:F10, mode "default"
        bindsym F11 workspace 21:F11, mode "default"
        bindsym F12 workspace 22:F12, mode "default"
        bindsym semicolon workspace back_and_forth, mode "default"

        # move focused container to workspace
        bindsym Shift+1 move container to workspace 1, mode "default"
        bindsym Shift+2 move container to workspace 2, mode "default"
        bindsym Shift+3 move container to workspace 3, mode "default"
        bindsym Shift+4 move container to workspace 4, mode "default"
        bindsym Shift+5 move container to workspace 5, mode "default"
        bindsym Shift+6 move container to workspace 6, mode "default"
        bindsym Shift+7 move container to workspace 7, mode "default"
        bindsym Shift+8 move container to workspace 8, mode "default"
        bindsym Shift+9 move container to workspace 9, mode "default"
        bindsym Shift+0 move container to workspace 10, mode "default"
        bindsym Shift+F1 move container to workspace 11:F1, mode "default"
        bindsym Shift+F2 move container to workspace 12:F2, mode "default"
        bindsym Shift+F3 move container to workspace 13:F3, mode "default"
        bindsym Shift+F4 move container to workspace 14:F4, mode "default"
        bindsym Shift+F5 move container to workspace 15:F5, mode "default"
        bindsym Shift+F6 move container to workspace 16:F6, mode "default"
        bindsym Shift+F7 move container to workspace 17:F7, mode "default"
        bindsym Shift+F8 move container to workspace 18:F8, mode "default"
        bindsym Shift+F9 move container to workspace 19:F9, mode "default"
        bindsym Shift+F10 move container to workspace 20:F10, mode "default"
        bindsym Shift+F11 move container to workspace 21:F11, mode "default"
        bindsym Shift+F12 move container to workspace 22:F12, mode "default"
        bindsym Shift+semicolon move container to workspace back_and_forth, \
                mode "default"

        # next unused workspace
        bindsym j exec --no-startup-id \
                ~/src/dotfiles/bin/i3-fresh-workspace, \
                mode "default"
	# sends window to next unused but doesn't change view to that
	# workspace because this binding is more like C-i [0-9]+ than it is
	# like $mod+Ctrl+j/k
        bindsym Shift+j exec --no-startup-id \
                ~/src/dotfiles/bin/i3-fresh-workspace --send, \
                mode "default"

        # go to windows for tasks without needing to know the workspace
        # bindsym slash exec --no-startup-id rofi -show window, mode "default"
	bindsym slash exec dmenu_window \
		-nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000', \
                mode "default"

        # reload the configuration file -- useful simply to reexecute
        # startup scripts
        bindsym c reload; \
                exec --no-startup-id ~/src/dotfiles/bin/i3-startup-always, \
                mode "default"
        # restart i3 inplace (preserves your layout/session, can be
        # used to upgrade i3)
        bindsym Ctrl+Shift+r restart, mode "default"
        # exit i3 (logs you out of your X session)
        bindsym Ctrl+Shift+e exec i3-quit, mode "default"

        bindsym g mode "Launch program"

        # bindsym bracketleft exec debian-ftp-master-cut-note, mode "default"
        bindsym Shift+bracketleft exec xdo-evince-highlight, mode "default"

        # Workspaces do not ever get assigned to particular purposes / windows
        # don't get assigned to particular workspaces.  If I can't find where
        # I was working on something, there's my bindings to `workspace
        # {next,prev}_on_output`.  Long-running processes like builds, for
        # example, stay in the workspace(s) where I'm working on that
        # task/project
        #
        # Instead of having them on a dedicated workspace, windows that are
        # almost always open should be put on the scratcpad.
        #
        # Note that we have to move to scratchpad at startup ('move to
        # scratchpad' below), or the toggle key won't work.
        #
        # Once every so often I'll have to launch the program, and then
        # immediately use the toggle key to make it visible.  This is a bit
        # inelegant, but much more reliable than binding the key to a script
        # which starts the program if it's not around and otherwise toggles

        # calendar, contacts & some HTML mail
        bindsym Shift+r exec evolution, mode "default"
        # bindsym r [class="Evolution" title=" — Evolution$"] \
        #         scratchpad show, mode "default"
	bindsym r [class="Evolution" title=" — Evolution$"] focus , mode "default"

        # chat
        bindsym Shift+n exec xfce4-terminal \
                --title="irssi" -x /bin/sh -c "mosh athena /home/spwhitton/src/dotfiles/bin/ii", \
                mode "default"
        bindsym n [class="^Xfce4-terminal$" title="^irssi$"] scratchpad show, \
                mode "default"

	# bindsym space mode "Move focus/windows"
	# bindsym Shift+space mode "Move focus/windows"

	bindsym Shift+b bar hidden_state toggle, mode "default"

	# This says: resize so that an Emacs window taking up the rest of the
	# width has (eq (frame-width) 160).  So should be <<33.  The value 32
	# is for my monitor in Tucson.  We don't choose this value with any
	# hope of fitting 80 columns into the smaller window, note, though
	# sometimes we'll be able to.  Idea is to have something we want to
	# stay visible in the right split and Emacs frame where we're doing
	# most of our work taking up the larger portion of the screen, and
	# such that Emacs will prefer to split horizontally to pop to or
	# display other buffers
	bindsym minus resize set width 32 ppt, mode "default"
	# And this says ensure that the current window can be an Emacs frame
	# with at least 80 columns (again value is based on Tucson monitor)
	bindsym equal resize set width 35 ppt, mode "default"

        bindsym space mode "default"
        bindsym Ctrl+g mode "default"
}
# C-i is perfect for window manager bindings because it will never be
# bound in my Emacs config, as text terminals typically cannot
# distinguish between <tab> and C-i
bindsym Ctrl+i mode "Window management"

# mode "Move focus/windows" {
#         # bullseye: 'focus next' maybe
#         bindsym f focus right
#         # bullseye: 'focus prev' maybe
# 	bindsym b focus left
# 	bindsym n focus down
# 	bindsym p focus up
# 	bindsym a workspace prev_on_output
# 	bindsym e workspace next_on_output
# 	bindsym z focus output left
# 	bindsym x focus output right

# 	bindsym Shift+f move right
# 	bindsym Shift+b move left
# 	bindsym Shift+n move down
# 	bindsym Shift+p move up
# 	bindsym Shift+a move container to workspace prev_on_output
# 	bindsym Shift+e move container to workspace next_on_output
# 	bindsym Shift+z move workspace to output left
# 	bindsym Shift+x move workspace to output right

#         bindsym --release space mode "default"
# 	bindsym --release Shift+space mode "default"
# }

# see above for commentary on these (they have to be outside the C-i
# mode definition)
# for_window [class="Evolution"] floating enable
# for_window [class="Evolution" title=" — Evolution$"] resize set 1200 700, \
#            move position 50 50, move to scratchpad
for_window [class="^Xfce4-terminal$" title="^irssi$"] floating enable, \
           resize set 1000 600, move position 100 100, move to scratchpad

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus right
bindsym $mod+n focus down
bindsym $mod+p focus up
# 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+Ctrl+j move left
bindsym $mod+Ctrl+k move right
bindsym $mod+Ctrl+n move down
bindsym $mod+Ctrl+p move up
# bindsym $mod+Ctrl+Left move left
# bindsym $mod+Ctrl+Down move down
# bindsym $mod+Ctrl+Up move up
# bindsym $mod+Ctrl+Right move right

bindsym $mod+apostrophe layout toggle split

# Cycle through all workspaces on monitor.  Unlike C-i j and C-i [0-9]+, these
# move the container *and* switch view to the other workspace, because there
# are more like $mod+Ctrl+j/k than they are like the C-i bindings
bindsym $mod+comma workspace prev_on_output
bindsym $mod+period workspace next_on_output
bindsym $mod+Ctrl+less move container to workspace prev_on_output, \
        workspace prev_on_output
bindsym $mod+Ctrl+greater move container to workspace next_on_output, \
        workspace next_on_output

# # move focus between monitors -- if we have more than one monitor, we
# # probably have a numeric keypad available.
# # subtleties: <https://github.com/i3/i3/issues/2558>
# bindsym $mod+Mod2+KP_4 focus output left
# bindsym $mod+KP_Left focus output left
# bindsym $mod+Mod2+KP_6 focus output right
# bindsym $mod+KP_Right focus output right

# # move focused workspace between monitors
# bindsym $mod+Ctrl+Mod2+KP_Left move workspace to output left
# bindsym $mod+Ctrl+KP_4 move workspace to output left
# bindsym $mod+Ctrl+Mod2+KP_Right move workspace to output right
# bindsym $mod+Ctrl+KP_6 move workspace to output right

bindsym $mod+i focus output left
bindsym $mod+Ctrl+i move workspace to output left
bindsym $mod+o focus output right
bindsym $mod+Ctrl+o move workspace to output right

# toggle music
bindsym Print exec mpc toggle

# # 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 j resize shrink width 10 px or 10 ppt
#         bindsym k resize grow height 10 px or 10 ppt
#         bindsym l resize shrink height 10 px or 10 ppt
#         bindsym semicolon resize grow width 10 px or 10 ppt

#         # same bindings, but for the arrow keys
#         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

#         # back to normal: Enter or Escape
#         bindsym Return mode "default"
#         bindsym Escape mode "default"
# }

# bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        # i3status is designed to be highly performant so it continues
        # to be refreshed when the system is under load; we're giving
        # up some of that with i3status-wrapper, but let's see if it
        # actually matters
        status_command i3status | i3status-wrapper

        # default behaviour is to cycle through workspaces when scroll
        # wheel is used on the bar.  However, don't think I've ever
        # used this deliberately, and often I do it by mistake, so
        # let's disable it
        bindsym button4 nop
	bindsym button5 nop

        colors {
            background #FFFFF6
            statusline #000000
            separator  #000000

            focused_workspace  #000000 #B4EEB4 #000000
            active_workspace   #000000 #FFFFF6 #000000
            inactive_workspace #000000 #E5E5E5 #000000
            urgent_workspace   #000000 #900000 #FFFFF6
            binding_mode       #000000 #900000 #FFFFF6
        }

        position bottom
        strip_workspace_numbers yes

	tray_output primary
}

# single key launching
mode "Launch program" {
        # start a graphical file manager
        bindsym g exec thunar , mode "default"

        # launch xrandr graphical config
        # bindsym x exec arandr , mode "default"
	bindsym x exec xfce4-display-settings , mode "default"

        # launch mpd client
        bindsym m exec xfce4-terminal -e ncmpcpp , mode "default"

        # # get a new VT from lightdm
        # bindsym g exec dm-tool switch-to-greeter , mode "default"

        # open virt-viewer pointed at develacc
        bindsym d exec develacc-please , mode "default"

        # connect to Debian's ftp-master server for ftpteam work
        bindsym f mode "ftp-master"

        # adjust volume
        bindsym v exec xfce4-terminal -e alsamixer , mode "default"

	bindsym t exec xfce4-terminal -e top , mode "default"

        # passwords
        bindsym p exec impass gui , mode "default"

	# work around bugs -- this fixes Emacs suddenly not accepting any
	# keyboard input until a new frame is opened and then closed using
	# emacsclient(1)
	bindsym i exec ibus restart , mode "default"

        bindsym Ctrl+g mode "default"
}

mode "ftp-master" {
     bindsym f exec debian-ftp-master , mode "default"

     bindsym n exec debian-ftp-master-cut-note , mode "default"

     bindsym Ctrl+g mode "default"
}

# # managing outputs (thanks h01ger and Qubes i3 config)
# set $mode_display Manage displays: (j/k) VGA on/off  (n/m) laptop display on/off  (x) arandr
# mode "$mode_display" {
#         bindsym j exec --no-startup-id xrandr --output VGA-1  --auto --left-of LVDS-1, exec ~/src/dotfiles/bin/i3-startup-always, mode "default"
#         bindsym n exec --no-startup-id xrandr --output LVDS-1 --auto, exec ~/src/dotfiles/bin/i3-startup-always, mode "default"
#         bindsym k exec --no-startup-id xrandr --output VGA-1  --auto --off, exec ~/src/dotfiles/bin/i3-startup-always, mode "default"
#         bindsym m exec --no-startup-id xrandr --output LVDS-1  --auto --off, exec ~/src/dotfiles/bin/i3-startup-always, mode "default"

#         # launch xrandr graphical config
#         bindsym x exec arandr , mode "default"

#         bindsym Ctrl+g mode "default"
# }

# bindsym $mod+x mode "$mode_display"

# audio
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle

# idempotent settings script
exec_always --no-startup-id ~/src/dotfiles/bin/i3-startup-always

# do-it-once settings and startup script
exec --no-startup-id ~/src/dotfiles/bin/i3-startup-once

popup_during_fullscreen leave_fullscreen

# windows that should always float
for_window [title="^vokoscreen"] floating enable
for_window [title="vokoscreen webcam"] border pixel 1
for_window [title="^Ediff"] floating enable
for_window [class="Impass"] floating enable

# # i3 titlebars are not very useful for Emacs frames; let's have an extra line
# # of buffer text
# for_window [class="^Emacs"] border pixel 2