Home

Awesome

Uroute: Route URLs to configured browsers

Overview

Uroute is like the "Open URL with..." dialog on Android.

Suppose you have the Tor Browser, Brave, and LibreWolf installed, with LibreWolf profiles LAN and VPN. With Uroute as your default browser, you can open each clicked URL in any of those browsers, in any supported mode or profile.

Screenshot

The configuration for the scenario in the screenshot above looks like this:

[main]
default_program = brave-incognito

[program:tor-browser]
name = Tor Browser
command = /home/user/tor-browser_en-US/Browser/start-tor-browser
icon = /home/user/tor-browser_en-US/Browser/browser/chrome/icons/default/default128.png

[program:brave-incognito]
name = Brave: Incognito
command = brave-browser --incognito
icon = /usr/share/icons/hicolor/64x64/apps/brave-browser.png

[program:librewolf-lan]
name = LibreWolf LAN
command = librewolf --class librewolf-profile-lan -P LAN --private-window
icon = /usr/share/librewolf/browser/chrome/icons/default/default128.png

[program:librewolf-vpn]
name = LibreWolf VPN
command = librewolf --class librewolf-profile-vpn -P VPN --private-window
icon = /usr/share/librewolf/browser/chrome/icons/default/default128.png

See the Configuration section below for more details.

This program was developed for and tested on Ubuntu 18.04 (Bionic). It should work in other Freedesktop environments with Python 3 and GTK 3 installed.

Installation

$ sudo apt install python3-gi
$ mkvirtualenv -p $(which python3) uroute
$ pip install git+https://github.com/walterl/uroute.git
$ ln -s /usr/lib/python3/dist-packages/gi $VIRTUAL_ENV/lib/python3.6/site-packages/

Usage

$ uroute https://fsf.org

Features

Tips

Assign a keyboard shortcut to Uroute. Opening a URL in Uroute is then as simple as copying the URL and launching Uroute via the keyboard shortcut. This is especially useful when you want to open a link from one browser in another.

Configuration

The Uroute configuration file lives in $XDG_CONFIG_HOME/uroute/uroute.ini. On most Linux systems that is $HOME/.config/uroute/uroute.ini.

It is created automatically and pre-populated with some crude browser detection if that file does not exist.

It contains sections main, logging and a section prefixed with program: for each configured browser.

main section

The following keys are supported:

logging section

Note: If you don't understand this section, you can safely ignore it.

This section is optional, and provides control over the Python logging configuration. All keys and values are passed to logging.basicConfig, and should be formatted accordingly.

The default level is INFO and the default format is %(levelname)s %(message)s.

program: sections

Each browser and execution mode needs to be configured in a separate section. The section title is in the form program:some-browser, where some-program is the browser's program ID. The program ID can be used to set the default_program in the main section.

[program:brave-incognito]
name = Brave: Incognito
command = brave-browser --incognito @URL
icon = /usr/share/icons/hicolor/64x64/apps/brave-browser.png

Here the program ID is brave-incognito.

name is the browser's display name.

command is the full command used to launch the browser. The string @URL is substituted for the URL to open. If not specified, the URL is appended to the end.

icon is the full path to the display icon.

Thanks