-
-
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-developer-edition "$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; | |
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 | |
indeed.atlassian.net |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My forked version of choosy script adjusted to my needs and slightly simplified.
Installation
Copy choosy to system path and make it executable
Copy
choosy.desktop
to~/.local/share/applications/
Move
url-list.txt
file to~/.config
folderGo to System Setting -> Default Application -> Pick "Choosy" as a default web browser.