Skip to content

jonaskahn/switchy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Switchy

Switchy

Every link. Your choice. Zero friction.
The lightning-fast browser picker for Windows that routes URLs exactly where you want them β€” every single time.

Platform Go Vue Wails License


Why Switchy?

You open Chrome for work, Firefox for personal browsing, Edge for that one internal app, and Brave for everything else. But Windows lets you pick only one default browser β€” and every link goes there, no matter what.

Switchy fixes that.

Click any link β†’ Switchy intercepts it β†’ a sleek, acrylic-glass picker floats up in under a second β†’ you tap a key and it's open in exactly the right browser. You can even teach Switchy rules so work URLs go straight to Chrome, your team's Notion links open in Firefox, and everything else still asks you. Pure control, zero compromise.

Showcases

demo

Features

  • Instant browser picker β€” frameless, always-on-top acrylic window appears the moment a link is clicked; dismiss with Esc or pick with 1–9
  • Two layout modes β€” vertical list or horizontal dock; switch in settings
  • Timed auto-selection β€” optional countdown that opens your default browser automatically if no key is pressed; timer and duration are configurable
  • Smart URL rules β€” domain (d$), regex (r$), and substring (s$) patterns auto-open URLs without asking; force the picker with _Switchy
  • Alternate browser profiles β€” launch a browser's incognito or work-profile variant directly from the picker
  • Single-instance IPC β€” a second click forwards its URL to the running picker over a named pipe; no double windows
  • Native Windows feel β€” Acrylic backdrop on the picker, Mica on settings, frameless with custom drag region; looks right at home on Windows 11
  • Auto-detect browsers β€” scans StartMenuInternet registry to find every installed browser in seconds
  • Icon extraction β€” rasterizes browser icons directly from executable resources at configurable sizes (16–256 px)
  • Settings persist β€” all configuration saved to %APPDATA%\Switchy\settings.json

Project Structure

switchy/
β”œβ”€β”€ main.go               # Entry point & CLI modes (--register, --unregister, --settings)
β”œβ”€β”€ app.go                # Wails-bound App struct β€” the frontend ↔ backend bridge
β”œβ”€β”€ go.mod / go.sum
β”œβ”€β”€ wails.json
β”œβ”€β”€ .golangci.yml         # golangci-lint configuration
β”‚
β”œβ”€β”€ internal/             # Private Go packages
β”‚   β”œβ”€β”€ browser/
β”‚   β”‚   β”œβ”€β”€ launch.go        # Launch browsers; DetectInstalled via registry; FilterLegacyIE
β”‚   β”‚   └── icon_windows.go  # Extract & rasterize HICON β†’ base64 PNG (shell32/gdi32)
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ service.go    # Load / Get / Save / Invalidate settings; schema migration
β”‚   β”‚   └── types.go      # UserSettings, Browser, AlternateLaunch, Ruleset, Rule, AppSettings
β”‚   β”œβ”€β”€ ipc/
β”‚   β”‚   └── pipe.go       # Named-pipe single-instance IPC (go-winio, \\.\pipe\SwitchyPipe)
β”‚   β”œβ”€β”€ registry/
β”‚   β”‚   └── registry.go   # Register / Unregister Switchy as Windows default browser
β”‚   └── rules/
β”‚       └── matcher.go    # URL-to-browser rule engine (domain / regex / substring)
β”‚
β”œβ”€β”€ frontend/             # Vue 3 + TypeScript + Tailwind CSS
β”‚   β”œβ”€β”€ eslint.config.js  # ESLint 9 flat config (TS + Vue + Prettier-compat)
β”‚   β”œβ”€β”€ .prettierrc.json  # Prettier config (no-semi, single-quote, Tailwind class sort)
β”‚   β”œβ”€β”€ .prettierignore
β”‚   └── src/
β”‚       β”œβ”€β”€ App.vue           # Root router β€” renders SelectorView or SettingsView
β”‚       β”œβ”€β”€ types.ts          # Frontend type definitions (mirrors Go structs)
β”‚       β”œβ”€β”€ views/
β”‚       β”‚   β”œβ”€β”€ SelectorView.vue  # Browser picker (vertical list or horizontal dock)
β”‚       β”‚   └── SettingsView.vue  # Configuration hub (browsers, rulesets, app settings)
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ BrowserList.vue       # Vertical stacked browser list
β”‚       β”‚   β”œβ”€β”€ BrowserButton.vue     # Single row item with icon, name, shortcut
β”‚       β”‚   β”œβ”€β”€ BrowserDock.vue       # Horizontal dock layout
β”‚       β”‚   β”œβ”€β”€ BrowserDockTile.vue   # Single dock tile with large icon and keycap badge
β”‚       β”‚   β”œβ”€β”€ UrlCard.vue           # URL display with protocol icon and copy button
β”‚       β”‚   β”œβ”€β”€ BrowserEditor.vue     # Browser config row in settings
β”‚       β”‚   └── RulesetEditor.vue     # Ruleset config row in settings
β”‚       β”œβ”€β”€ composables/
β”‚       β”‚   └── useBrowserIcon.ts     # Async icon loader (calls GetBrowserIconAt backend)
β”‚       └── utils/
β”‚           β”œβ”€β”€ browser.ts    # Shortcut key helpers, animation delay calculations
β”‚           └── config.ts     # Layout / overflow value normalizers
β”‚
β”œβ”€β”€ build/                # Wails build assets
β”‚   β”œβ”€β”€ appicon.svg       # Source logo β€” regenerate appicon.png / icon.ico from this
β”‚   β”œβ”€β”€ appicon.png       # 1024Γ—1024 app icon (used by Wails build)
β”‚   └── windows/
β”‚       β”œβ”€β”€ icon.ico
β”‚       β”œβ”€β”€ info.json         # Product metadata (version, company, copyright)
β”‚       β”œβ”€β”€ wails.exe.manifest
β”‚       └── installer/
β”‚           β”œβ”€β”€ installer.iss   # Inno Setup 6 script β†’ Switchy_Installer.exe
β”‚           └── project.nsi     # NSIS script (wails build --nsis)
β”‚
└── scripts/
    └── build.ps1         # Full release build: Wails β†’ switchy.exe β†’ Inno Setup installer

Prerequisites

Tool Version Install
Go 1.25+ go.dev/dl
Wails CLI v2 go install github.com/wailsapp/wails/v2/cmd/wails@latest
Node.js 18+ nodejs.org
golangci-lint latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Inno Setup 6 jrsoftware.org (installer only)

Development

# From the switchy/ directory β€” hot-reload on both Go and Vue changes
wails dev

Go methods are also exposed as a dev server at http://localhost:34115 so you can call them from the browser DevTools.


Code Quality

Frontend

cd frontend

npm run lint          # report ESLint issues
npm run lint:fix      # auto-fix what's fixable
npm run format        # format all src files with Prettier
npm run format:check  # CI-safe Prettier check (no writes)

Go

# Format
gofmt -w .

# Vet
go vet ./...

# Full lint (requires golangci-lint)
golangci-lint run ./...

Building

Executable only

wails build -platform windows/amd64
# β†’ build/bin/switchy.exe

Full release (exe + Inno Setup installer)

.\scripts\build.ps1
# β†’ build/bin/Switchy_Installer.exe

Register as Default Browser

After building or installing, run once:

.\build\bin\switchy.exe --register

Windows will open Default apps settings β€” scroll to Web browser and select Switchy to complete the setup. ( Windows 10/11 requires this manual confirmation step; no app can bypass it.)

To remove Switchy from the registry:

.\build\bin\switchy.exe --unregister

URL Rule Patterns

Rules are evaluated in order across enabled rulesets. The first match wins.

Prefix Type Example Matches
d$ Domain d$example.com example.com and *.example.com
r$ Regex r$^https://work\. Full URL matched against regex
s$ Substring s$/confluence/ URL contains the string
(none) Substring github.com Same as s$

Set a rule's browser target to _Switchy to force the picker even when other rules would match.


CLI Flags

Flag Effect
(no flag, with URL argument) Open the browser picker for the given URL
--register Write Windows registry entries and open Default Apps settings
--unregister Remove Switchy registry entries
--settings Open the settings window

Inspiration

Switchy is lovingly inspired by Hurl β€” a fantastic open-source browser picker for Windows that proved the concept beautifully. Switchy builds on that idea with a Wails-powered UI, native-pipe IPC, URL rule matching, and alternate browser profiles. Huge respect to the Hurl team for laying the foundation.


Agent Context

This repository uses agent-context to generate and maintain its AI-agent context files (e.g., AGENTS.md). If you're working on Switchy with an AI assistant, those files provide the grounding architecture, conventions, and module map needed to navigate the codebase effectively.


License

MIT

About

πŸ”— Rule every link β€” snappy Windows browser picker with smart URL routing

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors