Skip to content

vimpostor/sphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sphere

Sphere is a Linux browser proxy application, that can register different handlers for http/https URI schemes, similar to how Android apps can register to be the default app for just specific https URLs by setting android:pathAdvancedPattern.

It works by registering sphere as the default browser, which acts as a proxy that delegates to the correct final application via rules given in a configuration file.

The configuration file is located at ~/.config/sphere/config and has a very simple syntax <rule_regex> <handler>. The file is parsed from top to bottom and the first line where <rule_regex> matches the given URL, will cause the corresponding <handler> to be executed.

Example

The following example will configure Chromium as the default browser, while opening Spotify links directly in the Spotify desktop application:

^https://open.spotify.com/(artist|album|track|search)/[[:alnum:]]+\??.*$ spotify-launcher
.* chromium

Note that the rules are tried from top to bottom, so the default browser should usually come last with a Regex that matches everything.

Installation

Arch Linux users can simply install the sphere-git package.

To build from source, clone the repo and run:

cabal build
cabal install

Usage

First ensure that Sphere is set as your default browser:

xdg-settings set default-web-browser sphere.desktop

Then configure the rules in ~/.config/sphere/config.

Demo

sphere.mp4

Also read my blog post about this.