Git Product home page Git Product logo

sphere's Introduction

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.

sphere's People

Contributors

vimpostor avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

sphere's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.