Showing posts with label i3. Show all posts
Showing posts with label i3. Show all posts

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.

Friday, June 12, 2020

Well, What is on my raspberry pi 4

The first thing I install is my client for the cloud based notes application. I use simplenote. It has the advantage that it is available on all the major platforms. There is a terminal client called sncli. This is my go to client.
The next thing is to install terminology for the terminal. After trying out many, I observed that terminology is the fastest on the pi.
i3 window manager. I cannot live without it. None of my Gnu/Linux installations is complete without this. It is lightweight, easily configurable and simple.
For the browser, since I have started using computers I have sided with Firefox. I am at home with this browser. I install noscript, ublock, privacy badger and dark reader plugins. I like it. It has always met my expectations.
For the application launcher i go with rofi. The run menu is shown in a small window in the bottom left corner of my monitor.
For searching on the command line I use ddgr(DuckDuckgo client for the terminal) and surfraw. After installing surfraw I install a small script called menu-sufraw available on github. This integrates beautifully with rofi. Must try.
For the office suite, My choice was OpenOffice before it went to the butcher's table with the Apache foundation. Now it is libreoffice. I like it. It gets the job done.
For my text editor, wait, wait, I use both Neovim and Doom emacs as demanded by the situation. I use emacs with the client/server model. It is quick and very snappy to start and to work.
Feh for my wallpaper needs.
There is one more plugin which I install on firefox, it is called play-with. This I combine with mpv. We now have an awesome combination for playing streaming content on the pi. For this configuration to work there is one more piece of software required and that is youtube-dl. A beautiful example of the unix philosophy working for the modern age of the internet.
Not to forget that all the apps are in dark mode, if available. I like the dark mode. It has been excellent for my eyes. Even now when firefox flashes before loading a tab, I close my eyes for a while. Thank you, Apple, only for bringing the dark mode into vogue.
My hardware setup is already discussed in one of my previous posts.
font-awesome for that "graphics" in the terminal.
d2code for the font, wherever possible. I like its legibility.
I use i3status showing the date, time, empty space, processor speed and the temperature.

Thanks to all the devs/users of all the freedom software. My respect to one and all without which this post wouldn't exist.

Sunday, October 6, 2019

So near to a Desktop..............Raspberry Pi 4

Its been a long time since I wrote anything technical. This particular piece has been long overdue. The public network is full of ideas of what not can be achieved with a raspberry pi. After owning the original pi and surprising plenty of people with its capability to output videos at full HD, You know, I was eagerly awaiting a pi with 4k capabilities. Many people were surprised at the announcement of the rpi 4 and its capabilities. I for one thought that the maker and I have a connection. But, yes, the connection lost lots of packages between. So, what have we got in terms of what I really wanted

1. 4k desktop(I don't know which monitor gets the capability at 60Hz. My monitor defaults to 30Hz whatever I try. I think we are talking about the latest HDMI standards)
2. 4k movie playback is still patchy. I think it will get better with the foundation/users/developers hacking away at it
3. USB 3.0 support is a major leap(We will discuss below how, this is a radical decision)
4. USB C charging is also welcome with more power headed its way(But not enough)

The best OS to run on a rpi4 is no doubt raspbian. Yes, it is still a 32 bit OS. But, wait, the foundation is supporting all the pi's dating back to the first one. Kudos to the team.There are plenty of options for running 64 bit OS developed by groups and hobbyist OS enthusiasts. They are limited by the quirks in the hardware and its hardware acceleration. The memory limit issues have been resolved. Now it is only about video output performance to be bought on par with the 32 bit raspbian. As we are speaking there is a thread testing out a 64bit kernel with 32 bit userland. For running the latest Firefox, a 64 bit kernel is now a prime requirement and the rpi hackers are getting there. Tried all of them out there. They all have certain polish out there. They run faster, they are stable enough. But, video output performance has not reached the 32 bit raspbian level. I always came back to raspbian by restoring the backup.

The foundation was little brave this time and touted the rpi 4 as a desktop replacement. That claim, is very gutsy. If your desktop requirement is to run a browser and not wanting to watch High Def videos multitasking with office suites, then, the rpi 4 is good enough. Oh, oh, wait. Before telling me otherwise, I do agree that ou can improve the performance and extract more juice out of the pi by investing a little more of your time an accessories. To bring the performance of the rpi 4 to a desktop level, you would require

1. A heat sink with fan(money) This is a necessary investment. Your rpi 4 runs very hot. It has to be cooled down or else you will feel the throttling. Even opening one single application raises the temperature to the max.
2. An sd card with highest transfer rate possible with corruption resistance(I came up with that)(money money)
3. Buy the original usb c charger. There have been reports that the rpi4 is picky when it comes to usb c chargers(money money money)

With the above items, and a little bit of overclocking and some software optimizations the rpi 4 is definitely nearing a desktop feature set.

A real desktop will definitely demand storage space. Here the usb ports come into play. The two usb 3.0 ports are a god send. Just connect your external HDD's and you have the storage capability of a desktop. A good desktop also has Bluetooth connectivity and 3.5mm jack connectivity. You are completely covered here. A good desktop of course has to have a keyboard and mouse connected. Your are covered here also with the two usb 2.0 ports. So you have to connect more usb devices, like another external HDD. Your Pi will die here. Now, it is time to invest in a powered usb hub(money X 4). Be careful here and buy a good one and check the power distribution among the ports in the hub.

A monitor. What is a desktop without a monitor. You definitely will have an old monitor lying in the attic. It is time to brush it off and connect it to the pi. Oh, you are far ahead and have a 4k monitor a 4k tv, rpi has you covered. The pi is very picky when it comes to supporting 4k. You might be out of luck for older ones. Buy a good hdmi cable. Or, better buy the official one. The desktop feels snappy. Choose your apps properly. Prefer functionality over eye candy. In this way you can get more out of your pi. Yeah, I heard you. You can always get a "mini" desktop from various vendors. But, I would like to stop you here. Will it be as hackable as the pi. Will it have the whole world building things for it. Will you be able to search the public network for issues and resolutions. Will you get to run Debian GNU/Linux as well as the pi can run. Will it be credit card sized. Will you enjoy it. Will it give you joy.......

Now, coming to the most costliest investment to extract more from your pi. The ssd. This is a must. The loading of applications from the sd card is pathetically slow. Opening word processors/modern web browsers will be slow(When I say slow, I meant in comparison with a desktop with the latest desktop processors from the big guys). I recommend strongly to invest in an ssd. All of a sudden, the rpi 4 becomes a "real" candidate for desktop space. Suddenly the pi feels snappier. It boots faster. The copying, installing, upgrading are faster. Applications load faster. The UI is very responsive. I can go on. It is highly recommended to go for a ssd on immediately buying the rpi 4. What would be the size? Well, you have been running your pi from an 8 bit card(Yes, even now that is enough). I dont think you get an ssd less than 32 GB. So go for the minimum sized ssd, if you are hard pressed for money otherwise, go the full monty and go for a bigger drive with enough space for all your data. It is upto you. But buy an ssd. Though I am stressing the requirement of an ssd, it is important that you appreciate its requirement. I suggest you run your pi from an sd card and then after a couple of months upgrade for an ssd. Then you will appreciate what I am talking about here and also why I spent a paragraph in influencing you to upgrade to an ssd. If you are seeing degraded performance after installing on a ssd, go here

Well, I observed that the post is not well balanced. It is like a non uniform graph, jumping about on the sheet. If you are reading it, you are definitely a fan of the rpi. So read on.

The public network is floating with optimizations available for the rpi 4. There are plenty of posts which help you to extract the last atom of juice from you rpi. Here are my recommendations. If you have any more feel free to share with me. Thanks in advance for all those efforts. Let me brief about my setup

1. rpi 4, 4GB
2. 4TB spinning HDD and a 1TB spinning HDD
3. 4 Port(USB 3.0) powered hub for connecting the above HDDs to the pi
4. Official charger for the rpi 4(This cant supply power to the second hdd)
5. 4K 32" monitor
6. Logitech wireless keyboard(K 400) with both keyboard and a touchpad. You will love this setup if you are invested in window managers. More on this later in the post
7. 8GB sd card
8. 128GB SSD connected to the USB 3.0 Port
9. A transparent case
10. Copper heat sinks for the main processor and the graphic processor
11. Fan

I have flashed the fully featured raspbian on the 8GB sd card. I then followed this excellent post to move the root file system to an SSD. Huge thanks to the OP and all the users/devs contributing o this huge thread. Dont use the option of using the method of device names like /dev/sda1 use the other option of specifying the id of the partitions for better compatibility and allowing the dirty job of allocating the device names to the OS by giving it a free hand and not doling out names which would make your device not bootable. If you are sure you are not going to connect any other disk then go ahead and do the first method. I suggest the partition id method.

Now it is time to disable the services which you don't want. There are plenty of posts and lots of directions in the raspberry pi forums for this. The sky is the limit and every user has his own requirements so go ahead and treat yourselves.

The default xfce4 desktop is quite good. That is if you are fan of traditional desktop environments. If you are a power user, then I would suggest you to shift to window managers. As their name they just manage windows. That is exactly what majority of us do when we fire up the desktop. For all other configurations we have the terminal. In my opinion, the most lightest terminal I have used to date has been urxvt. When I started searching for window managers and at last settling for i3, I was shocked to see that the majority of the configuration files shared by users on the public network mentioned urxvt as their terminal emulator. Once I started using it and configured it to my hearts content, any other terminal is bloated. When I fire up the rofi launcher and choose lxterminal, the hourglass is displayed for a brief amount of time. With an urxvt session, it is instantaneous. It is pure bliss. And when you are getting this response on a pi, it is a festival of sort whenever i fire up this emulator. I adore all the devs involved in this project. My favourite colour scheme is the solarized one and urxvt looks fabulous with this. Making it full screen without any borders and menus is........

The next piece of software I would like to talk is about youtube-dl. For all the command line junkies. This is a god send. Coupled with the unix philosophy of chaining the output of several commands, you have a miracle at your finger tips. Just combine it with omxplayer and you have a fantastic streaming solution. Did I tip my hat to the devs? Yes. Now, coming down to omxplayer. This is a quintessential piece of scripting to extract the maximum out of the video sub system of the pi. I am astonished at the video capabilities of the pi. All credit to the omxplayer devs. I do agree there might be some proprietary magic here. But, the foundation is working towards producing a good FLOSS representation of the graphics driver. All my best wishes for the team. Youtube does frequently defeat the purpose of youtube-dl but the devs have always found ways around it. I love you guys.


As always, all the ideas and optimizations mentioned here have been culled from all over the public network. If any credit is due, please drop a line and it will be acknowledged.