i3 window manager setup on Debian Bullseye

In this blog, we will look at setting up i3 tiling window manager, and a status bar for i3 named i3status-rust. All of this is tested on Debian Bullseye. Some basic understanding of configuring i3 is expected.

This is part 2 in a series of 3 blogs regarding setup of Debian Bullseye on a Laptop with i3 window manager. Read part 1 here.

Login manager

A display manager, or login manager, is typically a graphical user interface that is displayed at the end of the boot process in place of the default shell.

Let’s start by installing a login manager. We will be using LightDM.

This will also install the GTK greeter for LightDM. Next time we boot up, this is what will greet us during login instead of the command line prompt.

Installing i3

Next, lets install i3 and related components:

So what did we just install?

  1. i3 – The tiling window manager
  2. i3lock – Simple screen locker
  3. dunst – A notification daemon
  4. rofi – Window switcher & application launcher

For i3lock, dunst and rofi I use the default configuration that comes out of the box but all of these are quite configurable.

  • i3lock: this man page lists supported arguments.
  • rofi: I found this blog that has a series of posts describing what rofi can do.
  • dunst: ArchWiki goes into some configuration details.

Before starting with the next step, let’s confirm that everything done till now works well. Restart the machine, and we should first be greeted with the drive decryption prompt, followed by the login manager. Once we login, we should see i3 with the default configuration.

i3 configuration

My entire dot-config is available here and the i3 configuration is available here. It utilizes various scripts present in the bin folder at the root of the repository. It also references a few applications that I will be outlining in the next blog.

Third party fonts used, all open source, are listed here and can be installed by following the approaches outlined on the Debian wiki.

Here’s how my desktop looks with a single monitor:

A screenshot from the social tab of my i3 window manager. Single monitor.
A screenshot from the social tab of my i3 window manager. Single monitor.
The full desktop with the second monitor connected via HDMI.
The full desktop with the second monitor connected via HDMI.

Workspace configuration

In i3, workspaces are an easy way to group a set of windows.

I have 5 workspace dedicated to:

  1. Coding,
  2. Browsing,
  3. Social apps (In screenshot),
  4. Terminal / Editor,
  5. Media / Others.

Commonly used applications are mapped to specific workspace via the i3 configuration file. The workspace 1: Coding, 2: Browsing and 5: Media / Others appear on the secondary monitory if it is connected. All of this is configured using the i3 config file. The social workspace has a slightly complicated layout defined in it’s layout file, generated using the i3-save-tree utility.

i3 status bar configuration

I use the i3status-rust status bar’s toggle icons to make common actions easier to perform. The associated scripts for these toggle icons are located here and the i3rust bar configuration is here. The touch pad toggle also has a global keyboard shortcut configured via xbindkeys. I’ll discuss this in some more detail later. When the external display is connected another i3rust bar is displayed with additional information. The configuration for that can be found here.

Custom scripts / Toggles

My i3status bar links has a few toggles that trigger custom scripts. Here’s a brief description of these:

  1. Limit BAT – I often have my laptop connected to AC power. To preserve battery life it’s generally a good idea to limit the maximum battery charge to about 70-80%. Enabling this switch limits the battery charging to 75%.
  2. HDMI – Toggles the external monitor if connected. Two scripts are used here: activate_hdmi.sh enables the HDMI display, and laptop_only.sh disables it. Modify the scripts using xrandr to configure it as per your setup.
  3. VPN – Uses wg-quick to toggle the Wireguard interface.
  4. Touchpad – This uses 2 scripts: 1. touchpad_is_enabled.sh and 2. toggle_touchpad.sh. The touchpad’s current state is determined by the first script, and the second one is used to toggle it’s state.

The custom scripts work with my laptop, but may need tweaks to work with your hardware. I’ve found ArchWiki to be a good source of information regarding specific laptops.

In the next blog, we will discuss Laptop keybindings and the applications that I use daily.

Leave a Reply