Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Customize Your Linux i3 Window Manager

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can fully customize your Linux i3 window manager by editing its configuration file to change keybindings, appearance, workspace behavior, and startup programs. This guide walks you through modifying the i3 config to personalize your desktop experience without relying on GUI tools.

What You'll Need

  • A Linux system with i3 window manager installed
  • Terminal access with a text editor (like nano, vim, or gedit)
  • Basic knowledge of terminal commands and file paths
  • Optional: a status bar like i3blocks or i3status, and a compositor like picom for visual effects

Step-by-Step

  1. Open a terminal and locate the i3 configuration file. It is usually found at ~/.config/i3/config or ~/.i3/config. If it doesn’t exist, create it by copying the default: mkdir -p ~/.config/i3 && cp /etc/i3/config ~/.config/i3/config.
  2. Open the config file in your preferred text editor. For example: vim ~/.config/i3/config or gedit ~/.config/i3/config.
  3. Change the default modifier key. i3 uses the Windows key (Mod4) by default, but you can switch to Alt (Mod1). Find the line starting with set $mod and change it to set $mod Mod1 if you prefer Alt.
  4. Modify keybindings for launching applications. Add or edit lines like bindsym $mod+Return exec alacritty to open your terminal of choice. Replace alacritty with gnome-terminal or xfce4-terminal as needed.
  5. Configure workspaces. By default, i3 names workspaces 1–10. You can rename them by adding: workspace 1 output HDMI-1 or label them with icons: set $ws1 "1: ", then use $ws1 in workspace assignments.
  6. Assign applications to specific workspaces. Add rules like assign [class="Firefox"] $ws1 so Firefox always opens on workspace 1. Use xprop to find window class names: run xprop | grep WM_CLASS, then click the window.
  7. Change focus behavior. Edit the focus wrapping setting with focus_wrapping disable to stop cycling between workspaces, or set it to workspace to wrap only within one output.
  8. Adjust window gaps (if using i3-gaps). Add gaps inner 10 and gaps outer 5 to create spacing between windows. Note: standard i3 does not support gaps; you need the i3-gaps fork.
  9. Set startup programs. Add lines under # Start applications such as exec --no-startup-id nm-applet for network management or exec --no-startup-id picom --daemon for compositing effects.
  10. Customize the status bar. Edit the bar block in the config. Change status_command i3status to i3blocks if using i3blocks. You can also modify font, colors, and position: position top, font pango:monospace 10.
  11. Reload the configuration. After saving changes, press $mod+Shift+R to reload i3 without logging out. If errors occur, i3 will display a warning.
  12. Test all changes. Open new terminals, switch workspaces, and verify apps launch and assign correctly. Fix syntax errors if reload fails.

Common Mistakes

Forgetting to reload the config after editing is the most frequent error. Always use $mod+Shift+R to apply changes. Another common issue is incorrect syntax—i3 is strict about spaces and missing semicolons. For example, bindsym $mod+Shift+Q kill must not have extra spaces around +. Misidentifying window classes also causes assignment failures; always use xprop to confirm class names. Using unsupported features like gaps without installing i3-gaps leads to ignored settings. Finally, editing the wrong config file (e.g., /etc/i3/config instead of the user copy) means changes won’t persist after updates.

Tips

Keep a backup of your working config before making major changes. Use comments (#) to label sections like "Keybindings" or "Startup Apps" for easier navigation. Test one change at a time to isolate issues. Use $mod+Shift+E to exit i3 gracefully if the session becomes unresponsive. Consider using a script to manage multiple config versions. For visual polish, pair picom with fade and shadow effects. Use font icons like Font Awesome or Nerd Fonts in workspace labels for a cleaner look. Document your keybindings in a cheat sheet for quick reference.

Troubleshooting

If i3 fails to reload after editing, it will show an error message with the line number. Open the config and check for typos, especially in keybindings or missing quotes. If the bar disappears, verify the status command path—some systems require full paths like /usr/bin/i3status. If applications don’t start on login, ensure exec lines use --no-startup-id to avoid duplicate launches. If workspace assignments fail, confirm the window class with xprop and check for case sensitivity. If gaps don’t appear, ensure you’re running i3-gaps, not standard i3. If you’re locked out due to a broken config, switch to a TTY (Ctrl+Alt+F2), log in, and fix the file manually. As a last resort, regenerate the config from default using the copy command in Step 1.

Frequently Asked Questions

Can I use a GUI to edit i3 config?

No, i3 does not include a GUI configuration tool. All customization is done by editing the text-based config file directly.

How do I change the wallpaper?

i3 does not set wallpapers by default. Use a command like feh --bg-scale /path/to/image.jpg in your config with exec --no-startup-id to set a wallpaper on startup.

Why are my keybindings not working?

Check for syntax errors, ensure the modifier key is correct, and verify no other application is intercepting the key combination. Reload the config after changes.

Can I have multiple monitors with different workspaces?

Yes. i3 supports per-output workspaces. Use workspace 1 output DP-1 to assign workspace 1 to a specific monitor.

How do I restart i3 safely?

Use $mod+Shift+R to reload the config. To exit entirely, use $mod+Shift+E and confirm logout.

Is i3 suitable for beginners?

It has a learning curve due to manual configuration, but it’s highly efficient once set up. Start with small changes and refer to the official i3 user guide for deeper customization.