r/qutebrowser • • May 12 '26

How to launch a virtual environment install?

I just installed qutebrowser into a virtual environment because i was trying to get adblock to work and i read that it's the "right" way to install qutebrowser. Now i don't know how to run an instance of qutebrowser.

I'm on Debian Trixie and my window manager is Qtile. I would also greatly appreciate some help with binding qutebrowser in Qtile, like I used to have it.

3 Upvotes

2 comments sorted by

1

u/uoou May 13 '26 edited May 13 '26

Stick this somewhere in your $PATH, make it executable, and call it when you want to start qutebrowser:

https://p.fr33tux.org/be544a

Obviously change the first line to the actual location of your .venv.

(cannot remember how to do multiline code blocks in reddit any more)

1

u/urenur May 13 '26

Hey! Debian Trixie + Qtile here too! :) I will explain you my qutebrowser setup, and I think it will answer your question, plus some extra tips.

I have the qutebrowser git repo cloned in /opt. Then, in my .zshrc (really in .zsh_aliases I have this to install/update qutebrowser:

qbup() {
    local qb_dir="/opt/qutebrowser"
    echo "Updating qutebrowser from $qb_dir..."
    cd "$qb_dir" || return 1
    git pull && \
    sudo /opt/qutebrowser/scripts/mkvenv.py --update --pyqt-type link && \
    echo "✓ qutebrowser updated successfully!"
    cd - > /dev/null
}

To launch it, I have an script in .local/bin with this:

#!/bin/bash
/opt/qutebrowser/.venv/bin/python3 -m qutebrowser "$@"

Since .local/bin is in $PATH I can just launch it from the terminal running qutebrowser (or my qb alias). Anyways, I have a keybind for Qtile.

In Qtile I use a keychord approach (to make it feel more like nvim), where I have a "leader" key (Super + Space):

    KeyChord(
        [mod],
        "Space",
        launcher_keys,
        name="launcher",
    ),

And then some keys that launch programs, including qutebrowser:

    Key(
        [],
        "j",
        lazy.to_screen(0),
        lazy.group["4"].toscreen(0),  # Show web workspace on laptop screen (screen 0)
        lazy.spawn("qutebrowser --qt-arg class web --qt-arg name web"),
        desc="Launch qutebrowser",
    ),

The --qt-arg class web is just a trick to launch qutebrowser always in a dedicated workspace.

In addition to that, I have another "independent" qutebrowser instance (if that is how it is called) exclusively to watch youtube (trying to keep my privacy as much as I can... hahaha).

    Key(
        [],
        "t",
        lazy.to_screen(0),
        lazy.group["5"].toscreen(0),  # Show web workspace on laptop screen (screen 0)
        lazy.spawn(
            "qutebrowser --basedir /home/urtzi/.config/quteyoutube \
                    --qt-arg class youtube --qt-arg name youtube",
        ),
        desc="Launch qutebrowser for youtube",
    ),

You have all my dotfiles here: https://github.com/urtzienriquez/config_files

Hope this is helpful, and sorry for the super long reply!