I3 tiling window manager – try it out!

      2 Comments on I3 tiling window manager – try it out!

Why choosing tiling window manager can be a good option for you and how you can get more from your operating system? Find out if it can improve your daily tasks!

Tiling window manager?

In computing, a tiling window manager is a window manager with an organization of the screen into mutually non-overlapping frames, as opposed to the more popular approach of coordinate-based stacking of overlapping objects (windows) that tries to fully emulate the desktop metaphor.

wikipedia

I have already mention i3wm in 4 top performance boosters for linux users post- you can find video showing i3wm features in general:

Here you can see a couple of my workspaces:

Some examples of tiling windows managers:

  1. i3WM
  2. Awesome
  3. DWM
  4. xmonad

Why should I consider switching to tiling WM?

Designed for keyboard use

All popular tiled WMs are designed to be operated by keyboard only (Of course you can use your mouse if you like :)). This means that every action like moving “tiles”, changing current workspace, changing current layout, resizing, going fullscreen etc. can be made by keyboard. You can work in your IDE, ask some questions on skype/slack, do some operations in terminal and get back to source code without even thinking about using a mouse.

I know that these is possible in classical window manager, however tiling WMs “push you a little” to go this way. if you feel (like I do) that its quicker to use a keyboard and want to go this way then tiling managers are probably for you.

Customizable by default

All popular tiling WMs are designed by developers for developers. This means that you can power up your window manager easily, by adding new shortcuts, modes or whole functions.

Finally… Efficient

Using classical window manager I was finding myself very often in reorganizing current desktop. Moving windows around from one screen to another, from one workspace to another. In case of single-workspace systems (like all Ms Windows) you can have a loooong list under ALT-TAB shortcut.

In tiling WM you will forget about alt-tab behaviour. Most powerful thing is that you can teach your WM to place tiles in exact manner that you like them to on particular workspaces. Basically after some time you will find out that you hardly rearrange anything on your desktop. Everything just works for you.

Why i3WM and not other tiling windows manager?

I did try awesome for some time. However I found myself in situation when I did not extend my current desktop environment, because awesome is using LUA scripts for all configurations. Back then I did not know lua so every change was a little bit difficult for me. Especially that awesome was my first tiling window manager. I broke a simple rule: one change at a time 🙂 If you know lua well then you can try awesome, in other case I would suggest you to try i3 – it use very simple configuration files.

My i3

Configuration files

You can find all my configuration files related to i3 here. Download it, change and use it however you like.

Basic keyboard layout

Keyboard layer when used Mod key

Keyboard layer when used Shift+Mod key

What I’ve changed:

  • jkl;  to hjkl for moving around and moving tiles
  • Mod1  to Mod4  ( Mod4  is windows key)

Workspaces

Biggest value from using i3 is automation. You can tell your WM to which workspace every window should go. Back then I used to name my workspaces directly, however after some time I found that I don’t need “names” on my screen as I already know what is where.

Take a look on my current configuration as it is self-explanatory ( $tagX  == workspace X):

As you can see I simply define where i3WM should put particular application. Magic 🙂

Achieving this kind of result is very simple. To find how assign command should look like for your application you have to find its selector. Most often used is class  selector. For finding what you have to put within it you can use xprop  application:

After typing  xprop (probably you will have to install it) you have to “click” on application (by mouse). Then you will receive all data as in above example. This line:

keeps information about class. So If I would like to have pcmanfm always appear on workspace 5 then I will add this line to my config file:

And that’s it!

How I have things organised?

At the moment I use up to 7 workspaces:

  1. Work – main window. I used to have here my current IDE, file managers, and all other applications as this is my “default” workspace to work with. Usually I use here tabbed layout.
  2. Browser – only browsers are usually here. This one also use tabbed layout.
  3. Shell – terminals 🙂 Split layout of course 😉
  4. Conversations – Skype, sometimes qtox or thunderbird when I remember that I still have this one 😉 Usually tabbed layout
  5. Slack – Slack only..
  6. Special – This one is empty. Sometimes I run specific application and when I want to have it on a side it goes manually to workspace 6
  7. Music – Spotify, Vlc. Music in general.

Thanks to automatic arrangement all my applications go directly to workspace that is prepared for them in my mind. So if I want to search for something in the internet then I go to workspace 2. If I need to do something in terminal I go to workspace 3, when I need to ask some of my colleagues about something I go to 4 for skype and 5 for slack. Everything is always there for me as it should be.

Modes

Another great feature in i3wm is possibility to create “modes”. Mode is an extension where you can put more commands under one shortcut. My modes are:

  • resize_window – default mode that you will have out of the box under  $mod+r then you can change size of currently selected tile using arrows or jkl; .
  • exit – mode where I can choose one of:
    • lock
    • shutdown
    • logout
    • reboot
    • hibernate
  • office – mode where i can select one of libreoffice application
  • browser – running one of selected browser
  • ide – as you can guess- it helps me to select IDE:
  • quick – I think of it as “quick access”. For example:
    • postman
    • skype
    • slack
    • spotify
  • screen – this one helps me to prepare my workspace at particular places. Back then it was used to change from single notebook display to multiple displays. Currently it change configuration from notebook display to external one as I don’t use more than one monitor anymore (yes!)

Example mode configuration looks like this:

At first you set how it should look after invoking, then you describe your mode, after this you have to create shortcut to particular mode. Now When I use  $mod+p I will see at the bottom of my screen something like this:

So I can choose from one of above browsers. Please note that after command there is operation to go back to “default” mode. One can create “nested” modes. It’s possible to create mode that will be for example used only during development and change totally all shortcuts and behaviour, however I never get that far 😉

Other configurations?

In my configs repo you can also find a few other things:

  • own shortcuts – which are very easy to add
  • autostart applications
  • i3bar configuration
  • i3gaps configuration
  • color changes

Tips & Trics

Here are a few very useful in my opinion tips and trics that you may want to reuse:

  • Change moving around shortcuts from jkl;  to hjkl . Especially if you are using vim 🙂
  • Add  exec --no-startup-id nitrogen --restore  somewhere near end of config file. It will restore your desktop wallpaper. It’s really useful if you are using multiple displays or change from notebook to external one 🙂
  • Add these two lines to your shortcut configuration:

    After installing scrot you will be available to take screenshots (printscr for full desktop, shift+printscreen and then select desktop part using mouse to take partial screenshot).
  • I found that access to simple calendar can be really useful:

    This is how it looks like:

Afterwords

There is still a lot to say about i3WM. Definitely I will  write more about this great window manager in future. Leave a comment below!

Upcoming Events where you can meet me

  1. JUG Zielona Góra – Kubernetes intro for programmers

    October 25 @ 18:30 - 21:00
  2. SpreadIT 2017

    November 18

2 thoughts on “I3 tiling window manager – try it out!

Leave a Reply