Change the default browser in macOS (Catalina, Big Sur).
brew install jwbargsten/misc/defbro
List browsers
defbro
Change default browser
defbro org.mozilla.firefox
Toggle between Firefox and Chrome
defbro $(defbro | grep -v "^\*" | grep "org.mozilla.firefox\|com.google.Chrome" | cut -d " " -f3)
Which browser is currently not the the default
defbro --json | jq -r '.[] | select(.id | contains("firefox") or contains("Chrome")) | select(.isDefault | not) | .id'
I also wrote a small lab/tutorial for me (and possibly others), in case you want to start with Swift and homebrew.