-
Notifications
You must be signed in to change notification settings - Fork 1
/
i3config
327 lines (271 loc) · 11 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
# -*- mode: conf -*-
#=======================================================================
# i3 config file
#=======================================================================
# put it in ~/.config/i3/ or ~/.i3/config
#=======================================================================
# Basics
#=======================================================================
# I use the superkey, you can also use Alt
set $mod Mod4
#=======================================================================
# Window management
#=======================================================================
# vim keybindings
set $left h
set $down j
set $up k
set $right l
#exec xrdb ~/.Xresources # load urxvt customisations
#exec sh ~/.profile # load environment variables
## get colours/bg from pywal
#include "$HOME/.cache/wal/colors sway"
#client.focused $color0 $color9 $foreground $color7 $color7
#client.focused_inactive $color0 $background $foreground $color7 $color7
### Key bindings
#
# Basics:
#
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# smart dmenu
set $mod+d exec /usr/bin/rofi -show run
#bindsym $mod+d exec /usr/bin/dmenu_run -b "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
#| rofi -dmenu
# reload the configuration file
bindsym $mod+Shift+c 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'"
#
# Moving around:
#
# change focus
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+$left move left 30
bindsym $mod+Shift+$down move down 30
bindsym $mod+Shift+$up move up 30
bindsym $mod+Shift+$right move right 30
#
# Workspaces:
#
# workspace gaps
set $ws1 "1:term"
set $ws2 "2:web"
set $ws3 "3:emacs"
set $ws4 "4:refs"
set $ws5 "5:slack"
set $ws6 "6:inkscape"
set $ws7 "7:vid"
set $ws8 "8:windows"
set $ws9 "9:graphs"
set $ws10 "10:spotify"
# assign workspaces to screens
set $smallscreen LVDS1
set $bigscreen VGA1
# assign workspaces to screens
#workspace $ws1 output $smallscreen
workspace $ws2 output $bigscreen
workspace $ws3 output $bigscreen
workspace $ws4 output $bigscreen
workspace $ws7 output $bigscreen
#workspace $ws9 output $smallscreen
#workspace $ws10 output $smallscreen
# 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
bindsym $mod+0 workspace $ws10
# switch to previous workspace by repeatedly tapping
workspace_auto_back_and_forth yes
# move focused container to workspace
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
### move programs to specific workspaces ###
assign [class="^Mendeley Desktop$"] $ws4
assign [class="^Zotero$"] $ws4
assign [class="^Slack$"] $ws5
assign [class="^Riot$"] $ws5
assign [class="^Trello$"] $ws5
assign [class="^Inkscape$"] $ws6
assign [class="^Kodi$"] $ws7
assign [class="^VirtualBox$" title="^Win10"] $ws8
assign [class="R_x11"] $ws9
# doesn't work because of long-standing spotify bug
#assign [class="Spotify"] $ws10
for_window [class="Spotify"] move container to workspace $ws10
### make programs floating ###
# pop-up windows are always floating
#for_window [window_role="pop-up"] floating enable
# Bubble windows (chrome notifications) are always floating
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="dialog"] floating enable
for_window [window_role="menu"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [class="^Gnome-calculator"] floating enable sticky enable
for_window [class="Lxappearance"] floating enable sticky enable border normal
for_window [class="Arandr"] floating enable
for_window [class="albert"] move position center
for_window [instance="emacs-popup"] floating enable
for_window [instance="capture"] floating enable
# enter fullscreen mode for the focused container
#
# Layout stuff:
#
bindsym $mod+v splitv
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+f fullscreen toggle
# 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
# make current window sticky
bindsym $mod+Shift+s sticky toggle
# focus the child container
#bindsym $mod+d focus child
#
# Scratchpad:
#
# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# show next scratchpad window or hide focused scratchpad window
# cycle if there are multiple
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
# resize window (you can also use the mouse on a border)
bindsym $mod+Shift+y resize shrink width 20 px or 20 ppt
bindsym $mod+Shift+u resize grow height 20 px or 20 ppt
bindsym $mod+Shift+i resize shrink height 20 px or 20 ppt
bindsym $mod+Shift+o resize grow width 20 px or 20 ppt
# mouse modifier
floating_modifier $mod
# media keys
# Increase volume
bindsym XF86AudioRaiseVolume exec "amixer set Master 2%+ && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
bindsym XF86AudioLowerVolume exec "amixer set Master 2%- && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
bindsym XF86AudioMute exec "amixer set Master toggle && if amixer get Master | grep -Fq '[off]'; then volnoti-show -m; else volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1); fi"
# Suspend also locks
bindsym XF86Sleep exec "systemctl suspend"
bindsym XF86AudioPlay exec playerctl play-pause
#bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioMicMute exec amixer set Capture toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
bindsym XF86Display exec arandr
bindsym XF86WLAN exec sudo systemctl restart NetworkManager
bindsym XF86Tools exec lxappearance
# bindsym XF86Bluetooth
# Lock the desktop
bindsym $mod+Delete exec i3lock -c 000000
#~/ArchConfigs/launchi3lock.sh #&& sudo sh -c "echo mem > /sys/power/state
# launch
# keybinding software mnemonic(ish?)
bindsym $mod+b exec firefox # firefox browser
bindsym $mod+x exec nautilus # xxx file manager
bindsym $mod+m exec emacsclient -c -n -e '(switch-to-buffer nil)' # emacs
bindsym $mod+c exec emacsclient -e '(make-capture-frame)'
bindsym $mod+i exec inkscape
#bindsym $mod+s exec slack # slack messages
bindsym $mod+o exec libreoffice # office
# Take a screenshot with scrot
bindsym --release Print exec "scrot -b ~/Pictures/Screenshots/%Y-%m-%d-%T.png"
bindsym --release Shift+Print exec "scrot -s ~/Pictures/Screenshots/%Y-%m-%d-%T-region.png"
exec --no-startup-id nm-applet # NetworkManager applet
exec volnoti # volume change notification
exec --no-startup-id redshift-gtk -l 52.1:5.12 -m randr -t 5500:2500
exec owncloud
#exec spotify
exec dunst # notification daemon
exec --no-startup-id flashfocus
# screenlayout created w/ arandr
exec_always --no-startup-id ~/.screenlayout/atHome.sh
# backgrounds for two monitors
exec_always --no-startup-id nitrogen --restore
exec --no-startup-id xedgewarp -b # let mouse shift between screens
exec --no-startup-id pulseaudio --start # audio
exec_always --no-startup-id xbindkeys # alternative keyboard layout
exec --no-startup-id volnoti # volume change notification
exec --no-startup-id cbatticon # battery indicator
exec --no-startup-id compton -b # composite manager
exec --no-startup-id caffeine # don't sleep when playing youtube
# app launcher, launch w/ Control-space
exec --no-startup-id albert
# gaps
smart_gaps on
for_window [class="^.*"] border pixel 1
hide_edge_borders both
gaps inner 15
gaps outer 15
bindsym $mod+Shift+t gaps inner current set 15; gaps outer current set 15
bindsym $mod+s gaps inner current plus 5
# bindsym $mod+Shift+s gaps inner current minus 5
bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0
bindsym $mod+z gaps outer current plus 5
bindsym $mod+Shift+z gaps outer current minus 5
#=======================================================================
# i3bar
#=======================================================================
# Set the font
font pango: Roboto Bold, FontAwesome 10
# Colors
# first the main theme colors and the accent color are defined to reuse
# get colours/bg from pywal
set_from_resource $fg i3wm.color7 #f0f0f0
set_from_resource $bg i3wm.color2 #f0f0f0
# set $light #424242
# set $mid #303030
# set $dark #212121
# set $acc #F44336
# set $wht #FFFFFF
# set $blk #000000
# # class border backgr. text indicator
# client.focused $light $light $wht
# client.focused_inactive $mid $mid #c4c4c4
# client.unfocused $blk $dark #5e5e5e
# client.urgent $acc $acc $wht
# client.placeholder $blk $mid $wht
# class border backgr. text indicator child_border
client.focused $bg $bg $fg $bg $bg
client.focused_inactive $bg $bg $fg $bg $bg
client.unfocused $bg $bg $fg $bg $bg
client.urgent $bg $bg $fg $bg $bg
client.placeholder $bg $bg $fg $bg $bg
# launch polybar
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
#=======================================================================
# Mouse integration
#=======================================================================
# Hide the mouse when it's not moving
exec --no-startup-id unclutter
# Mod + rmb over titlebar toggles floating mode
bindsym $mod+button3 floating toggle
# The middle button over a titlebar kills the window
bindsym --release button2 kill