Skip to content
Dylan Kinnett edited this page Dec 22, 2021 · 1 revision

i3 Settings Overview

  • ~/.config/i3/config
    This is the main configuration file of i3 window manager. Contains keybinding, autostart, colors, and window rules. I suggest You to leave it default for now. I will explain it later.

  • ~/.config/i3status/config
    i3bar
    This is the statusline configuration for i3bar, bottom right part of i3bar. I set it to load many module by default. It looks like christmast tree. So, I suggest You to disable some module You don't need.

order += "load"
order += "cpu_temperature 0"
#order += "disk /"
#order += "disk /home"
#order += "ethernet enp1s0"
order += "wireless wlp2s0"
order += "volume master"
#order += "battery 1"
order += "tztime local"

You can comment out the module You want to disable. For example I disable the disk, ethernet, and battery. Then now You have to configure the variable. Don't forget to change both in order list and in function list.

i3status supports Pango Markup. Not many customization options, but still interesting. Here is my current i3status customization (I remove the lines I don't use instead comment them out).

general {
        output_format = "i3bar"
        colors = false
        markup = pango
        interval = 1
}

order += "cpu_temperature 0"
order += "load"
order += "disk /"
order += "wireless wlp2s0"
order += "volume master"
order += "tztime local"

cpu_temperature 0 {
        format = "<span background='#ff5555'>  </span><span background='#e5e9f0'> %degrees °C </span>"
        path = "/sys/class/thermal/thermal_zone0/temp"
}

load {
        format = "<span background='#50fa7b'>  </span><span background='#e5e9f0'> %5min Load </span>"
}

disk "/" {
        format = "<span background='#f1fa8c'>  </span><span background='#e5e9f0'> %free Free </span>"
}

wireless wlp2s0 {
        format_up = "<span background='#bd93f9'>  </span><span background='#e5e9f0'> %essid </span>"
        format_down = "<span background='#bd93f9'>  </span><span background='#e5e9f0'> Disconnected </span>"
}

volume master {
        format = "<span background='#ff79c6'>  </span><span background='#e5e9f0'> %volume </span>"
        format_muted = "<span background='#ff79c6'>  </span><span background='#e5e9f0'> Muted </span>"
        device = "default"
        mixer = "Master"
        mixer_idx = 0
}

tztime local {
		format = "<span background='#8be9fd'>  </span><span background='#e5e9f0'> %time </span>"
		format_time = "%a %-d %b %H:%M"
}

The result looks like this
i3bar

i3status Variables

  • My wireless interface is wlp2s0 and my ethernet adapter is enp1s0, You can find yours by /sbin/iwconfig or iwconfig command.
  • My battery id is BAT1, You can find yours by ls /sys/class/power_supply/ command.
  • My volume mixer is Alsa, probably also work for You. If not, You can see the manual page to configure PulseAudio.
  • To use CPU temperature, You need your CPU temperature path. If /sys/class/thermal/thermal_zone0/temp doesn't work try /sys/devices/platform/coretemp.0/temp1_input. Still doesn't work? Ask Google 😋
  • You can add more module, just read the manual page man i3status.

Now What??

options for volume control via the keyboard include Pactl, Pamixer, and others. Google for control volume via command line.

#change volume
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+
bindsym XF86AudioLowerVolume exec amixer -q set Master 5%+
bindsym XF86AudioMute exec amixer set Master toggle

common apps keybinds:

bindsym Print exec scrot 'Cheese_%a-%d%b%y_%H.%M.png' -e 'viewnior ~/$f'
bindsym $super+l exec i3lock -i ~/.wallpaper.png
bindsym $super+Shift+w exec firefox
bindsym $super+Shift+f exec thunar;workspace 3;focus
bindsym $super+Shift+g exec geany

media controls:

# music control
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc prev
bindsym XF86AudioPlay exec mpc toggle
bindsym XF86AudioStop exec mpc stop

autostart when i3 runs:

#autostart
exec --no-startup-id hsetroot -center ~/.wallpaper.png
exec --no-startup-id xsettingsd &
exec --no-startup-id compton -b

window rules, you can find the window class using xprop.

I use the above to group apps on several workspaces.

  • Workspace 1 for Terminals
  • Workspace 2 for Web
  • Workspace 3 for File Manager
  • Workspace 4 for Office
  • Workspace 5 for Multimedia
  • Workspace 6 for Settings

And I set some apps to launch in floating mode. You can make your own rules of course. Floating mode is the opposite of tiling mode. The position and size of a window are not managed automatically by i3, but manually by you. Using this mode violates the tiling paradigm but can be useful for some corner cases like "Save as" dialog windows, or toolbar windows (GIMP or similar). Those windows usually set the appropriate hint and are opened in floating mode by default.


for_window [class=".*"] border pixel 4
assign [class=URxvt] 1
assign [class=Firefox|Transmission-gtk] 2
assign [class=Thunar|File-roller] 3
assign [class=Geany|Evince|Gucharmap|Soffice|libreoffice*] 4
assign [class=Audacity|Vlc|mpv|Ghb|Xfburn|Gimp*|Inkscape] 5
assign [class=Lxappearance|System-config-printer.py|Lxtask|GParted|Pavucontrol|Exo-helper*|Lxrandr|Arandr] 6
for_window [class=Viewnior|feh|Audacious|File-roller|Lxappearance|Lxtask|Pavucontrol] floating enable
for_window [class=URxvt|Firefox|Geany|Evince|Soffice|libreoffice*|mpv|Ghb|Xfburn|Gimp*|Inkscape|Vlc|Lxappearance|Audacity] focus
for_window [class=Xfburn|GParted|System-config-printer.py|Lxtask|Pavucontrol|Exo-helper*|Lxrandr|Arandr] focus

panel colors

# panel
bar {
    colors {
    background #2f343f
    statusline #2f343f
    separator #4b5262

    # colour of border, background, and text
    focused_workspace   #2f343f #bf616a #d8dee8
    active_workspace    #2f343f #2f343f #d8dee8
    inactive_workspace  #2f343f #2f343f #d8dee8
    urgent_workspace    #2f343f #ebcb8b #2f343f
    }
    status_command i3status
}   

colour of border, background, text, indicator, and child_border

client.focused          #bf616a #2f343f #d8dee8 #bf616a #d8dee8
client.focused_inactive #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.unfocused        #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.urgent           #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.placeholder      #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.background       #2f343f
Clone this wiki locally