i3 Window Manager

i3 Window Manager post thumbnail image

In this post, I’ll be introducing you to the i3 Window Manager on Fedora 40, a simple yet powerful window manager for anyone looking to streamline their Linux desktop experience. Whether you’re a experienced Linux user or just exploring tiling window managers for the first time, i3 offers an efficient, lightweight, and highly customizable environment.

With Fedora 40’s great features and the minimalist approach of i3 window manager, you’ll enjoy a fast, clutter-free experience that puts you in full control of your workflow. In this blog, I’ll cover installation, configurations, keybindings (shortcuts), workspaces, aesthetic tweaks and tips to help you get the most out of your Fedora 40 and i3 window manager setup.

What is a tiling window manager

tiling-windows-example

A tiling window manager is a lightweight and efficient way to manage windows on your computer screen. Unlike traditional window managers, where windows can overlap and need to be manually resized, a tiling window manager automatically arranges your open programs in a grid-like fashion. This means that each window takes up a specific portion of your screen, without overlapping, making it easy to see and access everything at once.

Tiling window managers are highly customizable, allowing you to control your desktop entirely with the keyboard, which can greatly speed up your workflow. They’re very popular with advanced Linux users.

Installing i3 window manager

To install i3 window manager on Fedora 40 first update your system:

sudo dnf update

Next install i3 window manager and other packages:

sudo dnf install i3 polybar dmenu i3lock xbacklight nitrogen
  • polybar: Menu bar for i3
  • dmenu: A simple menu that lets you search and launch applications.
  • i3lock: Lock screen utility for i3.
  • xbacklight: Control your screen brightness.
  • nitrogen: A great wallpaper app for choosing wallpapers.
i3-login-screen

Next logout of Fedora 40 and login again. Click in the password box and a cog icon will appear. Click the cog and you will see the option for the i3 window manager included in the list of desktop environments. Select i3, enter your password and you will be logged into i3 window manager.

On the first login, i3 will ask to create a configuration file. Choose the generate a default configuration option (~/.config/i3/config)

Nitrogen wallpaper app

Next setup your wallpaper by first opening a terminal in i3 the default keybinding is ($mod+Enter). The default $mod key is the Windows key. (You can customize your keybindings later). At the command prompt type nitrogen and the nitrogen app will open.

  • Select the location of your wallpapers.
  • Choose one by clicking on it
  • Click apply

To have your wallpaper startup at boot you need to add a line to your ~/.config/i3/config file

# Nitrogen Wallpaper auto start
exec --no-startup-id nitrogen --restore

Polybar

polybar-image

Polybar is a highly customizable status bar for the i3 window manager (i3wm), designed to enhance productivity and aesthetics. It offers extensive modules for system monitoring, workspace management, and custom scripts, making it ideal for users who want a personalized, feature-rich experience for their window manager. With support for clickable areas, network stats, volume controls, and more, Polybar integrates seamlessly with i3 window manager, offering a sleek and functional addition to your workflow.

Here’s how to install and set up Polybar on i3wm in Fedora 40:

sudo dnf install polybar
Install Dependencies:
sudo dnf install alsa-utils pulseaudio-utils network-manager-applet xrandr
Configure Polybar

Polybar configuration is done via a config file. Copy a sample config to your ~/.config folder:

mkdir -p ~/.config/polybar
cp /usr/share/doc/polybar/config ~/.config/polybar/

Edit the ~/.config/polybar/config file to customize the bar.

Start Polybar
  • replace the default i3bar with Polybar by editing the ~/.config/i3/config file:
nano ~/.config/i3/config
  • Find and comment out (#) the i3bar.
# bar {
#   status_command i3status
# }

Now add this line to launch polybar:

exec_always --no-startup-id ~/.config/polybar/launch_polybar.sh
Create a launch script for polybar
  • Create the script in the ~/.config/polybar folder
nano ~/.config/polybar/launch_polybar.sh
  • Add the following to the file launch_polybar.sh
#!/bin/bash

CONFIG_FILE="$HOME/.config/polybar/config"
# Replace with the command you use to launch Polybar
POLYBAR_CMD="polybar-msg cmd restart" 

# Function to restart Polybar
restart_polybar() {
    # Kill any existing Polybar instance
    pkill polybar
    # Wait a moment to ensure it's fully terminated
    sleep 1
    # Restart Polybar
    $POLYBAR_CMD &
}

# Use inotifywait to monitor the config file
inotifywait -m -e close_write "$CONFIG_FILE" |
while read path action file; do
    echo "$file has been modified."
    restart_polybar
done
  • Then make the script executable:
chmod +x ~/.config/polybar/launch_polybar.sh

Now after all that, restart i3 window manager. (this is how without having to logout.

i3-msg restart

Polybar will now run on your i3wm in Fedora 40! Start customizing the ~/.config/polybar/config file to to make it your own.

Also have a good look at the ~/.config/i3/config and start customizing the key bindings to suit yore needs.

Dmenu

dmenu is a menu launcher used in i3 window manager to quickly search and launch applications, files, or scripts. Lightweight and highly customizable, dmenu allows users to type part of an app name and instantly see results, streamlining navigation in i3’s minimalist environment. It improves efficiency by reducing the need for mouse navigation and is a key tool for managing tasks in i3wm’s tiling interface.

To finish up here’s a link to a great i3wm resource. The i3 User’s Guide.

Workspaces

One of its key features of i3window manager is the workspace system, which allows users to organize their workflow seamlessly. Understanding and utilizing i3 workspaces can dramatically enhance your productivity and streamline your multitasking.

What are Workspaces in i3 Window Manager?

Workspaces in i3 are basically virtual desktops where you can group related windows or applications. Each workspace acts as an independent environment, helping you avoid clutter by keeping different tasks or projects separated. Instead of having all open applications on one screen, you can distribute them across various workspaces for better organization. You can have different workspaces spread across multiple monitors completely interdependent of each other.

An example of workspaces:

  • Workspace 1 for web browsing and research.
  • Workspace 2 for coding and development tools.
  • Workspace 3 for communication apps like Slack or Discord.

Advantages of Using Workspaces in i3

  1. Improved Organization: With workspaces, you can separate applications based on your tasks, reducing the chaos of multiple overlapping windows. This makes it easy to switch between activities without losing focus.
  2. Quick Navigation: i3 allows you to switch between workspaces using simple keyboard shortcuts, making it incredibly fast to move from one task to another. This is especially useful for users who prefer to work without a mouse.
  3. Enhanced Productivity: By assigning different workspaces to different tasks, you can minimize distractions. For instance, keeping entertainment apps separate from work-related tools ensures you stay focused when needed.
  4. Tiling Efficiency: i3’s tiling windows works well with its workspaces. You can tile, stack, or float windows within each workspace to optimize your screen real estate, enhancing your multitasking abilities.
  5. Customization: i3 lets you define how many workspaces you want, their names, and which workspace should open specific applications automatically. This level of customization allows for a highly personalized workflow that fits your exact needs.

Using Workspaces in i3 Window Manager

  • Switching Workspaces: By default, you can switch between workspaces using keyboard shortcuts (e.g.$mod+1 or $mod+2 for workspace 1, 2, etc.). This easy navigation helps in maintaining smooth workflow transitions.
  • Moving Windows to Workspaces: You can easily move windows from one workspace to another (e.g., $mod+shift+number). This is useful when reorganizing your tasks or cleaning up your current workspace.
  • Workspace Indicators: i3 displays the active workspace in the polybar (see above polybar inage), helping you stay aware of your current workspace and quickly switch to the desired one.

Real-World Use Cases for Workspaces

  • Developers: Use workspaces to separate code editors, terminals, and browsers for testing, creating a distraction-free coding environment.
  • Designers: Keep design tools like Photoshop or GIMP in one workspace, while file browsers and media players reside in another for easy multitasking.
  • Project Management: Allocate workspaces for communication apps like email, chat clients, or project management tools, making it easy to jump between tasks.

i3 window manager’s workspace feature is a powerful tool for organizing and managing windows . Using workspaces, users can have a clutter-free, desktop. Whether you’re a developer, designer, or multitasker, workspaces in i3 offer the control needed to optimize your workflow.

Leave a Reply

Your email address will not be published. Required fields are marked *