Qutebrowser ricing with .Xresources colors


#1

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.


#2

Top job @dimaom


#3

Very nice! I’ll definitely be playing with this today :smiley:


#4

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


#5

I normally have my tabs hidden unless switching, but they’re shown here. Thanks for your excellent post!


#6

That’s fantastic, thanks for sharing.


#7

You are welcome.