Skip to content

CodeCorrupt/Brouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brouter

Brouter is a small macOS app that acts as a programmable default browser. Instead of opening every link the same way, it routes URLs to different commands based on simple regex rules.

When macOS opens a URL, Brouter finds the first matching rule and executes its command.

Installation

Simple install

Run this command to download and install the latest release into ~/Applications:

curl -fsSL https://raw.githubusercontent.com/codecorrupt/brouter/main/install.sh | bash

After installation, set Brouter as your default browser in System Settings.

The installer also creates an example configuration file, but you must edit it to match your browsers and preferences before Brouter will be useful.

From a release

  1. Download the latest Brouter.app from the GitHub releases page.
  2. Move it into your ~/Applications folder.
  3. Remove macOS quarantine attributes:
    • xattr -cr ~/Applications/Brouter.app
  4. Set Brouter as your default browser in System Settings.

From source

  1. Build and install the app into ~/Applications:
    • make install
  2. Then open System Settings to set it as the default browser:
    • make open-default-browser-settings

Configuration

  • Create a config file in ${XDG_CONFIG_HOME:-~/.config}/brouter/config

  • Each line defines a routing rule:

    • <regex> <command...>
    • Rules are evaluated top to bottom; first match wins
    • Lines starting with # and empty lines are ignored
  • Example:

    # Open youtube and twitch in my personal profile
    .*youtube\.com.* open -na "Google Chrome" --args --profile-directory="Personal"
    .*twitch\.com.* open -na "Google Chrome" --args --profile-directory="Personal"
    
    # Open everything else in my work profile
    .* open -na "Google Chrome" --args --profile-directory="Work"
    
  • ./src/example-config has more examples for common browsers

About

A Browser Router

Resources

Stars

Watchers

Forks

Packages

No packages published