- Published: January 7, 2019
Notes to start using i3 lightweight window manager in Linux for developers.
After using some popular desktop environments you realize that you don’t need all the fancy stuff they provide and that waster a lot of memory.
To use a lightweight window manager like i3 you need to feel comfortable with command line.
This is why a Window Manager is a great solution instead a Desktop Environment.
Be compliant with Unix/Linux philosophy:
This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together.
That means it is better to use a Window Manager and other small dedicated programs that play nicely together instead of a full Desktop Environment.
Have the right amount of running processes you need, i.e.: optimize memory usage
Have full control with keyboard navigation, this is the kind of VIm or Emacs users really appreciate.
Minimalistic design, no window decorations or nonsense icons floating around.
We will begin installing i3 with: sudo apt install i3
- To start a new console: $meta+
- To start any GTK-based program: $meta+d
- To move through different workspaces we use: $meta +
After we switch our session to i3, we will arrange our screens in three groups, in i3 terminology these are three different workspaces (group windows together).
- $meta+1. First for a browser
- To start the Firefox for example, $meta+d and then
- To start the Firefox for example, $meta+d and then write the
- $meta+2. Second for communication programs (irssi, mutt, etc)
- $meta+3. Rest of programs like text editors (hopefully Emacs ;) and consoles.
- Moving a window to the third workspace, $mod+Shift+3
- Close i3 session: $mod+Shift+e
- Making a window float: $mod+Shift+Space
The configuration file
~/.config/i3/config is the main place to
tweak our settings and look for (or customize) key shortcuts.
i3status is a small program for generating a status bar for i3bar.
i3status configuration file possible locations:
~/.config/i3status/config (or $XDG_CONFIG_HOME/i3status/config if set)
/etc/xdg/i3status/config (or $XDG_CONFIG_DIRS/i3status/config if set)
The idea of the i3 status configuration file is to specify which modules should be used and then configure each module in its own section.
After changing anything, $mod+Shift+r to reload i3 in place and reflect any changes.
When trying to execute a command with the built in menu
$meta+d, by default i3 runs:
dmenu_run which shows a
list of all available commands at console.
It would make more sense to only show the ones with a GTK visual
interface, this can be done with the command i3-dmenu-desktop which
.desktop files with dmenu.
In the config file
~/.config/i3/config, comment the dmenu_run line
and uncomment the new i3-dmenu-desktop line:
# start dmenu (a program launcher) ## bindsym $mod+d exec dmenu_run # There also is the (new) i3-dmenu-desktop which only displays applications # shipping a .desktop file. It is a wrapper around dmenu, so you need that # installed. bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
Similar to xscreensaver, lets lock the screen with $mod+z.
Add this to your config and reload to apply changes:
# Lock screen bindsym $mod+z exec i3lock
Then $mod+Shift+r and
$mod+z will lock the screen
until you enter your user’s password.
Download and install
$ sudo apt install xbacklight
Now configure keystrokes, in config file
# Screen # increase screen brightness bindsym XF86MonBrightnessUp exec --no-startup-id "xbacklight -inc 5" # decrease screen brightness bindsym XF86MonBrightnessDown exec --no-startup-id "xbacklight -dec 5" bindsym XF86MonBrightnessDown exec --no-startup-id "light -U 10"
There is also an alternative to
xbacklight: light which can be used with the command
light -U 10.
We have to configure volume keys to increase, decrease and mute using the Pulse Audio server,
$ sudo apt install pavucontrol
And in config:
# Sound # increase sound level bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume @DEFAULT_SINK@ +5%" # decrease sound level bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume @DEFAULT_SINK@ -5%" # mute sound bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute 0 toggle"
Some utilities that are useful to keep in mind, specially at console.
Simple X Image Viewer. The primary goal of sxiv is to create an image viewer, which only has the most basic features required for fast image viewing
sudo apt install sxiv sxiv
There is a lightweight image viewer for the terminal: feh.
sudo apt install feh feh
Also useful for setting up a wallpaper, in i3 config:
exec --no-startup-id feh --bg-fill /path/to/wallpaper.jpg
Live USB creator
Creating usb disk from
qpdfview is a tabbed document viewer.
It uses Poppler for PDF support, libspectre for PS support, DjVuLibre for DjVu support, CUPS for printing support and the Qt toolkit for its interface.
To install it: sudo apt install qpdfview
See which printers are available: lpstat -p -d
To configure CUPS printers using a graphical interface: system-config-printers
Print files from command line: lpr command: lpr < file >
Add resources monitor like conky.
- Official user guide: https://i3wm.org/docs/userguide.html
- Full list of XF86 key codes: https://cgit.freedesktop.org/xorg/proto/x11proto/tree/XF86keysym.h