‹ RoundRect

Swurl

A link router for macOS. Swurl becomes your default browser, and every link you click in another app — Mail, Slack, a terminal — opens in the browser and profile your rules choose. When no rule decides, a wheel of your browsers appears at the pointer.

Status: early release. Swurl’s 0.0.x builds are signed, notarized and work every day, but they are early: expect rough edges and changes between versions. Install it with Homebrew or from the download.

What it is

Your rules live in one YAML file. They are tried in order, and the first one that matches decides where the link opens.

What it does

Install

With Homebrew. Homebrew 7 asks you to trust a tap other than its own before it installs anything from it, which is the second line. RoundRect’s tap holds all its apps, so you trust it once:

sh
brew tap roundrect/tap
brew trust roundrect/tap
brew install --cask roundrect/tap/swurl

Or download the DMG from the latest release, open it and drag Swurl to Applications. Either way you get Swurl.app and the swurl command, and installing does not make Swurl your default browser: that is always your choice (below).

Updates. Swurl checks for a new version when it starts and once a day, and asks before installing it. Check for Updates… is in its menu, and Settings › Updates turns the daily check off. Homebrew leaves an updated copy alone.

The file

Targets name a browser and, optionally, a profile. Rules say when to use which. Anything else goes to default, which is the wheel unless you name a target.

yaml
version: 1

targets:                                   # a browser, and optionally a profile
  work:     { app: com.google.Chrome, profile: "Profile 1" }
  personal: { app: com.google.Chrome, profile: Default }
  client:   { app: com.microsoft.edgemac, profile: "Profile 2" }

picker: [work, personal, client]           # the wheel, in this order

rules:                                     # tried in order; the first match decides
  - name: Client tools
    when: { host: ["*.client.example", "client.atlassian.net"] }
    open: client
  - name: Links from Slack
    when: { source: com.tinyspeck.slackmacgap }   # the app the link came from
    open: work
  - name: Docs, unless I'm holding shift
    when:
      host: docs.google.com
      not: { modifiers: [shift] }
    open: work

default: picker

Profiles are named by their folder (Default, Profile 1), because display names can repeat and change. swurl browsers --yaml prints a ready-to-paste target for every profile on your Mac, and swurl validate reports every problem at once, with line numbers and a suggested fix.

The command line

CommandWhat it does
swurl initCreate a commented starter config
swurl validateCheck the config, and its browsers and profiles against this Mac
swurl browsers [--yaml]Installed browsers and their profiles; --yaml prints ready-to-paste targets
swurl route <url> [--explain]Which rule decides, and why; nothing is opened
swurl open <url> [--dry-run]Route and open a link; --dry-run shows what would launch
swurl default [set|restore]Show the default browser, make Swurl the default, or put the previous one back

route can simulate any context (the sending app, held keys, running apps, environment) so you can test a rule before you rely on it. Most commands take --json.

Becoming the default browser

Swurl only becomes your default browser when you ask it to, from its menu or with swurl default set, and macOS asks you to confirm. It records the previous default first, so Restore (or swurl default restore) puts it back.

Permissions

To show your profiles’ names and pictures, Swurl reads each browser’s list of profiles. macOS treats that as data from other apps and does not ask for it, so you turn it on yourself: Swurl’s settings open System Settings › Privacy & Security › Files & Folders › Swurl, where there is one switch per browser. Swurl notices the change by itself.

Links still open without it; the wheel just can’t show those profiles. Swurl only reads browsers’ files and never changes them. It is not sandboxed, because it has to launch other browsers with a profile.

Privacy

Known limits

Requirements

Status

Swurl is in early release: version 0.0.x, available from the releases page and through Homebrew, and updating itself. Release news goes on the blog; follow the Atom feed to hear about it.