Setting i3-wm from scratch

A tutorial of customizing i3-wm and status bar in polybar.

The result of this tutorial:

You can read some basic Linux GUI knowledge as a background, and all the configuration files can be downloaded at this repository.

Why use windows manager instead of desktop environment

Pros:

  1. WM costs less system resources than DE(memory, cpu, disk…).
  2. WM is easy to customize in more aspects.
  3. WM’s configuration is easy to backup and restore.

Cons:

  1. WM has poor apperance than DE in default configuration.
  2. Customize WM is not novice-friendly.

Set i3-wm

Installing

Please install i3-gaps instead of i3-wm, cause the latter may cause conflicts in some configuration.

Basic configs

After installing i3-wm, when you login your account first time, a pop up window will lead you to make some basic configurations.

Default config files locate in ~/.config/i3/.

All the configurations below are written in the ~/.config/i3/config

In wms, most of operations can be conducted by keyboard, thus, we need to set a leader key.

1
2
3
4
#++++++=Modifiy Keys=++++++#
#(Mod1 = Alt, Mod4 = Super/Win)
set $mod Mod4
set $m_alt Mod1

Apperance

All the parameters definition can be looked up in wikipedia.

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
#++++++=Appereance=++++++#;
## default window
new_window none
new_float normal
hide_edge_borders both

## gaps setting
# gaps inner 5
# gaps outer 5
# smart_gaps on

#%%#
## set primary gruvbox colorscheme colors
set $bg #282828
set $red #cc241d
set $green #98971a
set $yellow #d79921
set $blue #458588
set $purple #b16286
set $aqua #689d68
set $gray #a89984
set $darkgray #1d2021
set $white #ffffff

##class border backgr. text indicator child_border
client.focused #4c7899 #285577 #ffffff #2e9ef4 #285577
client.focused_inactive #81c2d6 #5f676a #ffffff #484e50 #0b6e48
client.unfocused #c9cabb #222222 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #199475 #900000
client.placeholder #a2b4ba #0c0c0c #ffffff #1793d0 #0c0c0c
client.background #82abba

## popups
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable

## float programs(find the programs' names in "/usr/share/applictions")
for_window [class="Gpicview"] floating enable
for_window [class="mpv"] floating enable
for_window [class="Gimp"] floating enable
for_window [class="Xarchiver"] floating enable
for_window [class="Genymotion"] floating enable
for_window [class="Vlc"] floating enable
for_window [class="VirtualBox"] floating enable
for_window [class="Thunar"] floating enable
for_window [class="Catfish"] floating enable

## font
## sarasa mono sc nerd doesn't have too much icons, just change it if you want.
font pango:Sarasa Mono SC Nerd 10

Auto start

All these programs will start after you logged in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#++++++=Auto Start Programs=++++++#
# xcompmgr: for transparaent window.
exec --no-startup-id xcompmgr
# compton: for transparent window.
exec --no-startup-id compton -b
# mate-power-manager: battery info and screen brightness adjustment
exec --no-startup-id mate-power-manager
# network-manager: to manage network...(totally crap)
exec --no-startup-id nm-applet
# blueman: bluetooth config
exec --no-startup-id blueman
exec --no-startup-id blueman-applet
# polkit: for processes' communication
exec --no-startup-id /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &
# emacs: C-S mode
exec --no-startup-id emacs --daemon


# start some software in specified workspace
exec --no-startup-id i3-msg 'workspace 1; exec --no-startup-id sakura'

App shortcuts

The best part of i3wm is this(In my opinion), you can define any keyboard shortcuts you want to make your computer more handy.

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
#++++++=Shortcuts=++++++#
# program launchers: drun(i3wm default), rofi
# the theme of rofi can be changed by the value of parameter `-theme`
bindsym $mod+d exec --no-startup-id dmenu_run
bindsym $m_alt+space exec --no-startup-id rofi -show drun -theme ctheme

# terminals
# well, the sakura is light, but it cannot adjust the font size by keyboard(like C-x + -/+).
bindsym $mod+Return exec --no-startup-id sakura
bindsym $mod+z exec --no-startup-id sakura

# browsers
# I don't know what's the problem of google to remove the option of `save page as mthml` from dialog menu, anyway, if you don't need to save page as mhtml, just delete the parameter.
bindsym $mod+c exec --no-startup-id firefox
bindsym $mod+Shift+c exec --no-startup-id chromium --save-page-as-mhtml

# file explorers
# Also have `ranger` as a file explorers.
bindsym $mod+e exec --no-startup-id thunar

# screenshot
# -u = use the focused window, -s = select window manually, -b = include the wm border.
bindsym Print exec --no-startup-id "scrot -u -q 100 './Pictures/Screenshots/%Y%m%d_%H%M%s_$wx$h.png'"
bindsym --release Shift+Print exec --no-startup-id "scrot -bs -q 100 './Pictures/Screenshots/%Y%m%d_%H%M%s_$wx$h.png'"
bindsym --release Control+Print exec --no-startup-id "scrot -s -q 100 './Pictures/Screenshots/%Y%m%d_%H%M%s_$wx$h.png'"

# emacs
# well, if you don't need emacs, just comment this.
bindsym $mod+Shift+e exec --no-startup-id emacsclient -c

# VSC
# ### NOTICE ### the vscode start in this way will not read the environmental varaiables defined in users' home directory, some plugins will not be able to run. It can be solved by starting vscode manually in program launcher.
bindsym $mod+q exec --no-startup-id code

# XMind
bindsym $mod+m exec --no-startup-id xmind

# Zotero
bindsym $mod+Shift+z exec --no-startup-id zotero

Workspace config

The notion workspace can be looked up online.

Workspace

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
## specify application's default workspaces,
assign [class="sakura"] 1
assign [class="code"] 2
assign [class="Firefox"] 3

## switch to near workspace
bindsym $mod+Tab workspace next
bindsym $m_alt+Tab workspace prev
# bindsym $mod+Shift+Tab workspace prev

## Define names for default workspaces for which we configure key bindings later on.
## We use variables to avoid repeating the names in multiple places.
set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
set $ws9 9
set $ws10 10

## switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10

## move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10

Focus control

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#------=Focus Control=------#
## change focus
# bindsym $mod+j focus left
# bindsym $mod+k focus down
# bindsym $mod+l focus up
# bindsym $mod+semicolon focus right

bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

## focus the parent container
bindsym $mod+u focus parent
## focus the child container
bindsym $mod+Shift+u focus child

## foucus follows mouse(cursor)
focus_follows_mouse yes

## change focus between tiling / floating windows
# bindsym $mod+space focus mode_toggle

Windows control

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
#------=Windows Control=------#
## Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

## move window
# bindsym $mod+Shift+J move left
# bindsym $mod+Shift+K move down
# bindsym $mod+Shift+L move up
# bindsym $mod+Shift+colon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

## split in horizontal orientation
bindsym $mod+h split h
## split in vertical orientation
bindsym $mod+v split v

## toggle bar (not for polybar)
# bindsym $mod+m bar mode toggle

## toggle tiling / floating
bindsym $mod+space floating toggle
bindsym $mod+Shift+space sticky toggle

## toggle fullscreen
bindsym $mod+f fullscreen toggle

## toggle windows layout
bindsym $mod+s layout stacking
bindsym $mod+t layout tabbed
bindsym $mod+a layout toggle split

## terminate window
bindsym $mod+Shift+q kill
bindsym $mod+Escape kill

## hide | show window(minus is "-" and plus is "+".)
bindsym $mod+minus move scratchpad
bindsym $mod+plus scratchpad show

## change border style
# bindsym $mod+u border none
# bindsym $mod+n border normal
# bindsym $mod+o border 1pixel
bindsym $mod+b border toggle

Resizing control

i3wm doesn’t support resize window by mouse, you need to do it by keyboard.

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
#------=Resize Window=------#
bindsym $mod+Shift+r mode "resize"

## resize shortcuts (also you can use the mouse for resizing)
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow width 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt

bindsym Left resize shrink width 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt

bindsym Shift+Left resize shrink width 5 px or 5 ppt
bindsym Shift+Right resize grow width 5 px or 5 ppt
bindsym Shift+Up resize shrink height 5 px or 5 ppt
bindsym Shift+Down resize grow height 5 px or 5 ppt

bindsym Ctrl+Left resize shrink width 1 px or 1 ppt
bindsym Ctrl+Right resize grow width 1 px or 1 ppt
bindsym Ctrl+Up resize shrink height 1 px or 1 ppt
bindsym Ctrl+Down resize grow height 1 px or 1 ppt

bindsym Return mode "default"
bindsym Escape mode "default"
}

Multiple screens setting

Please skip this section if you have no intension to use multiple monitors simultaneously.

You need to install a GPU drive properly before this config start.

You can use many software to adjust your screens (or not), like arandr. The main goal is to obtain a xrandr command.

After that, create a shell script in the i3 config directory(or wherever you want) named screen.sh, then add a command in i3 config file.

1
2
3
#### ~/.config/i3/config

exec --no-startup-id bash ~/.config/i3/screen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#### ~/.config/i3/screen.sh

#!/bin/bash

f=$(xrandr | grep -c 'HDMI-0 connected')

if [ $f = "1" ]
then xrandr --output DP-0 --primary --mode 3840x2160 --pos 0x0 --rotate normal \
--output HDMI-0 --mode 1920x1080 --pos 3840x120 --rotate right \
--output DP-2 --mode 1920x1080 --pos 4920x487 --rotate normal \
--output DP-1 --off \
--output DP-3 --off \
--output DP-4 --off
fi

This script can detect whether you plugged a new monitor(HDMI-0), if so, then deploy the xrandr command to change the rendering config.

If you want to set default workspace for some monitors, use these settings. The name of each monitor can obtained by the command xrandr.

1
2
3
4
workspace 1 output DP-0
workspace 2 output DP-0
workspace 9 output HDMI-0
workspace 10 output DP-2

System control

Shortcuts and settings of volume, power, screentime

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
#++++++=System Control=++++++#

# volume
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

# power
set $mode_system select: lock(L) exit(E) reboot(R) poweroff(O) cancel(Esc)
bindsym $mod+$m_alt+Escape mode "$mode_system"
mode "$mode_system" {
bindsym l mode "default" exec --no-startup-id betterlockscreen -l blur
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym o exec --no-startup-id systemctl poweroff, mode "default"
bindsym Escape mode "default"
}

# screen off | sleep | shutdown(time unit: seconds)
exec --no-startup-id xset dpms 1200 1200
#exec --no-startup-id xset dpms 300 1357 6789

# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork

Wallpaper, lockscreen and session control

Wallpaper

I choose feh to control the wallpaper, and feh just support bitmap, not vector images. I use debian built-in wallpapers(originally in .svg, use inkscape to convert it into .png).

1
2
inkscape --export-type=png /usr/share/wallpapers/FuturePrototype/contents/images/3840x2160.svg /usr/share/wallpapers/FuturePrototype/contents/images/3840x2160.png
feh --no-fehbg --bg-fill '/usr/share/wallpapers/FuturePrototypeWithLogo/contents/images/3840x2160.png'

I haven’t think about animated wallpapers.

Session control

1
2
3
4
5
6
7
8
9
10
11
12
#++++++=Sessions=++++++#

# reload the configuration file
bindsym $mod+$m_alt+c reload

# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+$m_alt+r restart

# exit i3 (logs you out of your X session)
bindsym $mod+$m_alt+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'"

bindsym $mod+$m_alt+l mode "i3lock: Return to lock/Escape to Cancel"

Lockscreen

i3 support many lockscreen app, this post only introduce betterlockscreen. The lockscreen picture is the wallpaper.

1
2
3
4
5
6
7
8
9
10
### use conf first
betterlockscreen -u '/usr/share/wallpapers/FuturePrototypeWithLogo/contents/images/3840x2160.png'

#### ~/.config/i3/config
# i3lock
mode "i3lock: Return to lock/Escape to Cancel" {
bindsym Return mode "default" exec --no-startup-id betterlockscreen -l blur
# bindsym Return mode "default" exec i3lock -i /usr/shre/wallpapers/FuturePrototype/contents/images/3840x2160.png
bindsym Escape mode "default"
}

Set status bar

i3wm can use many kind of status bar like i3status, i3blocks or polybar. These application have many componets, and you can create your own script then call it in the config file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## status bar
# bar {
# # status_command i3status -c ~/.config/i3/i3status.conf
# status_command i3blocks -c ~/.config/i3/i3blocks.conf
# position bottom
# mode hide
# workspace_buttons yes
# tray_padding 0
# # separator_symbol "|"
# colors {
# background #285477
# statusline #dedede
# separator #2d2d2d
# focused_workspace #636e88 #285de7 #dedfdg
# active_workspace #556677 #234567 #56ef67
# inactive_workspace #636d72 #2d2d2d #dedede
# urgent_workspace #ffffff #900000 #d23d32
# }
# #height 30
# }

## polybar
exec --no-startup-id bash ~/.config/i3/polybar/launch.sh

polybar

This script is for activate polybar on each of monitors(if you have), you can also make yous own script to activate the polybar.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#### ~/.config/i3/polybar/launch.sh
#!/usr/bin/env bash

# Terminate any currently running instances
killall -q polybar

# Pause while killall completes
while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done

if type "xrandr" > /dev/null; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload mybar -c ~/.config/i3/polybar/config &
done
else
polybar --reload mybar -c ~/.config/i3/polybar/config &
fi

echo "polybars launched..."

Polybar has its own syntax to modify the setting, this post only have one example. Some componets’ config should correspondent to other application, like mpd. You should change the name of some devices like ethernet card or sound card.

If you want to show the icons on the polybar, please run this script after configuration.

1
2
3
4
5
6
## gic.sh
#!/bin/bash
counter=0
i3-msg -t get_workspaces | tr ',' '\n' | sed -nr 's/"name":"([^"]+)"/\1/p' | while read -r name; do
printf 'ws-icon-%i = "%s;<insert-icon-here>"\n' $((counter++)) $name
done

The main config file of i3.

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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
;;; ~/.config/i3/polybar/config

[colors]
;background = ${xrdb:color0:#222}
background = #77222222
background-alt = #444
;foreground = ${xrdb:color7:#222}
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40

[bar/mybar]
monitor = ${env:MONITOR}
width = 100%
height = 35
;offset-x = 1%
;offset-y = 1%
radius = 7%
fixed-center = false
bottom = true

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 5%
line-color = #f00

border-size = 0.2%
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin-left = 0
module-margin-right = 1%

font-0 = Sarasa Mono SC Nerd:size=14:antialias=true;1
;; font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
;; font-2 = siji:pixelsize=10;1

modules-left = bspwm i3
modules-center = mpd
modules-right = filesystem memory cpu wlan eth battery temperature pulseaudio date

tray-position = right
tray-padding = 1
;tray-background = #0063ff

;wm-restack = bspwm
;wm-restack = i3

;override-redirect = true

;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev

cursor-click = pointer
cursor-scroll = ns-resize

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;modules;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock

format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}

label-layout = %layout%
label-layout-underline = ${colors.secondary}

label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/filesystem]
type = internal/fs
interval = 25

mount-0 = /
mount-1 = /home
mount-2 = /data

label-mounted = %mountpoint%%{F-}:%percentage_used%%
;label-mounted =  %mountpoint%%{F-}:%percentage_used%%
label-unmounted = %mountpoint% umnt
label-unmounted-foreground = #ebebeb

format-mounted-underline = #ebebeb
format-unmounted-underline = #ebebeb
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/bspwm]
type = internal/bspwm

label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

label-occupied = %index%
label-occupied-padding = 2

label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2

; Separator in between workspaces
; label-separator = |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false


;;; NOTICE ;;;
; to show these icons on the bar, please run the script named `gic.sh` in the shell
ws-icon-0 = 1;#
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-5 = 6;
ws-icon-6 = 7;
ws-icon-7 = 8;
ws-icon-8 = 9;
ws-icon-9 = 10;

;; ws-icon-default =

; Only show workspaces on the same output as the bar
pin-workspaces = true

label-mode = %mode%
label-mode-padding = 1
label-mode-foreground = #000
label-mode-background = ${colors.primary}

; focused = Active workspace on focused monitor
label-focused = %index% %icon%
;; label-focused-foreground = #dfdfdf
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

; unfocused = Inactive workspace on any monitor
label-unfocused = %index% %icon%
label-unfocused-padding = 2

; visible = Active workspace on unfocused monitor
label-visible = %index% %icon%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

; Separator in between workspaces
; label-separator = |

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/mpd]
type = internal/mpd

host = 127.0.0.1
port = 7777

format-online = <label-song> <label-time> <icon-prev> <icon-seekb> <icon-stop> <toggle> <icon-seekf> <icon-next> <icon-repeat> <icon-random>
;; format-online = <label-song> <label-time> <bar-progress> <icon-prev> <icon-seekb> <icon-stop> <toggle> <icon-seekf> <icon-next> <icon-repeat> <icon-random>
;format-online = <toggle> <label-song> <icon-next>
format-offline = <label-offline>
format-offline-foreground = #66
label-offline = --------

label-song-maxlen = 20
label-song-font = 8

icon-prev = ⇐
icon-seekb = ⇠
icon-stop = 
icon-play = 
icon-pause = 
icon-next = ⇒
icon-seekf = ⇢
icon-random = 
icon-repeat = 

toggle-on-foreground = #2278ff
toggle-off-foreground = #66

bar-progress-width = 9
bar-progress-indicator = |
bar-progress-indicator-foreground = #bb
bar-progress-fill = 
bar-progress-fill-foreground = #bb
bar-progress-fill-font = 3
bar-progress-empty = 
bar-progress-empty-foreground = #44
bar-progress-empty-font = 3

label-time-foreground = #55
;; label-time-font = 8
;;; }}}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/xbacklight]
type = internal/xbacklight

format = <label> <bar>
label = BL

bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = #f90000
;; format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = #7CFC00
;; format-prefix-foreground = ${colors.foreground-alt}
format-underline = #7CFC00
label = %percentage_used:2%%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/wlan]
type = internal/network
interface = wlan0
interval = 3.0

format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%

format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}

ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = #9f78e1
;; ramp-signal-foreground = ${colors.foreground-alt}

;; ramp-signal-0 = 
;; ramp-signal-1 = 
;; ramp-signal-2 = 
;; ramp-signal-3 = 
;; ramp-signal-4 = 
;; ramp-signal-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/eth]
type = internal/network
interface = eth0
interval = 3.0

format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = #55aa55
;; format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%

format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/date]
type = internal/date
interval = 1

date =
date-alt = " %Y-%m-%d %A"

time = %H:%M
time-alt = %H:%M:%S

format-prefix = 
format-prefix-foreground = #0a6cf5
;; format-prefix-foreground = ${colors.foreground-alt}
format-underline = #0a6cf5

label = %date% %time%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/pulseaudio]
type = internal/pulseaudio

format-volume = <label-volume>
;; format-volume = <label-volume> <bar-volume>
format-volume-underline = #4bffdc

label-volume =  %percentage%%
label-volume-foreground = ${root.foreground}

label-muted =  muted
label-muted-foreground = #666
format-muted-underline = #4bffdc

bar-volume-width = 5
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/alsa]
type = internal/alsa

format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
;; format-volume = <label-volume> <bar-volume>
;; label-volume = VOL
;; label-volume-foreground = ${root.foreground}

format-muted-prefix = " "
;; format-muted-foreground = ${colors.foreground-alt}
label-muted = sound muted

bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/battery]
type = internal/battery
battery = BAT1
adapter = ADP1
full-at = 98

format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a

format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

format-full-prefix = " "
format-full-prefix-foreground = #ffb52a
;; format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = #ffb52a
animation-charging-framerate = 750

animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = #ffb52a
animation-discharging-framerate = 750
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60

format = <ramp> <label>
format-underline = #228B22
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}

label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}

ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = #228B22
;; ramp-foreground = ${colors.foreground-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/powermenu]
type = custom/menu

expand-right = true

format-spacing = 1

label-open = 
label-open-foreground = ${colors.secondary}
label-close = 
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}

menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2

menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot

menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[global/wm]
margin-top = 5
margin-bottom = 5

; vim:ft=dosini

i3blocks

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
# ~/.config/i3/i3blocks.conf
# align
# color
# command
# full_text
# instance
# interval
# label
# min_width
# name
# separator
# separator_block_width
# short_text
# signal
# urgent
# Global properties
#
# The top properties below are applied to every block, but can be overridden.
# Each block command defaults to the script name to avoid boilerplate.

# Global properties
#
# The top properties below are applied to every block, but can be overridden.
# Each block command defaults to the script name to avoid boilerplate.
command=~/.config/i3/i3blocks/$BLOCK_NAME
separator_block_width=20
markup=none
separator=false

#lightred #fb4934
#red #cc241d
#green #98971a
#lightgreen #b8bb26
#yellow #d79921
#lightyellow #fabd2f
#blue #458588
#purple #b16286
#aqua #689d68


# Find your own networking interfaces by typing
# 'ip link' or 'ifconfig' in a terminal window.
# Yours are probably different than mine!

#my ethernet interface is eno1
#most people is eth0
[bandwidth]
# instance=eno1
instance=eth0
interval=5
color=#fabd2f
label=


########################
separator_block_width=1
[spacer]
separator_block_width=1
full_text=|
# color=#fb4934
########################


# [wifi]
# instance=wlan0
# interval=10
# color=#d79921
# label=
# separator_block_width=0
[bandwidth]
label=
instance=wlan0
interval=1
color=#d79921


########################
separator_block_width=1
[spacer]
separator_block_width=1
full_text=|
# color=#fb4934
########################


# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
[cpu_usage]
label=
interval=10
min_width=100.00%
color=#fb4934


########################
separator_block_width=1
[spacer]
separator_block_width=1
full_text=|
# color=#fb4934
########################


# Temperature
#
# Support multiple chips, though lm-sensors.
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
[temperature]
label=
interval=10
color=#fabd2f


########################
separator_block_width=1
[spacer]
separator_block_width=1
#full_text=
full_text=|
# color=#fb4934
########################


# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
label=
interval=20
color=#b8bb26


########################
separator_block_width=1
[spacer]
separator_block_width=1
#full_text=
full_text=|
# color=#fb4934
########################


[volume_pactl]
label=
# instance=Master
interval=1
color=#fb4934
# signal=10


########################
separator_block_width=1
[spacer]
separator_block_width=1
#full_text=
full_text=|
# color=#fb4934
########################


# Disk usage
#
# The directory defaults to $HOME if the instance is not specified.
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).

# [disk]
# label= DU /home
# interval=30
# color=#fabd2f
# separator_block_width=0

[disk_usage]
label=
instance=/
interval=20
color=#fabd2f
separator_block_width=5

[disk_usage]
instance=/home
interval=20
color=#fabd2f


########################
separator_block_width=1
[spacer]
separator_block_width=1
#full_text=
full_text=|
# color=#fb4934
########################


# Battery indicator
#
# The battery instance defaults to 0.
[battery]
#label=BATT/
label=
instance=1
interval=20
color=#b8bb26


########################
separator_block_width=1
[spacer]
separator_block_width=1
#full_text=
full_text=|
# color=#fb4934
########################


[date]
command=date "+%a %Y-%m-%d %H:%M:%S"
interval=1
# label=
color=#fabd2f