Safari port of Theo's unduck - instant bang redirects for DuckDuckGo searches. No more waiting for DDG to load just to bounce you somewhere else.
Safari doesn't let you set custom search engines. With unduck, you can use ANY DuckDuckGo bang as your default search engine. Want Brave? Set default_bang = "!brave"
. Prefer Startpage? Use !sp
. YouTube? !yt
. You get the idea.
Plus bang redirects are virtually instant. No more watching DuckDuckGo load just to bounce you somewhere else.
Safari extensions have to wait for the page to start loading before they can act. With DNS interception, we redirect before Safari even connects to DuckDuckGo.
./install.sh
This will:
- Generate a self-signed certificate for duckduckgo.com
- Add it to your macOS Keychain as trusted
- Modify /etc/hosts to point duckduckgo.com to localhost
- Build and install the unduck binary
- Optionally set it up as a background service
Important: After installation, set DuckDuckGo as your default search engine in Safari preferences.
Edit ~/.config/unduck/config.toml
:
# Default search engine (any DDG bang!)
default_bang = "!g" # Change to !brave, !qwant, !ecosia, etc.
# Log verbosity: debug, info, warn, error
log_level = "info"
# Override or add custom bangs
[custom_bangs]
"!internal" = "https://internal.company.com/search?q={{{s}}}"
"!k" = "https://kagi.com/search?q={{{s}}}"
# Autocomplete mappings (for search engines with DDG-compatible APIs)
[autocomplete]
# Add your search engine's autocomplete endpoint here
If your chosen search engine uses the same autocomplete format as DuckDuckGo (returning [query, [suggestions]]
), you can enable autocomplete by adding it to the config.
Kagi for instance, utilizes the same response schema: "https://kagi.com/api/autosuggest?q={query}"
Keep DuckDuckGo as your Safari search engine. Now:
- Regular searches use your configured
default_bang
- Any DDG bang still works:
!gh react
,!gi corgis
,!yt programming
- Autocomplete works for compatible search engines
Supports all ~13k DuckDuckGo bangs!
If you didn't install the service:
unduck
./uninstall.sh
Removes the hosts entry, certificate, and service.
Update bang definitions:
go generate
This fetches the latest bangs from DuckDuckGo.