Skip to content

Instantly share code, notes, and snippets.

@skatkov
Forked from cesarolea/choosy
Last active June 7, 2025 21:47
Show Gist options
  • Select an option

  • Save skatkov/221b4f302779385494d9dfb9e9eb6aac to your computer and use it in GitHub Desktop.

Select an option

Save skatkov/221b4f302779385494d9dfb9e9eb6aac to your computer and use it in GitHub Desktop.
Open browser based off of certain rules (like choosy for macOS)
#!/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
[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;
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
@skatkov
Copy link
Author

skatkov commented May 20, 2025

Under Gnome setting default browser has a slightly different workflow.

Run the following:
update-desktop-database ~/.local/share/applications # or the system path

Go to Settings -> Apps -> Default Apps -> Web to set Choosy as a web browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment