Qutebrowser ricing with .Xresources colors

Hi there, started to manage my terminal colors and gtk theme with pywal and went to qutebrowser theming at some point. Here the summary of what i found. You don’t need to use pywal yourself, it just updates .Xresources and some other templates for me.

Here the examples of how you can color it:

Got some interest? Here we go. Few simple steps:

  1. Add loading colors from .Xresources to very beginning of your config.py of qutebrowser
import subprocess

def read_xresources(prefix):
    props = {}
    x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE)
    lines = x.stdout.decode().split('\n')
    for line in filter(lambda l : l.startswith(prefix), lines):
        prop, _, value = line.partition(':\t')
        props[prop] = value
    return props

xresources = read_xresources('*')
# can be userd now like `c.colors.statusbar.normal.bg = xresources['*.background']`
  1. Now you can customize your config with new colors from .Xresources or use part of my config, which available here.

  2. You can reload running instance of qutebrowser with simple python script, check it here.

Don’t hesitate to play with the coloring qute UI in config.


Top job @dimaom

@dimaom I 'm using it now, it’s very cool! Thank you!!

That’s fantastic, thanks for sharing.

You are welcome.

1 Like

This is brilliant ,thanks. Using it with wpgtk .

1 Like