Configuration

Switchyard can be configured through its settings UI or by editing the config file directly.

Config File Location

Example

prompt_on_click = true
favorite_browser = ''
check_default_browser = true

# Link redirections (domain type is default)
[[redirections]]
find = 'x.com'
replace = 'twitter.com'

[[redirections]]
find = 'reddit.com'
replace = 'old.reddit.com'

# Pattern redirection to remove query parameters
[[redirections]]
type = 'wildcard'
find = '?utm_*'
replace = ''

# Browser rule with a single condition
[[rules]]
name = 'Work GitHub'
browser = 'firefox.desktop'

[[rules.conditions]]
type = 'domain'
pattern = 'github.com'

# Multi-condition rule with AND logic
[[rules]]
name = 'Google Docs'
logic = 'all'  # all conditions must match
browser = 'google-chrome.desktop'

[[rules.conditions]]
type = 'domain'
pattern = 'docs.google.com'

[[rules.conditions]]
type = 'keyword'
pattern = 'edit'

# Multi-condition rule with OR logic
[[rules]]
name = 'Video Sites'
logic = 'any'  # any condition can match
browser = 'brave-browser.desktop'

[[rules.conditions]]
type = 'domain'
pattern = 'youtube.com'

[[rules.conditions]]
type = 'domain'
pattern = 'vimeo.com'

[[rules.conditions]]
type = 'domain'
pattern = 'twitch.tv'

# Rule with negated condition
[[rules]]
name = 'GitHub (not Gist)'
logic = 'all'
browser = 'firefox.desktop'

[[rules.conditions]]
type = 'glob'
pattern = '*.github.com'

[[rules.conditions]]
type = 'domain'
pattern = 'gist.github.com'
negate = true  # URL must NOT match this pattern

# Rule with always ask
[[rules]]
name = 'Shopping Sites'
always_ask = true

[[rules.conditions]]
type = 'keyword'
pattern = 'amazon'

Settings

Browser Rules

Browser rules define how URLs are routed to browsers. Each rule has conditions that determine when it matches.

Conditions

Each condition specifies a pattern to match against the URL.

Condition Types

Logic Modes

Use all for precise targeting (e.g., “docs.google.com AND contains ‘edit’”) and any for broad matching (e.g., “youtube.com OR vimeo.com OR twitch.tv”).

Link redirections modify URLs before browser rules are evaluated.

Redirection Types

Domain redirections match the exact hostname, including the ports (if any). Use this to switch between sites:

[[redirections]]
find = 'reddit.com'
replace = 'old.reddit.com'

[[redirections]]
find = 'x.com'
replace = 'twitter.com'

Wildcard redirections match anywhere in the URL and support * wildcards. Use this to clean up links:

[[redirections]]
type = 'wildcard'
find = '?utm_*'
replace = ''

[[redirections]]
type = 'wildcard'
find = '&fbclid=*'
replace = ''

Regex redirections use regular expressions with capture group support ($1, $2, etc.) for complex transformations:

# Clean Amazon URLs - keep only the product ID
# amazon.com/dp/B0DZD91W4F/?tag=thewire06-20&linkCode=xm2&ascsubtag=... → amazon.com/dp/B0DZD91W4F
[[redirections]]
type = 'regex'
find = '(amazon\.[a-z.]+/dp/[A-Z0-9]+).*'
replace = '$1'

Redirections are applied in order. Domain and pattern matching is case-insensitive; regex matching is case-sensitive.