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:
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
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):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# Main assign [class=".*idea.*"] $tag1 assign [class="Thunar"] $tag1 assign [class="Pcmanfm"] $tag1 assign [class="Rodent"] $tag1 assign [class="Eclipse"] $tag1 assign [class="doublecmd"] $tag1 assign [class="Kodi"] $tag1 # Internet assign [class="Google-chrome-stable"] $tag2 assign [class="Firefox" window_role="browser"] $tag2 assign [class="Pale moon" window_role="browser"] $tag2 assign [class="uzbl.*"] $tag2 assign [class="google-chrome"] $tag2 assign [class="Opera"] $tag2 # Shell assign [class="Terminator"] $tag3 assign [class="Termite"] $tag3 assign [class="xfce4-terminal"] $tag3 assign [class=".*terminal.*"] $tag3 assign [class="Roxterm"] $tag3 # Conversations assign [class="Thunderbird"] $tag4 assign [class="Skype"] $tag4 assign [class="qtox"] $tag4 assign [class="skypeforlinux"] $tag4 # tools assign [class="Slack"] $tag5 # Music assign [class="spotify"] $tag7 |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
╭─dpokusa@venture ~/configurations/configs/i3 ‹master› ╰─$ xprop _NET_WM_DESKTOP(CARDINAL) = 0 WM_STATE(WM_STATE): window state: Normal icon window: 0x0 WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. bitmap id # to use for icon: 0x2600022 bitmap id # of mask for icon: 0x2600025 window id # of group leader: 0x2600001 XdndAware(ATOM) = BITMAP _MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0 _NET_WM_ICON(CARDINAL) = Icon (16 x 16): ▒▒▒▒▒░ ░ ░ ▒ ░▒▒▒▒▒▒░ ▒ ▒ ▒ ░▒▒▒▒▒▒▒▒▒▒▒▒░ ▒ ░ ▒ ▒ ░ ░ ▒ ░ ░ ▒ ▒ ░ ▒ ░ ░ ▒ ░░ ▒ ░ ▒ ░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒░ Icon (24 x 24): ░▒▒▒▒▒░ ░ ░ ▒ ▒ ▒ ▒▒▒▒▒▒▒▒▒▒░ ▒ ▒ ▒ ▒ ▒ ░░░░░░░░░░░░░░░░▒░ ▒ ░░ ▒ ▒ ░ ░ ▒ ░ ░ ▒ ▒ ░ ▒ ▒ ░ ▒ ░ ░ ▒ ░ ░ ▒ ░ ▒ ▒ ▒ ▒ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 39845893 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL _NET_WM_USER_TIME(CARDINAL) = 18526116 _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x2600004 WM_CLIENT_LEADER(WINDOW): window id # 0x2600001 _NET_WM_PID(CARDINAL) = 25422 WM_LOCALE_NAME(STRING) = "en_US.UTF-8" WM_CLIENT_MACHINE(STRING) = "venture" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified minimum size: 357 by 146 window gravity: NorthWest WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = "pcmanfm", "Pcmanfm" WM_ICON_NAME(STRING) = "dpokusa" _NET_WM_ICON_NAME(UTF8_STRING) = "dpokusa" WM_NAME(STRING) = "dpokusa" _NET_WM_NAME(UTF8_STRING) = "dpokusa" |
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:
1 |
WM_CLASS(STRING) = "pcmanfm", "Pcmanfm" |
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:
1 |
assign [class="pcmanfm"] $tag5 |
And that’s it!
How I have things organised?
At the moment I use up to 7 workspaces:
- 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.
- Browser – only browsers are usually here. This one also use tabbed layout.
- Shell – terminals 🙂 Split layout of course 😉
- Conversations – Skype, sometimes qtox or thunderbird when I remember that I still have this one 😉 Usually tabbed layout
- Slack – Slack only..
- 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
- 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# BROWSER MODE set $mode_browser Browser (p) PaleMoon (f) Firefox, (c) Chrome, (o) Opera, (u) UZBL mode "$mode_browser" { bindsym p exec palemoon, mode "default" bindsym f exec firefox, mode "default" bindsym c exec google-chrome-stable, mode "default" bindsym o exec opera, mode "default" bindsym u exec uzbl-browser, mode "default" # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym $mod+p mode "$mode_browser" |
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:
12bindsym --release Print exec --no-startup-id scrot '%Y-%m-%d_%H-%M-%S_$wx$h.png' -e 'mv $f ~/screenshots/'bindsym --release Shift+Print exec --no-startup-id scrot -s '%Y-%m-%d_%H-%M-%S_$wx$h.png' -e 'mv $f ~/screenshots/'
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:
1bindsym $mod+c exec zenity --calendar
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!
I decided to use https://github.com/ssokolow/quicktile
It adds basic tiling to any wm. I use it with xfce. It might be good alternative for anyone who wants basic tailing but doesn’t want to spend a lot of time learning and configuring stuff.
Switched to i3 three months ago. So far its the best wm I’ve ever used.