Monday, May 1, 2023

Qutebrowser. My most configurable browser, to date.

Throughout my usage of GNU/Linux, there was one browser which always stood in my way, which was recommended, which was thrown at me, whenever I looked out for a customizable browser. Firefox does all this and more with its awesome plugin system. However, the same plugin system is a hindrance for further customizations. I realized this once I dived into qutebrowser. 

The name is little distracting. Beware, the browser is far from qute. It gives complete power to the user. I have never seen a more configurable modern browser. As I started going through the process of making the browser my own according to my way of using it, it took me further into the configurable world of modern browsers. I am just blown away by the customizations you can do with this browser. Really, sky is the limit. I have just touched a drop of water from the sea. Congratulations to the dev and all the users who have share their customizations over the public network. As usual, I dont beleive in re-inventing the wheel and kanged as much configuration as possible from the public network and very little from the documentation.
 

Create a start page with your most visited web pages and create a variable in the config.py file like so

home = 'file://home/my_name/../../startpage.html'

Plenty of examples are available over the public network for creation of a startpage. You can then reuse the variable like

#open new tab with startpage
cconfig.bind('gh', 'open -t ' + home)

#The config below will open qutebrowser with the startpage
c.url.start_pages = home


# Editor settings to open your favourite editor to be used in editable text fields
c.editor.command = [
    "alacritty",
    "-e",
    "nvim",
    "-f",
    "{file}",
    "-c",
    "normal {line}G{column0}1"
]


# aliases to do most with keypresses

c.aliases = {
        'incognito': 'open --private',
        'q':    'close',
        'qa':   'quit',
        'w':    'session-save',
        'wq':   'quit --save',
        'wqa':  'quit --save',
        'bkl': 'bookmark-list',
        'bko': 'bookmark-load',
        'bkd': 'bookmark-list',
        'bka': 'bookmark-list',
        'firefox': 'spawn --detach firefox {url}'
        }



# My favourite settings

# Bindings for normal mode
config.unbind('d')
config.unbind('xo')
config.bind('t', 'set-cmd-text -s :open -t')
config.bind('m', 'hint links spawn cvlc {hint-url}')
config.bind('M', 'quickmark-save')
config.bind('q', 'tab-close')
config.bind('cs', 'set-cmd-text :config-source')
config.bind('ce', 'config-edit')
config.bind(';', 'set-cmd-text :')                                                                                             config.bind('ct', 'config-cycle content.user_stylesheets themes/default.css themes/gruvbox.css')
config.bind('di', 'hint images spawn wget -P Pictures {hint-url}')
config.bind('dl', 'hint links spawn wget -P Downloads {hint-url}')
config.bind('gH', 'open ' + home)
config.bind('gh', 'open -t ' + home)
config.bind('pt', 'open -t -- {clipboard}')
config.bind('pw', 'open -w -- {clipboard}')
config.bind('yc', 'hint links yank')
config.bind('yi', 'hint images yank')
config.bind('=', 'zoom-in')
config.bind('+', 'zoom')
config.bind('pb', 'open -p ')
config.bind(',b', 'config-cycle content.blocking.enabled true false')
config.bind(',s', 'config-cycle content.javascript.enabled true false')
config.bind('<Ctrl-Tab>', 'tab-next')
config.bind('<Ctrl-Shift-Tab>', 'tab-prev')
config.bind('<Ctrl-/>', 'undo')
config.bind('<Ctrl-Backspace>', 'back')
config.bind('<Ctrl-Shift-Backspace>', 'forward')



# open your links faster. Open links with two key strokes

config.bind(',1', 'open https://yewtu.be')
config.bind(',2', 'open -t https://linuxtoday.com')


# adblock lists

c.content.blocking.hosts.lists = [
                    "https://www.malwaredomainlist.com/hostslist/hosts.txt",
                    "https://someonewhocares.org/hosts/ipv6/hosts",
                    "http://winhelp2002.mvps.org/hosts.zip",
                    "http://malwaredomains.lehigh.edu/files/justdomains.zip",
                    "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext",
                    "https://easylist.to/easylist/easylist.txt",
                    "https://easylist.to/easylist/easyprivacy.txt",
                    "https://secure.fanboy.co.nz/fanboy-annoyance.txt",
                    "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt",
                    "https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt",
                    "https:/raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2023.txt"]


# Plenty of options for search engines

c.url.searchengines = {"DEFAULT": "https://duckduckgo.com/?q={}",
        's':        'https://searx.ninja/?q={}',
        'w':        'https://en.wikipedia.org/wiki/{}',
        'v':        'https://invidious.snopyta.org/search?q={}',
        'i':        'https://searx.ninja/?q=!images+{}',
        }

If you are a fan of darkreader plugin on firefox, there is one for qutebrowser. Kindly search the public network since the links might get outdated.


Again, the above are just few of my favorites. Many are scattered over the public network. Happy hunting.
Thank you again, to the dev, the contributors, the users and the entire freedom software ecosystem to make all this possible.

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