···11# Switchyard
2233-**A rules-based URL router for Linux that replaces your default web browser.** When you click a link, Switchyard makes sure it gets sent to the right browser based on your rules, or lets you choose with a quick prompt.
33+**A rules-based URL router for Linux.** When you click a link, Switchyard automatically opens it in the right browser based on your rules, or shows a quick picker to let you choose.
4455<p align="center">
66 <img src="docs/images/switchyard-prompt.png" alt="Switchyard Prompt" width="600">
···16161717## Why Switchyard?
18181919-Switchyards are the backbone of modern commerce. Instead of all trains (URLs) going to the same destination (one browser), switchyards direct each one to the right track (browser) based on pre-existing rules. Work links go to your work browser, social sites to another, and you can manually switch tracks when needed.
1919+Like a railroad switchyard directing trains to different tracks, Switchyard routes URLs to the appropriate browser based on your rules. Work links go to your work browser, personal sites to another, and you can manually choose when needed.
20202121## Features
22222323-- **Rule-based routing**: Automatically send URLs to specific browsers based on powerful text patterns.
2424-- **Multi-condition rules**: Stack multiple conditions with AND/OR logic for precise routing.
2525-- **Multiple pattern types**: Exact domain, URL contains, wildcard (glob), and regex.
2626-- **Quick picker**: When no rule matches, choose from your installed browsers with keyboard or mouse.
2727-- **Keyboard-first**: Press 1-9 to instantly select a browser, arrow keys to navigate.
2828-- **Daemonless**: Runs only when needed, no background processes.
2323+- **Rule-based routing**: Automatically open URLs in specific browsers based on powerful patterns.
2424+- **Multi-condition rules**: Combine multiple conditions with AND/OR logic for precise control.
2525+- **Multiple pattern types**: Exact Domain, URL Contains, Wildcard, and Regex matching.
2626+- **Quick browser picker**: When no rule matches, choose from your installed browsers with keyboard or mouse.
2727+- **Keyboard shortcuts**: Press Ctrl+1-9 to instantly select a browser.
2828+- **Lightweight**: Runs only when needed, no background processes.
2929- **GTK4 + libadwaita**: Native GNOME look and feel.
30303131## Installation
···8484### Keyboard Shortcuts
85858686**In the picker:**
8787-- `1-9` - Select browser by number
8888-- `↑/↓` - Navigate list
8989-- `Enter` - Open in selected browser
9090-- `Escape` - Cancel
8787+- `Ctrl+1-9` - Select browser by number
8888+- `Escape` - Close picker
91899290**In settings:**
9391- `Ctrl+Q` - Quit
···166164167165| Field | Description |
168166|-------|-------------|
169169-| `type` | One of: `domain`, `keyword`, `glob`, `regex` |
167167+| `type` | Match type: `domain`, `keyword`, `glob`, or `regex` |
170168| `pattern` | The pattern to match against |
171169172170### Condition Types
173171174172| Type | Description | Example |
175173|------|-------------|---------|
176176-| `domain` | Exact domain match | `github.com` |
177177-| `keyword` | URL contains text | `youtube.com/watch` |
178178-| `glob` | Wildcard pattern | `*.github.com` |
179179-| `regex` | Regular expression | `^https://.*\.example\.(com\|org)` |
174174+| `domain` | Exact Domain - matches specific hostname | `github.com` |
175175+| `keyword` | URL Contains - matches if URL contains text | `youtube.com/watch` |
176176+| `glob` | Wildcard - pattern with * wildcards | `*.github.com` |
177177+| `regex` | Regex - regular expression matching | `^https://.*\.example\.(com\|org)` |
180178181179### Logic Modes
182180···190188| Setting | Description |
191189|---------|-------------|
192190| `prompt_on_click` | Show picker when no rule matches (default: true) |
193193-| `fallback_browser` | Fallback browser to use when prompt is disabled and no rule matches |
191191+| `fallback_browser` | Default browser to use when picker is disabled and no rule matches |
194192| `check_default_browser` | Prompt to set Switchyard as system default browser on startup (default: true) |
195193196194## Development
···216214217215Switchyard draws inspiration from other excellent URL routers and browser pickers:
218216219219-- **[Choosy](https://choosy.app/)** - The gold standard URL router for macOS. Beautiful UI and powerful rule-based routing, but not available on Linux.
220220-- **[Junction](https://github.com/sonnyp/Junction)** - Slick browser picker for Linux with a snazzy interface, but without rule-based URL routing.
217217+- **[Choosy](https://choosy.app/)** - The gold standard URL router for macOS with beautiful UI and powerful rule-based routing.
218218+- **[Junction](https://github.com/sonnyp/Junction)** - Elegant browser picker for Linux with a modern interface.
221219222222-Switchyard aims to combine the best of both: Choosy's rule-based routing with a fast, native Linux experience.
220220+Switchyard combines the best of both: powerful rule-based routing with a fast, native Linux experience built on GTK4 and libadwaita.
223221224222## License
225223
+3-3
data/io.github.alyraffauf.Switchyard.desktop
···11[Desktop Entry]
22Type=Application
33Name=Switchyard
44-GenericName=Web Browser
55-Comment=Rules-based URL router
44+GenericName=Browser Chooser
55+Comment=Choose which browser opens each link
66Exec=switchyard %U
77Icon=io.github.alyraffauf.Switchyard
88Terminal=false
99Categories=Network;WebBrowser;
1010MimeType=x-scheme-handler/http;x-scheme-handler/https;
1111StartupNotify=true
1212-Keywords=browser;web;url;link;
1212+Keywords=browser;web;url;link;chooser;picker;router;switch;
+14-14
data/io.github.alyraffauf.Switchyard.metainfo.xml
···33 <id>io.github.alyraffauf.Switchyard</id>
44 <name>Switchyard</name>
55 <summary
66- >Rules-based URL router that replaces your default web browser</summary>
66+ >Choose which browser opens each link with powerful routing rules</summary>
77 <metadata_license>CC0-1.0</metadata_license>
88 <project_license>GPL-3.0-or-later</project_license>
991010 <description>
1111 <p>
1212- Switchyard is a URL router for Linux that makes sure clicked links get sent to the right browser
1313- based on your rules. Like a railroad switchyard directing trains to different tracks, it routes
1414- URLs to the appropriate browser, or lets you choose with a quick prompt when no rule matches.
1212+ Switchyard routes clicked links to the right browser based on your rules. Like a railroad
1313+ switchyard directing trains to different tracks, it automatically opens URLs in the appropriate
1414+ browser, or shows a quick picker when no rule matches.
1515 </p>
1616 <p>Features:</p>
1717 <ul>
1818 <li
1919- >Rule-based routing: Automatically send URLs to specific browsers based on powerful text patterns</li>
1919+ >Rule-based routing: Automatically open URLs in specific browsers based on powerful patterns</li>
2020 <li
2121- >Multi-condition rules: Stack multiple conditions with AND/OR logic for precise routing</li>
2121+ >Multi-condition rules: Combine multiple conditions with AND/OR logic for precise control</li>
2222 <li
2323- >Multiple pattern types: Exact domain, URL contains, wildcard (glob), and regex</li>
2323+ >Multiple pattern types: Exact Domain, URL Contains, Wildcard, and Regex matching</li>
2424 <li
2525- >Quick prompt with keyboard shortcuts (press 1-9 to instantly select a browser)</li>
2626- <li>Daemonless: Runs only when needed, no background processes</li>
2727- <li>Simple TOML configuration file for power users</li>
2525+ >Quick browser picker with keyboard shortcuts (press Ctrl+1-9 to instantly select)</li>
2626+ <li>Lightweight: Runs only when needed, no background processes</li>
2727+ <li>Simple TOML configuration file for advanced customization</li>
2828 </ul>
2929 </description>
3030···6969 <p>Initial release</p>
7070 <ul>
7171 <li
7272- >Rules-based URL routing with multiple pattern types (domain, keyword, glob, regex)</li>
7272+ >Rules-based URL routing with multiple pattern types (Exact Domain, URL Contains, Wildcard, Regex)</li>
7373 <li>Multi-condition rules with AND/OR logic</li>
7474- <li>Quick browser prompt with libadwaita UI</li>
7575- <li>Settings window for managing rules</li>
7676- <li>Keyboard-first (press 1-9 for instant selection)</li>
7474+ <li>Quick browser picker with modern libadwaita UI</li>
7575+ <li>Settings window for managing rules and preferences</li>
7676+ <li>Keyboard shortcuts (press Ctrl+1-9 for instant selection)</li>
7777 </ul>
7878 </description>
7979 </release>
+6-6
flatpak/io.github.alyraffauf.Switchyard.yml
···1414 - --device=dri
15151616 # Access to Flatpak service for spawning host commands
1717- # Required for checking/setting default browser via xdg-settings
1717+ # Required for checking and setting Switchyard as the default browser via xdg-settings
1818 - --talk-name=org.freedesktop.Flatpak
19192020- # Read specific directories to detect installed browsers
2020+ # Read directories to detect all installed browsers (native, Flatpak, and Snap)
2121 - --filesystem=xdg-data/applications:ro
2222 - --filesystem=xdg-data/flatpak:ro
2323 - --filesystem=/var/lib/flatpak:ro
2424 - --filesystem=/var/lib/snapd:ro
2525 - --filesystem=host:ro
26262727- # Extend XDG_DATA_DIRS to include host and flatpak paths so GIO can find all .desktop files
2828- # This is critical for gio.AppInfoGetRecommendedForType to work correctly
2727+ # Extend XDG_DATA_DIRS to find all .desktop files from host, Flatpak, and Snap apps
2828+ # Required for discovering and launching all installed browsers
2929 - --env=XDG_DATA_DIRS=/app/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/share:/run/host/usr/share:/var/lib/flatpak/exports/share:~/.local/share/flatpak/exports/share:/var/lib/snapd/desktop
3030modules:
3131 - name: glib
···5151 build-commands:
5252 - |
5353 . /usr/lib/sdk/golang/enable.sh
5454- # Ensure cache directory exists
5454+ # Ensure Go cache directory exists
5555 mkdir -p "$GOCACHE"
5656- # Build with vendor mode for reproducibility
5656+ # Build with vendored dependencies for reproducibility and smaller binary size
5757 go build -mod=vendor -trimpath -ldflags="-s -w" -o switchyard ./src
5858 - install -Dm755 switchyard /app/bin/switchyard
5959 - install -Dm644 data/io.github.alyraffauf.Switchyard.desktop /app/share/applications/io.github.alyraffauf.Switchyard.desktop