Skip to main content

Tomasz Knapik

← Tech blog

i3 window manager setup

This post details my i3 window manager desktop setup.

Graphics drivers

If you have not run a graphical interface on your system yet, you probably need to install a driver for your graphics hardware.

# Find the driver you need and install it with pacman -S [package-name]
pacman -Ss xf86-video

E.g. if you have an Intel machine, you will want to install xf86-video-intel.


You must have Xorg installed too.

pacman -S xorg xorg-xinit


I use Google Noto fonts for everything. Feel free to install whatever you like. See ArchWiki for a list of fonts available.

pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra

Terminal emulator

I use termite. If you want something “simple” to use without having to spend ages configuring, you should probably install gnome-terminal.

pacman -S termite

i3wm and dmenu

Now it’s time to install the window manager and an application launcher - dmenu. dmenu is a part of the suckless project. It is worth checking out the project and their philosophy if you have not heard about it.

pacman -S i3-wm i3lock i3status dmenu

~/.xinitrc file

This is a file that contains a command that starts the i3wm itself. You need to create it yourself. Chances are your distribution won’t have it created by default.

#!/bin/sh -e
# ~/.xinitrc
exec i3

Make the file executable.

chmod +x ~/.xinitrc

Start i3


After you type the command, you should see the desktop. It will ask you whether you want a default configuration or not. I suggest you use the default configuration as it provides a good base to start from for further customisation.

GNOME keyring

I suggest you install GNOME Keyring so your applications can save passwords in there. It is widely used by all the applications.

pacman -S gnome-keyring libsecret libgnome-keyring

I start my GNOME keyring daemon in the ~/.xinitrc file.

#!/bin/sh -e
# ~/.xinitrc

# Start D-Bus and GNOME keyring
dbus-update-activation-environment --systemd DISPLAY
export $(dbus-launch)
eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)

# Start i3wm
exec i3

To manage the keyring via a graphical user interface, I suggest installing seahorse. It’s sometimes useful to debug passwords and tokens saved by your applications.

Java applications problems

If you are planning to run Java graphical applications, set the following environment variable - export _JAVA_AWT_WM_NONREPARENTING=1. I set it inside ~/.xinitrc.

Network manager applet

If you use NetworkManager and want to have a graphical non-faff way of connecting to new networks from your system tray, I suggest you use the network manager applet.

pacman -S network-manager-applet

To start this together with i3, add the following line to your i3 configuration file.

# ~/.config/i3/config
exec --no-startup-id nm-applet

Mounting disks

If you want an automatic mounting disks, I suggest udiskie.

pacman -S udiskie

To start this when you log in, please add the following to your i3 configuration file.

exec --no-startup-id udiskie --tray


For storing my clipboard history I love using clipmenu. It uses the dmenu interface.

pacman -S clipmenu clipnotify

To use it, set up the two keyboard bindings in the i3 configuration file.

bindsym $mod+c exec clipmenu -i
exec --no-startup-id clipmenud

mod+c will open the clipmenu.

To clear the clipboard, use:

clipdel -d .*


Install relevant packages:

pacman -S pulseaudio pavucontrol

Now set up PulseAudio to start together with i3:

# ~/.config/i3/config
exec --no-startup-id start-pulseaudio-x11

I suggest binding volume keys:

# ~/.config/i3/config
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +6%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle

I also bind pavucontrol to a key so I can easily change sound settings.

# ~/.config/i3/config
bindsym XF86Tools exec --no-startup-id pavucontrol

Disable the annoying bell noise

That sound drives me nuts. You might love it.

# ~/.config/i3/config
exec --no-startup-id xset -b

Audio and video codecs

Install various codes.

pacman -S gst-libav gst-plugins-bad gst-plugins-ugly gst-plugins-good gst-plugins-base


# ~/.config/i3/config
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10

Multiple screens

I use an AUR package called mons for configuring multiple screens. I recommend you trying it out if you look for a minimalistic solution for managing your screen configuration. It is especially useful for laptop users as it detects when screens are unplugged and makes sure that always at least one screen is enabled.

cd /tmp
git clone
cd mons
makepkg -si

It needs to be started together with i3 if you want it to automatically detect if there’s at least a single screen active whenever you unplug a screen cable.

# ~/.config/i3/config
exec --no-startup-id mons -a

Then you can bind keys to trigger a change. I use the following. It’s enough for simple set ups.

# ~/.config/i3/config
bindsym XF86Display exec --no-startup-id mons -n right

See the usage guide of mons for more configuration options.

Screen lock and sleep

I use a combination of i3lock and xss-lock.

pacman -S xss-lock i3lock

My lock script looks as follows:

# ~/bin/
set -x
revert() {
    # Disable screen blanking.
    xset dpms 0 0 0
    xset -dpms

trap revert HUP INT TERM

# Set screen to blank after 5 seconds while on a lock screen.
xset +dpms dpms 5 5 5
xset dpms force suspend

# Active the lock
i3lock -n

# Run the following function after the screen has been unlocked.

I suggest you place that script in ~/bin/ Make it executable with chmod +x ~/bin/

I use xss-lock to detect when the screen turns off and it turns on the lock.

# ~/.config/i3/config
exec --no-startup-id xss-lock -l -- ~/bin/ --nofork

I bind the two keys that force screen to turn off which effectively triggers the lock.

# ~/.config/i3/config
bindsym $mod+shift+ctrl+l exec --no-startup-id xset dpms force suspend
bindsym XF86ScreenSaver exec --no-startup-id xset dpms force suspend

I also make power key suspend only - useful for laptops.

# ~/.config/i3/config
exec --no-startup-id systemd-inhibit --what=handle-power-key sleep infinity
bindsym XF86PowerOff exec --no-startup-id systemctl suspend


I use a handy utility called playerctl to play and pause music. It sends commands via the MPRIS D-Bus interface that is supported by most music players such as Spotify, cmus, Lollypop or Rhythmbox.

pacman -S playerctl

Then you can set up key binds to control your music player.

# ~/.config/i3/config
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous


Simple all-in-one solution? Just use flameshot and save yourself a hassle.

pacman -S flameshot

I bind the three different combinations.

  • Print for saving a screenshot to a folder
  • Ctrl+print for saving a screenshot to clipboard
  • Shift+print for opening flameshot GUI that lets you select an area and do modifications to your screenshot.
# ~/.config/i3/config
set $screenshots_directory ~/Pictures/screenshots/
exec --no-startup-id mkdir -p $screenshots_directory
bindsym Print exec --no-startup-id flameshot full --path $screenshots_directory
bindsym Ctrl+Print exec --no-startup-id flameshot full --clipboard
bindsym shift+Print exec --no-startup-id flameshot gui --path $screenshots_directory

Recording screencasts

pacman -S simplescreenrecorder


Dunst is the way.

pacman -S dunst

Add the start-up command to your i3 configuration file.

# ~/.config/i3/config
exec --no-startup-id dunst

Copy the default configuration to your user directory that you can customise if you want to.

cp /usr/share/dunst/dunstrc ~/.config/dunst/

Image browser

It is a good idea to have something to view image files. I personally use Xfce’s Ristretto. I do like using feh too. I don’t love either of them to be honest.

pacman -S ristretto

File manager

I use Nemo which is a fork of GNOME files. It just works.

pacman -S nemo nemo-fileroller nemo-preview nemo-seahorse nemo-share gvfs-nfs gvfs-smb gvfs-mtp gvfs-afc gvfs-gphoto2

Create home directories

pacman -S xdg-user-dirs

Allow using trash from command line

I use the trash-cli utility that allows me use trash from a terminal conveniently.

pacman -S trash-cli

Commands are:

trash-put           trash files and directories.
trash-empty         empty the trashcan(s).
trash-list          list trashed files.
trash-restore       restore a trashed file.
trash-rm            remove individual files from the trashcan.


Install CUPS (the printing server) and drivers that should work for a vast amount of printer models.

pacman -S cups cups-pdf
pacman -S ghostscript foomatic-db foomatic-db-engine foomatic-db-nonfree gutenprint foomatic-db-gutenprint-ppds

Enable cups service

systemctl enable cups
systemctl start cups

Now you can use the CUPS web interface to set up your printers. Please go to http://localhost:631/. Log in with your system user credentials.

Set up Avahi - for network printers

To discover network printers for CUPS you must use Avahi that will allow discovery of the devices on the network.

First you must disable systemd’s mDNS resolver.

systemctl stop systemd-resolved.service
systemctl disable systemd-resolved.service

Then you should install Avahi.

pacman -S avahi nss-mdns

Configure hostname resolution for local domains. Edit /etc/nsswitch.conf to include mdns_minimal [NOTFOUND=return] before resolve and dns in the hosts line.

Now start Avahi.

systemctl enable avahi-daemon.service
systemctl start avahi-daemon.service


Install Bluetooth tools.

pacman -S blueman pulseaudio-bluetooth bluez bluez-utils

Enable the system service that will start Bluetooth on system boot.

systemctl enable bluetooth
systemctl start bluetooth

To start Blueman tray icon together with i3 add the following to the i3 configuration file.

# ~/.config/i3/config
exec --no-startup-id blueman-applet

Screen timeout

I suggest you start with having no screen blanking at all and at some point make it more robust if you want to. It is a good starting point as a default to not make one’s life too complicated.

# ~/.config/i3/config
exec --no-startup-id xset dpms 0 0 0
exec --no-startup-id xset -dpms
exec --no-startup-id xset s 0 0
exec --no-startup-id xset s off


I use a web browser as my PDF reader.

xdg-mime default firefox.desktop application/pdf