Last active
June 12, 2023 09:37
-
-
Save scriptcoded/a31ce7481c7d586bad7cd022545345a8 to your computer and use it in GitHub Desktop.
Link handler to automatically choose the correct browser based on the link. Set as your default link handler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
shopt -s nocasematch | |
# Links to use special browser for | |
if [[ "$1" =~ "github.com/my-org" ]] || | |
[[ "$1" =~ "my-org.atlassian.net" ]] || | |
[[ "$1" =~ "auth.atlassian.com" ]] || | |
[[ "$1" =~ "my-org" ]] || | |
[[ "$1" =~ "https://localhost:4321" ]]; then | |
# Special browser | |
gtk-launch firefox-my-org.desktop $1 | |
else | |
# Default browser | |
gtk-launch firefox-personal.desktop $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment