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.

No comments:

Post a Comment

Nobody can deter me away from "free as in freedom" concept seeded by Sri RMS. See to it that u dont make fun of my belief. If u think otherwise, no need to comment.