Master Your Desktop Be a Window Wizard
Launching and Closing Apps
So far we've only been opening terminal windows, which is fine if you do most of your work at the command line, but obviously isn't great for general desktop usage. Fortunately, there's a dedicated program launcher for i3 called dmenu that is – as you've probably guessed by now – keyboard-centric. To activate it, press Alt+D and look at the top of the screen: You should see a bar with a gap on the left and various programs listed on the right. (If you don't see this, make sure dmenu is installed – have a search for it in your distro's package manager.)
Now, with dmenu open, start typing something – for example, f. You'll see that dmenu narrows down the list of displayed apps to those beginning with f. Type "fire" and (unless you have other apps installed beginning with fire), it should narrow down to "firefox", so hit Enter to launch it. As you're seeing, dmenu is a useful way to quickly launch applications without having to type in the full executable names – at least, most of the time!
To close an window, press Alt+Shift+Q. This tells i3 to send a regular "close window" command to the application, that is, shutting it down gracefully. So if you're running an editor and haven't saved your work, the app will prompt you. Try it out with, say, LibreOffice – start a word processor document, tap in some text, and then press Alt+Shift+Q. LibreOffice's Save Document? dialog will pop up, and you'll also notice that i3 lets it appear in the middle of the screen, as usual (see the "Using Workspaces" box for more info).
Using Workspaces
Like most desktop environments and window managers, i3 supports workspaces – separate virtual "screens" where you can open additional applications. You can see the number of the currently active workspace in the far-left of the status bar at the bottom (it should show "1" at this stage). To switch to another workspace, use Alt along with a number (e.g., Alt+2 to switch to workspace 2). These are created on the fly, so you don't have to worry about creating or managing them.
In many cases, you'll want to move windows between different workspaces; this is achieved by using Alt+Shift along with a number. So, if you're in workspace 1 with two windows open side-by-side and press Alt+Shift+2, the currently selected window will be moved into the second workspace. And, if that workspace was empty before the move, the window will take up the whole screen, like when we first started i3.
So i3 isn't overly zealous about tiling; it tries to give each window and application its own dedicated space on the screen, making sure no pixels are wasted, but it's also clever enough to respect "floating" windows that are temporary and don't need to be assigned their own tiles. You can see this in Figure 4.
You're now ready to start using i3 for your daily work – it may take some time to get used to, but after a while you'll find it much more elegant to work with than regular point-and-click window managers (Figure 5).
But one final thing we'll look at is the default configuration file that i3 created when you first launched it. This is called config, and you'll find it in the .config/i3/
subdirectory of your home directory.
Apart from the font option, which lets you customize the font used in window titles and the i3bar, most of the other options are preceded by bindsym and configure the keybindings for the various window management options. For instance, look at this:
bindsym $mod+Shift+q kill
Here, $mod is the modifier key (Alt or Windows) that we selected during the first run of i3 – and it's also defined at the top of the configuration file. So, this line of code says "bind the key combination $mod+Shift+q to the kill command" with kill meaning close the window.
Look through the file to explore the available keybindings – there are a few lesser-used ones that we haven't talked about in this guide, but that you may find useful as time goes on. If there's a particular default keybinding that you find awkward to use, you can simply change it here, save the file, and press Alt+Shift+C to reload the configuration file without having to restart i3 completely. (To exit i3, use Alt+Shift+E and notice the confirmation bar at the top of the screen.)
One last thing: When you're getting to grips with i3, we recommend loading up the i3 Reference Card [3] and making a printout of it for your wall. For the complete i3 documentation, describing many different ways to divide up your screen, see the User's Guide [4]. Also, check out the "Other Tiling WMs" box for alternatives to i3.
Other Tiling WMs
i3 is the most popular tiling window manager, and for good reason: Its default configuration is sensible, it's insanely fast and light, and it has very few dependencies (so it doesn't pull in loads of libraries or graphical toolkits when you run it). But there are plenty of others worth exploring as well if you really get into the tiling groove.
Awesome [5] works well out of the box, but is designed as a "framework" window manager that can be extended using the Lua programming language. It implements many Freedesktop.org standards, so it fits in well with add-on tools like docks, program launchers, and system trays.
Dwm [6], meanwhile, is an extremely minimalist tiling window manager – indeed, the developers have set its source code a hard limit of 2,000 lines! And it's even possible to do tiling inside a terminal window, thanks to Tmux – see our guide on page 92 of Linux Magazine issue 193 for all the juicy details.
Infos
- i3: https://i3wm.org
- i3 subreddit: https://www.reddit.com/r/i3wm/
- i3 Reference Card: https://i3wm.org/docs/refcard.html
- User's Guide: https://i3wm.org/docs/userguide.html
- Awesome: https://awesomewm.org
- Dwm: http://dwm.suckless.org
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.