An HTTP(S) mime-type browser-chooser "system" for Linux desktops. Really, it's just 2 files and some instructions...
Scenario: I click on a link in an email, and it pops open a tab in whatever last FireFox window I had. BUT! I really need it to open in Chrome because that's where I do whatever with a Google account (which I never use my FireFox for...).
A Solution: Make my default web browser a dialog which allows me to pick my web application. I'm going to call that OpenURLwith.
Private/Guest: Check box -- Just open in a completely non-Profile window.
Profiles: Drop down -- It would be great to select which profile to open a website with -- I use profiles in both FireFox and Chrome.
Development done using Linux Mint MATE 22.3 and Debian 13 Mate. My guess/hope is that any mondernish freedesktop.org "compliant" Linux should work.
- BASH
- YAD -- See the yad-build-notes.md for how I installed it. Repository versions are quite old, but seem to work well enough for this purpose.
Put the OpenURLwith script someplace in your $PATH, and make executable. I leave mine in ~/bin:
cp OpenURLwith $HOME/bin; chmod 755 $HOME/bin/OpenURLwith
It will open blank windows if not given a URL:
Trouble shoot this if it doesn't work! Is OpenURLwith executable and in your $PATH? Is YAD installed correctly?
cp OpenURLwith.desktop $HOME/.local/share/applications
In a GUI file browser, navigate to that file, double click on it, and do whatever your desktop environment requires to "trust" it for launching.
This is often the hardest thing to get working right.
Possibly may need to register the file:
update-desktop-database ~/.local/share/applications
At this point, you should be able to see OpenURLwith in your Desktop's application menu, and hopefully as an option in a default/preferred application setting for your Desktop Environment.
If you need to force it as the default browser, this should work:
xdg-settings set default-web-browser OpenURLwith.desktop
The only real configuration involves editing the OpenURLwith script. Namely, adding/removing Launchers definitions and invocations.
The .desktop file has an Exec line -- the debugging flag might be set, and can be edited out.
Clicking on an html file, or running xdg-open URL should trigger the
script.
