···1919- **Rule-based routing**: Automatically open URLs in specific browsers based on powerful patterns.
2020- **Multi-condition rules**: Combine multiple conditions with AND/OR logic for precise control.
2121- **Multiple pattern types**: Exact Domain, URL Contains, Wildcard, and Regex matching.
2222+- **Negative patterns**: Exclude specific URLs by inverting any condition (e.g., "all GitHub except Gist").
2223- **Custom URI scheme**: Create links that specify browser preferences directly with `switchyard://` URLs.
2324- **Quick browser launcher**: When no rule matches, quickly select a browser with keyboard or mouse.
2425- **Keyboard shortcuts**: Press Ctrl+1-9 to instantly select a browser.
+16
docs/Configuration.md
···5555type = "domain"
5656pattern = "twitch.tv"
57575858+# Rule with negated condition
5959+[[rules]]
6060+name = "GitHub (not Gist)"
6161+logic = "all"
6262+browser = "firefox.desktop"
6363+6464+[[rules.conditions]]
6565+type = "glob"
6666+pattern = "*.github.com"
6767+6868+[[rules.conditions]]
6969+type = "domain"
7070+pattern = "gist.github.com"
7171+negate = true # URL must NOT match this pattern
7272+5873# Rule with always ask
5974[[rules]]
6075name = "Shopping Sites"
···8710288103- **type**: Match type (see below).
89104- **pattern**: The pattern to match against.
105105+- **negate**: If true, the condition is inverted (URL must NOT match). Default: false.
9010691107## Condition Types
92108
+3-2
src/config.go
···2525type Condition struct {
2626 Type string `toml:"type"` // "domain", "keyword", "glob", "regex"
2727 Pattern string `toml:"pattern"`
2828+ Negate bool `toml:"negate,omitempty"`
2829}
29303031type Rule struct {
···109110 if logic == "all" {
110111 // AND: All conditions must match
111112 for _, cond := range r.Conditions {
112112- if !matchesPattern(url, cond.Pattern, cond.Type) {
113113+ if !matchesPattern(url, cond.Pattern, cond.Type, cond.Negate) {
113114 return false
114115 }
115116 }
···117118 } else {
118119 // OR: Any condition must match
119120 for _, cond := range r.Conditions {
120120- if matchesPattern(url, cond.Pattern, cond.Type) {
121121+ if matchesPattern(url, cond.Pattern, cond.Type, cond.Negate) {
121122 return true
122123 }
123124 }