-
-
Save cesarolea/49c55749b48464322ef9475aa4e65a4a to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| URL=$1 | |
| DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}') | |
| ## Domain starts with | |
| if [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-start.txt)\)$) ]]; then | |
| chromium-browser "$URL" & disown | |
| elif [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-is.txt)\)$) ]]; then | |
| firefox "$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; | |
| 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; |
| https://www.mozilla.org |
| drive.google.com | |
| docs.google.com | |
| meet.google.com | |
| app.gotomeeting.com | |
| hangouts.google.com |
I don't think wayland would interfere, but have no way of testing it myself. Verify that your choosy.desktop is located either in ~/.local/share/applications/ or /usr/share/applications/ (try the other location if the first doesn't work) and make sure permissions are right. Supposedly .desktop files don't require execute permissions but according to https://askubuntu.com/questions/419610/permission-of-a-desktop-file it is sometimes required for it to work properly. Finally I would try rebooting if simply logging out doesn't pick up the new browser option.
I made sure to follow the instructions but no entry would show up in the default apps menu of Gnome. What worked for me was to execute xdg-mime default choosy.desktop x-scheme-handler/http && xdg-mime default choosy.desktop x-scheme-handler/https in the terminal to set it manually.
I made sure to follow the instructions but no entry would show up in the default apps menu of Gnome. What worked for me was to execute
xdg-mime default choosy.desktop x-scheme-handler/http && xdg-mime default choosy.desktop x-scheme-handler/httpsin the terminal to set it manually.
Glad you could make it work. Thanks for sharing!
Hi this is not working for me on Ubuntu 22.04, when I logout from my account and log back in there is no additional entry in gnome settings. I am using wayland, could this be the issue?