summaryrefslogtreecommitdiff
path: root/.config/i3/config
blob: d0d6fcc27f41f4903e0c013a968ce63b002ecc5b (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
#
# ~/.config/i3/conf
# vim: filetype=i3config

##---Basic definitions---##
exec_always feh --bg-fill ~/pix/wp/starwars_1.png
focus_on_window_activation urgent
for_window [class=".*"] border pixel 2
gaps inner 5
gaps outer 10
set $mod Mod4
font pango:monospace 10
## Gaps defaults.
	set $gi "5"
	set $go "10"
## i3config variables.
	set $mon2 "HDMI-0"
	set $mon1 "DP-0"
	set $dmenu --no-startup-id i3-dmenu-desktop
	set $term --no-startup-id $TERMINAL
	# Really no need in making this variable...
	set $fmgr $FILE
	set $ibwsr --no-startup-id $BROWSER
	set $edit --no-startup-id $EDITOR
	set $read --no-startup-id $READER
	set $rstbar pkill -RTMIN+1 $STATUSBAR
	set $music --no-startup-id $MUSIC
	set $msgs --no-startup-id $MSGCHAT
	set $ss --no-startup-id $SSMGR
	set $sspath "$HOME/pix/ss/"
## Colors from ~/.Xresources.
	# set_from_resource $bg background
	# set_from_resource $fg foreground
	set_from_resource $c0	color0
	set_from_resource $c1	color1
	set_from_resource $c2	color2
	set_from_resource $c3	color3
	set_from_resource $c4	color4
	set_from_resource $c5	color5
	set_from_resource $c6	color6
	set_from_resource $c7	color7
	set_from_resource $c8	color8
	set_from_resource $c9	color9
	set_from_resource $c10	color10
	set_from_resource $c11	color11
	set_from_resource $c12	color12
	set_from_resource $c13	color13
	set_from_resource $c14	color14
	set_from_resource $c15	color15
## Workspace variables.
	set $ws1 "1: Terminal"
	set $ws2 "2: Editor"
	set $ws3 "3: Coding"
	set $ws4 "4: Files"
	set $ws5 "5: Multimedia"
	set $ws6 "6: Browser"
	set $ws7 "7: Chat"
	set $ws8 "8: Reader"
	set $ws9 "9: Gaming"
	set $ws10 "10: Music"
## Workspace location in monitors.
	workspace $ws1 output $mon1 $mon2
	workspace $ws2 output $mon1 $mon2
	workspace $ws3 output $mon1 $mon2
	workspace $ws4 output $mon1 $mon2
	workspace $ws5 output $mon1 $mon2
	workspace $ws6 output $mon2 $mon1
	workspace $ws7 output $mon2 $mon1
	workspace $ws8 output $mon2 $mon1
	workspace $ws9 output $mon2 $mon1
	workspace $ws10 output $mon2 $mon1
## Applications location in workspaces.
	# WS1
	# WS2
	# WS3
	# WS4
	# WS5
	assign [class="vlc"] $ws5
	# WS6
		# The title regex is a negative lookahead.
	assign [class="Google-chrome" title="^(?!Save File).*$" title="^(?!GtkFileChooserDialog).*$"] $ws6
	# WS7
	assign [class="TelegramDesktop"] $ws7
	# WS8
	# WS9
	assign [class="discord"] $ws9
	# assign [class="Discord" window_role="GtkFileChooserDialog"] $ws9
	assign [class="Steam" title="steam"] $ws9
	# WS10
	for_window [class="Spotify"] move to workspace $ws10
## Window properties for windows.
	for_window [class="Yad"] floating enable
	for_window [class="mogli"] floating enable
	# for_window [title="Picture in picture"] resize set 640 360 px, move position 1270 30, move to output $mon1
	for_window [class="Google-chrome" instance="crx_kmfikkopdhmbdbkndkamabamlkkgkpod"] floating enable, resize set 640 360, move position 1270 30, move to output $mon1

	# Steam specific.
	for_window [class="Steam" title="Steam Guard"] floating enable
	for_window [class="Steam" title="Steam - News"] floating enable
	for_window [class="Steam" title="Friends List"] floating enable
	for_window [title="/^Steam$/"] move to workspace $ws9

##---i3 color scheme---##
# Class					bor bgt txt ind chb
client.focused			$c14 $c4 $c8 $c4 $c6
client.focused_inactive	$c0 $c0 $c14 $c11 $c0
client.unfocused		$c0 $c8 $c14 $c0 $c0
client.urgent			$c1 $c1 $c8 $c1 $c1
client.placeholder		$c8 $c8 $c14 $c8 $c8
client.background		$c15

##---i3bar configuration---##
## Primary monitor.
	bar {
		output $mon1
		tray_output $mon1
		position top
		status_command $STATUSBAR
		colors{
			background	$c8
			statusline	$c12
			separator	$c0

			# Class				bor bag txt
			focused_workspace	$c14 $c4 $c8
			active_workspace	$c14 $c11 $c8
			inactive_workspace	$c11 $c0 $c14
			urgent_workspace	$c1 $c1 $c8
			binding_mode		$c8 $c3 $c8
		}
	}
## Second monitor.
	bar {
		output $mon2
		tray_output none
		position top
		status_command $STATUSBAR
		colors{
			background	$c8
			statusline	$c12
			separator	$c0

			# Class				bor bag txt
			focused_workspace	$c14 $c4 $c8
			active_workspace	$c14 $c11 $c8
			inactive_workspace	$c11 $c0 $c14
			urgent_workspace	$c1 $c1 $c8
			binding_mode		$c8 $c3 $c8
		}
	}

##--Keybindings--##
## Basic bindings.
	bindsym $mod+Shift+c reload
	bindsym $mod+Shift+r restart
	bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

## Apps.
	bindsym $mod+Return exec $term
	bindsym $mod+Delete exec $term -e htop
	bindsym $mod+Shift+w exec $ibwsr
	bindsym $mod+Shift+f workspace $ws4 exec $term -e $fmgr
	bindsym $mod+m exec $music
	bindsym $mod+Shift+m exec $msgs
	# Screenshots.
	bindsym Print exec $ss gui
	bindsym $mod+Print exec $ss full -c
	bindsym $mod+Shift+Print exec $ss full -p $sspath

## Dmenu.
	bindsym $mod+d exec $dmenu

## Navigation and window options.
	# Basics.
	bindsym $mod+Shift+q kill
	floating_modifier $mod
	bindsym $mod+Shift+g split h
	bindsym $mod+Shift+v split v
	bindsym $mod+f fullscreen toggle

	# Modes.
	bindsym $mod+r mode "resize"

	# Focus.
	bindsym $mod+h focus left
	bindsym $mod+j focus down
	bindsym $mod+k focus up
	bindsym $mod+l focus right
	# Change focus between tiling/floating windows.
	bindsym $mod+space focus mode_toggle
	# bindsym $mod+a focus parent
	# bindsym $mod+d focus child

	# 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

	# Window behavior.
	bindsym $mod+Shift+space floating toggle
	bindsym $mod+Shift+s sticky toggle

	# Container layout.
	bindsym $mod+s layout stacking
	bindsym $mod+w layout tabbed
	bindsym $mod+e layout toggle split

## Workspace bindings.
	# Change 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

	# Move focused window 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

## Modes.
	# Resize.
	mode "resize" {
			# Container resizing.
		bindsym h resize shrink width 1 px or 1 ppt
		bindsym Shift+h resize shrink width 5 px or 5 ppt
		bindsym Ctrl+h resize shrink width 10 px or 10 ppt
		bindsym j resize grow height 1 px or 1 ppt
		bindsym Shift+j resize grow height 5 px or 5 ppt
		bindsym Ctrl+j resize grow height 10 px or 10 ppt
		bindsym k resize shrink height 1 px or 1 ppt
		bindsym Shift+k resize shrink height 5 px or 5 ppt
		bindsym Ctrl+k resize shrink height 10 px or 10 ppt
		bindsym l resize grow width 1 px or 1 ppt
		bindsym Shift+l resize grow width 5 px or 5 ppt
		bindsym Ctrl+l resize grow width 10 px or 10 ppt
			# Gaps resizing.
		bindsym plus gaps outer current plus 1
		bindsym Shift+plus gaps inner current plus 1
		bindsym minus gaps outer current minus 1
		bindsym Shift+minus gaps inner current minus 1
		bindsym g gaps inner all set $gi, gaps outer all set $go
		bindsym Shift+g gaps inner all set 0, gaps outer all set 0
			# Return to default mode keybindings.
		bindsym Return mode "default"
		bindsym Escape mode "default"
		bindsym $mod+r mode "default"
	}

##--Extra XF86 Keys--##
bindsym XF86AudioRaiseVolume		exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2% && $rstbar
bindsym Shift+XF86AudioRaiseVolume	exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $rstbar
bindsym XF86AudioLowerVolume		exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2% && $rstbar
bindsym Shift+XF86AudioLowerVolume	exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $rstbar
bindsym XF86AudioMute				exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $rstbar
# bindsym XF86AudioMedia			exec
bindsym XF86AudioPrev				exec playerctl previous && $rstbar
bindsym XF86AudioNext				exec playerctl next && $rstbar
bindsym XF86AudioPlay				exec playerctl play-pause && $rstbar
# bindsym XF86AudioPause			exec # Same as XF86AudioPlay in my keyboard. That's why the 'play-pause' option is used.
# bindsym XF86AudioStop				exec
# bindsym XF86AudioRecord			exec
# bindsym XF86AudioRewind			exec
# bindsym XF86AudioForward			exec
# bindsym XF86AudioMicMute			exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $rstbar
# bindsym XF86PowerOff				exec
# bindsym XF86Copy					exec
# bindsym XF86Open					exec
# bindsym XF86Paste					exec
# bindsym XF86Cut					exec
# bindsym XF86MenuKB				exec
# bindsym XF86Calculator			exec
# bindsym XF86Sleep					This binding is typically mapped by systemd automatically.
# bindsym XF86WakeUp				exec
# bindsym XF86Explorer				exec
# bindsym XF86Send					exec
# bindsym XF86Xfer					exec
# bindsym XF86WWW					exec
# bindsym XF86DOS					exec
# bindsym XF86ScreenSaver			exec
# bindsym XF86RotateWindows			exec
# bindsym XF86TaskPane				exec
# bindsym XF86Favorites				exec
# bindsym XF86MyComputer			exec
# bindsym XF86Back					exec
# bindsym XF86Forward				exec
# bindsym XF86Eject					exec
# bindsym XF86Phone					exec
# bindsym XF86Tools					exec
# bindsym XF86HomePage				exec
# bindsym XF86Reload				restart
# bindsym XF86ScrollUp				exec
# bindsym XF86ScrollDown			exec
# bindsym XF86New					exec
# bindsym XF86LaunchA				exec
# bindsym XF86LaunchB				exec
# bindsym XF86Launch2				exec
# bindsym XF86Launch3				exec
# bindsym XF86Launch4				exec
# bindsym XF86Launch5				exec
# bindsym XF86Launch6				exec
# bindsym XF86Launch7				exec
# bindsym XF86Launch8				exec
# bindsym XF86Launch9				exec
# bindsym XF86TouchpadToggle		exec
# bindsym XF86TouchpadOn			exec
# bindsym XF86TouchpadOff			exec
# bindsym XF86Suspend				exec
# bindsym XF86Close					kill
# bindsym XF86WebCam				exec
# bindsym XF86Mail					exec
# bindsym XF86Messenger				exec
# bindsym XF86Search				exec
# bindsym XF86Go					exec
# bindsym XF86Finance				exec
# bindsym XF86Game					exec
# bindsym XF86Shop					exec
# bindsym XF86MonBrightnessDown		exec
# bindsym XF86MonBrightnessUp		exec
# bindsym XF86Display				exec
# bindsym XF86KbdLightOnOff			exec
# bindsym XF86KbdBrightnessDown		exec
# bindsym XF86KbdBrightnessUp		exec
# bindsym XF86Reply					exec
# bindsym XF86MailForward			exec
# bindsym XF86Save					exec
# bindsym XF86Documents				exec
# bindsym XF86Battery				exec
# bindsym XF86Bluetooth				exec
# bindsym XF86WLAN					exec