Qutebrowser configuration

From wikinotes

Documentation

settings docs https://qutebrowser.org/doc/help/settings.html

Core Configuration

Settings

You can test settings on-the-fly using :set.
See available settings.

:set content.pdfjs True

Set them permanently within your config.py.
(The file is read with c and config as config added to your local variable scope)

# satisfy linter
if __name__ != 'config':
    c = None
    config = None

# equivalent to `:set content.pdfjs true`
config.content.pdfjs = True

Aliases

The qutebrowser's rcfile is a python script, scripts without parameters can be bound as aliases.

c.aliases['bookmarks'] = 'open qute://bookmarks'
c.aliases['pullcfg'] = 'spawn git -C {} pull'.format(Utils.get_configdir())

User Scripts

Commands with arguments are possible via user scripts.
User scripts are external executables defined in ~/.local/share/qutbrowser/userscripts.
Arguments are passed as commandline arguments, commands are piped to $QUTE_FIFO.

#!/usr/bin/env bash
# ~/.local/share/qutebrowser/userscripts/foo

echo "open https://google.com?q=$1 $2" >> "$QUTE_FIFO"

Invoke command from qute

:spawn -u foo abc def

Themes

dark theme https://github.com/dracula/qutebrowser
base16 themes https://github.com/theova/base16-qutebrowser
nord theme https://github.com/KnownAsDon/QuteBrowser-Nord-Theme

Keybindings

:bind  " render page with all keybindings
<C-e>  " open textarea in editor.

Extensions

pdf.js

pdf.js allows you to view PDFs within the web-browser.

pacman -S pdfjs-legacy  # archlinux
# pre-installed on windows
# ~/.config/qutebrowser/config.py

config.content.pdfjs = True

Ad Blocker

To use the adblocker, you must install the python adblock to the qutebrowser's python interpreter.

:version  " find python interpreter used by qutebrowser
# install to qutebrowser interpreter for brave's enhanced adblocker
/usr/bin/python3 -m pip install adblock
:adblock-update              " update block-list for host/brave adblocker
:set blocking.enabled false  " temporarily disable adblocker

You can update the adblocker from the cli as well

timeout 5 qutebrowser --nowindow :adblock-update

TODO:

systemd timer to keep ad blocker up to date