Rules-based browser launcher for TUI + GNOME. switchyard.aly.codes
tui gome bowser go
0

Configure Feed

Select the types of activity you want to include in your feed.

update docs

Aly Raffauf (Jan 15, 2026, 12:52 AM EST) c4bb0d3e 0e924190

+42 -44
+19 -21
README.md
··· 1 1 # Switchyard 2 2 3 - **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. 3 + **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. 4 4 5 5 <p align="center"> 6 6 <img src="docs/images/switchyard-prompt.png" alt="Switchyard Prompt" width="600"> ··· 16 16 17 17 ## Why Switchyard? 18 18 19 - 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. 19 + 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. 20 20 21 21 ## Features 22 22 23 - - **Rule-based routing**: Automatically send URLs to specific browsers based on powerful text patterns. 24 - - **Multi-condition rules**: Stack multiple conditions with AND/OR logic for precise routing. 25 - - **Multiple pattern types**: Exact domain, URL contains, wildcard (glob), and regex. 26 - - **Quick picker**: When no rule matches, choose from your installed browsers with keyboard or mouse. 27 - - **Keyboard-first**: Press 1-9 to instantly select a browser, arrow keys to navigate. 28 - - **Daemonless**: Runs only when needed, no background processes. 23 + - **Rule-based routing**: Automatically open URLs in specific browsers based on powerful patterns. 24 + - **Multi-condition rules**: Combine multiple conditions with AND/OR logic for precise control. 25 + - **Multiple pattern types**: Exact Domain, URL Contains, Wildcard, and Regex matching. 26 + - **Quick browser picker**: When no rule matches, choose from your installed browsers with keyboard or mouse. 27 + - **Keyboard shortcuts**: Press Ctrl+1-9 to instantly select a browser. 28 + - **Lightweight**: Runs only when needed, no background processes. 29 29 - **GTK4 + libadwaita**: Native GNOME look and feel. 30 30 31 31 ## Installation ··· 84 84 ### Keyboard Shortcuts 85 85 86 86 **In the picker:** 87 - - `1-9` - Select browser by number 88 - - `↑/↓` - Navigate list 89 - - `Enter` - Open in selected browser 90 - - `Escape` - Cancel 87 + - `Ctrl+1-9` - Select browser by number 88 + - `Escape` - Close picker 91 89 92 90 **In settings:** 93 91 - `Ctrl+Q` - Quit ··· 166 164 167 165 | Field | Description | 168 166 |-------|-------------| 169 - | `type` | One of: `domain`, `keyword`, `glob`, `regex` | 167 + | `type` | Match type: `domain`, `keyword`, `glob`, or `regex` | 170 168 | `pattern` | The pattern to match against | 171 169 172 170 ### Condition Types 173 171 174 172 | Type | Description | Example | 175 173 |------|-------------|---------| 176 - | `domain` | Exact domain match | `github.com` | 177 - | `keyword` | URL contains text | `youtube.com/watch` | 178 - | `glob` | Wildcard pattern | `*.github.com` | 179 - | `regex` | Regular expression | `^https://.*\.example\.(com\|org)` | 174 + | `domain` | Exact Domain - matches specific hostname | `github.com` | 175 + | `keyword` | URL Contains - matches if URL contains text | `youtube.com/watch` | 176 + | `glob` | Wildcard - pattern with * wildcards | `*.github.com` | 177 + | `regex` | Regex - regular expression matching | `^https://.*\.example\.(com\|org)` | 180 178 181 179 ### Logic Modes 182 180 ··· 190 188 | Setting | Description | 191 189 |---------|-------------| 192 190 | `prompt_on_click` | Show picker when no rule matches (default: true) | 193 - | `fallback_browser` | Fallback browser to use when prompt is disabled and no rule matches | 191 + | `fallback_browser` | Default browser to use when picker is disabled and no rule matches | 194 192 | `check_default_browser` | Prompt to set Switchyard as system default browser on startup (default: true) | 195 193 196 194 ## Development ··· 216 214 217 215 Switchyard draws inspiration from other excellent URL routers and browser pickers: 218 216 219 - - **[Choosy](https://choosy.app/)** - The gold standard URL router for macOS. Beautiful UI and powerful rule-based routing, but not available on Linux. 220 - - **[Junction](https://github.com/sonnyp/Junction)** - Slick browser picker for Linux with a snazzy interface, but without rule-based URL routing. 217 + - **[Choosy](https://choosy.app/)** - The gold standard URL router for macOS with beautiful UI and powerful rule-based routing. 218 + - **[Junction](https://github.com/sonnyp/Junction)** - Elegant browser picker for Linux with a modern interface. 221 219 222 - Switchyard aims to combine the best of both: Choosy's rule-based routing with a fast, native Linux experience. 220 + Switchyard combines the best of both: powerful rule-based routing with a fast, native Linux experience built on GTK4 and libadwaita. 223 221 224 222 ## License 225 223
+3 -3
data/io.github.alyraffauf.Switchyard.desktop
··· 1 1 [Desktop Entry] 2 2 Type=Application 3 3 Name=Switchyard 4 - GenericName=Web Browser 5 - Comment=Rules-based URL router 4 + GenericName=Browser Chooser 5 + Comment=Choose which browser opens each link 6 6 Exec=switchyard %U 7 7 Icon=io.github.alyraffauf.Switchyard 8 8 Terminal=false 9 9 Categories=Network;WebBrowser; 10 10 MimeType=x-scheme-handler/http;x-scheme-handler/https; 11 11 StartupNotify=true 12 - Keywords=browser;web;url;link; 12 + Keywords=browser;web;url;link;chooser;picker;router;switch;
+14 -14
data/io.github.alyraffauf.Switchyard.metainfo.xml
··· 3 3 <id>io.github.alyraffauf.Switchyard</id> 4 4 <name>Switchyard</name> 5 5 <summary 6 - >Rules-based URL router that replaces your default web browser</summary> 6 + >Choose which browser opens each link with powerful routing rules</summary> 7 7 <metadata_license>CC0-1.0</metadata_license> 8 8 <project_license>GPL-3.0-or-later</project_license> 9 9 10 10 <description> 11 11 <p> 12 - Switchyard is a URL router for Linux that makes sure clicked links get sent to the right browser 13 - based on your rules. Like a railroad switchyard directing trains to different tracks, it routes 14 - URLs to the appropriate browser, or lets you choose with a quick prompt when no rule matches. 12 + Switchyard routes clicked links to the right browser based on your rules. Like a railroad 13 + switchyard directing trains to different tracks, it automatically opens URLs in the appropriate 14 + browser, or shows a quick picker when no rule matches. 15 15 </p> 16 16 <p>Features:</p> 17 17 <ul> 18 18 <li 19 - >Rule-based routing: Automatically send URLs to specific browsers based on powerful text patterns</li> 19 + >Rule-based routing: Automatically open URLs in specific browsers based on powerful patterns</li> 20 20 <li 21 - >Multi-condition rules: Stack multiple conditions with AND/OR logic for precise routing</li> 21 + >Multi-condition rules: Combine multiple conditions with AND/OR logic for precise control</li> 22 22 <li 23 - >Multiple pattern types: Exact domain, URL contains, wildcard (glob), and regex</li> 23 + >Multiple pattern types: Exact Domain, URL Contains, Wildcard, and Regex matching</li> 24 24 <li 25 - >Quick prompt with keyboard shortcuts (press 1-9 to instantly select a browser)</li> 26 - <li>Daemonless: Runs only when needed, no background processes</li> 27 - <li>Simple TOML configuration file for power users</li> 25 + >Quick browser picker with keyboard shortcuts (press Ctrl+1-9 to instantly select)</li> 26 + <li>Lightweight: Runs only when needed, no background processes</li> 27 + <li>Simple TOML configuration file for advanced customization</li> 28 28 </ul> 29 29 </description> 30 30 ··· 69 69 <p>Initial release</p> 70 70 <ul> 71 71 <li 72 - >Rules-based URL routing with multiple pattern types (domain, keyword, glob, regex)</li> 72 + >Rules-based URL routing with multiple pattern types (Exact Domain, URL Contains, Wildcard, Regex)</li> 73 73 <li>Multi-condition rules with AND/OR logic</li> 74 - <li>Quick browser prompt with libadwaita UI</li> 75 - <li>Settings window for managing rules</li> 76 - <li>Keyboard-first (press 1-9 for instant selection)</li> 74 + <li>Quick browser picker with modern libadwaita UI</li> 75 + <li>Settings window for managing rules and preferences</li> 76 + <li>Keyboard shortcuts (press Ctrl+1-9 for instant selection)</li> 77 77 </ul> 78 78 </description> 79 79 </release>
+6 -6
flatpak/io.github.alyraffauf.Switchyard.yml
··· 14 14 - --device=dri 15 15 16 16 # Access to Flatpak service for spawning host commands 17 - # Required for checking/setting default browser via xdg-settings 17 + # Required for checking and setting Switchyard as the default browser via xdg-settings 18 18 - --talk-name=org.freedesktop.Flatpak 19 19 20 - # Read specific directories to detect installed browsers 20 + # Read directories to detect all installed browsers (native, Flatpak, and Snap) 21 21 - --filesystem=xdg-data/applications:ro 22 22 - --filesystem=xdg-data/flatpak:ro 23 23 - --filesystem=/var/lib/flatpak:ro 24 24 - --filesystem=/var/lib/snapd:ro 25 25 - --filesystem=host:ro 26 26 27 - # Extend XDG_DATA_DIRS to include host and flatpak paths so GIO can find all .desktop files 28 - # This is critical for gio.AppInfoGetRecommendedForType to work correctly 27 + # Extend XDG_DATA_DIRS to find all .desktop files from host, Flatpak, and Snap apps 28 + # Required for discovering and launching all installed browsers 29 29 - --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 30 30 modules: 31 31 - name: glib ··· 51 51 build-commands: 52 52 - | 53 53 . /usr/lib/sdk/golang/enable.sh 54 - # Ensure cache directory exists 54 + # Ensure Go cache directory exists 55 55 mkdir -p "$GOCACHE" 56 - # Build with vendor mode for reproducibility 56 + # Build with vendored dependencies for reproducibility and smaller binary size 57 57 go build -mod=vendor -trimpath -ldflags="-s -w" -o switchyard ./src 58 58 - install -Dm755 switchyard /app/bin/switchyard 59 59 - install -Dm644 data/io.github.alyraffauf.Switchyard.desktop /app/share/applications/io.github.alyraffauf.Switchyard.desktop