Saturday, April 22, 2023

Multiple monitors with i3 wm

 This took a very long time to happen. Ultimately it is a downgrade which has made me to take up multiple monitor setup. A Dell laptop, around 5 years old, was discarded by my son certifying it to be very slow. However, the laptop was upto the task considering the mac mini which I had. So, upgraded the hdd to ssd. I started from a clean slate. Installed a clean copy of windog 10(well, paid for the license when the laptop was brought). After a flurry of updates and reboots... phew.. it was complete.

Now to the favorite part. Getting Arch Gnu/Lnux onto the laptop. Tried installing arch based derivatives with i3 as the wm. However, was not happy with the plethora of packages which got installed. I have nothing against the distros. However, I have been destroyed by the plain/vanilla install of arch Gnu/Linux on all my computers. So wiped again, and did a vanilla arch gnu/linux install. Installing packages as and when I was hitting a wall for a particular task. Just goes a long way to tell how much effort you have put to make your arch gnu/linux install "your own". That is not time wasted. But, time well spent.

As I again, brought the install to my liking, it is bewildering to see the control one has on his computer. Compare it with the windows install. Cannot compare. Yes, cannot compare the ease with which GBs of software lands on your computer in the name of "ease of use". Well, Freedom is never easy and never will be. 

 However, the point of the post is multiple monitor setup with i3. Let me start by telling that it was not easy. Lot of web searching and personal shares of various users have made me to nearly approach the setup which I liked. Again, which I liked... so... The basic premise is I wanted 05 workspaces on the QHD monitor and another 05 workspaces on the laptop display(FHD). This was my requirement. However, wherever, I was searching, the majority of the results concentrated on moving workspaces or containers or windows or another atomic elements in i3. I did not want to move applications between the monitors. Some apps are better on QHD and some on FHD. So the applications will go respectively to those workspaces as decided by the user(me). Tie the workspaces to the monitors


Howver, the point of the post is multiple monitor setup with i3. Let me start by telling that it was not easy. Lot of web searching and personal shares of various users have made me to nearly approach the setup which I liked. Again, which I liked... so...

The basic premise is I wanted 05 workspaces on the QHD monitor and another 05 workspaces on the laptop display(FHD). This was my requirement. However, wherever, I was searching, the onus was on moving workspaces or containers or windows or another atomic element in i3. I did not want to move applications between the monitors. Some apps are better on QHD and some on FHD. So the applications will go respectively to those workspaces as decided by the user(me).

Tie the workspaces to the monitors

workspace $ws1 output $qhd
workspace $ws2 output $qhd
workspace $ws3 output $qhd
workspace $ws4 output $qhd
workspace $ws5 output $qhd
workspace $ws6 output $fhd
workspace $ws7 output $fhd
workspace $ws8 output $fhd
workspace $ws9 output $fhd
workspace $ws10 output $fhd


Added the following to meet the requirement which I set out to achieve. When you now hit the hot key for navigating to a particular workspace, irrespective of the monitor, the focus is on that particular workspace.

bindsym $mod+1 focus output $qhd;workspace $ws1
bindsym $mod+2 focus output $qhd;workspace $ws2
bindsym $mod+3 focus output $qhd;workspace $ws3
bindsym $mod+4 focus output $qhd;workspace $ws4
bindsym $mod+5 focus output $qhd;workspace $ws5
bindsym $mod+6 focus output $fhd;workspace $ws8
bindsym $mod+7 focus output $fhd;workspace $ws7
bindsym $mod+8 focus output $fhd;workspace $ws8
bindsym $mod+9 focus output $fhd;workspace $ws9
bindsym $mod+0 focus output $fhd;workspace $ws10


As a bonus, now, let us say you have the workspace you want to work on in clear view on the other monitor. You just want focus on that monitor. Add the following to your config

bindsym $mod+period focus output left

Kindly bear in mind, the keybindings which are already utilized in your config file before changing anything.

Thats it.

A big Shout-out and Thanks to all the devs and users making the "free as in freedom" world possible.

Sunday, April 9, 2023