-
-
Save skatkov/221b4f302779385494d9dfb9e9eb6aac to your computer and use it in GitHub Desktop.
Open browser based off of certain rules (like choosy for macOS)
This file contains hidden or 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
| #!/bin/bash | |
| URL=$1 | |
| DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}') | |
| # Read the list of domains from the file | |
| DOMAIN_LIST=$(cat /home/sk/.config/url-list.txt) | |
| # Check if the domain is in the list | |
| if echo "$DOMAIN_LIST" | grep -q "$DOMAIN"; then | |
| firefox-aurora "$URL" & disown | |
| elif [[ "$DOMAIN" == "flex-redash.indeed.tech" ]]; then | |
| chromium-browser "$URL" & disown | |
| else | |
| firefox "$URL" & disown | |
| fi |
This file contains hidden or 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
| [Desktop Entry] | |
| Name=Choosy | |
| GenericName=Browser Chooser | |
| Comment=Choose what browser to use for specific links | |
| Categories=Network; WebBrowser; | |
| Exec=choosy %u | |
| Type=Application | |
| MimeType=x-scheme-handler/unknown;x-scheme-handler/about;text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https; |
This file contains hidden or 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
| code.corp.indeed.com | |
| app.slack.com | |
| www.notion.so/syftapp | |
| id.indeedflex.com | |
| id.indeed.tech | |
| portal-demo.indeedflex.co.uk | |
| indeed.atlassian.net | |
| indeedflex.zoom.us | |
| lucid.app | |
| app.sli.do | |
| syftapp.atlassian.net | |
| indeed.zoom.us | |
| flex-status-page.indeed.tech | |
| app.datadoghq.com | |
| flex-core-uk.indeed.com | |
| flex-core-us.indeed.com | |
| flex-core-uk.qa.indeed.net | |
| flex-core-us.qa.indeed.net | |
| flex-growthbook.indeed.tech | |
| flex-portal-uk.sandbox.qa.indeed.net | |
| flex-portal-us.sandbox.qa.indeed.net | |
| indeed.sourcegraph.com |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Under Gnome setting default browser has a slightly different workflow.
Run the following:
update-desktop-database ~/.local/share/applications # or the system pathGo to
Settings -> Apps -> Default Apps -> Webto setChoosyas a web browser.