Split your default web browser on Linux by URL markers (substrings such as TLDs). Links whose URL contains any configured marker open in one browser; everything else opens in another. Uses the standard XDG MIME handler mechanism and works well on KDE / Kubuntu (with a note below for KDE’s own default-app layer).
- Installs a small wrapper (
url-handler.sh) and a.desktopentry under your user profile. - Registers that entry as the handler for
httpandhttpsviaxdg-mime(andxdg-settingswhen available). - If split-browser is already installed, a second run only asks whether to remove it; an uninstall line is printed in the terminal. After uninstall, run
bash run.shagain to go through a fresh install (markers and browsers).
Default suggested markers include Russian-zone TLDs (.ru, .su, .рф, punycode xn--p1ai); you can change them to any substrings (comma- or space-separated).
- Linux with a typical XDG environment (
xdg-mime, ideallyxdg-settings). bash,coreutils,date.- Two browser commands available on your
PATH(e.g.firefox,brave-browser) — terminal names, not.desktopIDs.
Clone or download this repository, then run:
bash run.shYou will be prompted for:
- URL markers — substrings; if the opened URL contains any of them, the first browser is used.
- First browser command — for matching URLs.
- Second browser command — for all other URLs.
Files are placed under:
| Path | Purpose |
|---|---|
~/.local/bin/url-handler.sh |
Wrapper that picks the browser |
~/.local/share/applications/split-browser.desktop |
MIME handler entry |
The shared log helper prints timestamped lines to stderr (from run.sh and from url-handler.sh). You see them when you run the script or the handler in a terminal; GUI launches usually discard stderr.
The .desktop file sets NotShowIn=KDE so the “Split Browser” handler does not clutter the KDE launcher, but MIME registration still applies. If the system still opens links in another browser, set System Settings → Applications → Default Applications → Web Browser to Split Browser.
Run bash run.sh again. You will be asked to confirm removal of the existing install; an uninstall line is printed in the terminal. Alternatively, remove the handler and desktop file manually and run:
update-desktop-database ~/.local/share/applicationsThen set your preferred default browser in the desktop environment or with xdg-mime / xdg-settings as usual.
After install:
xdg-mime query default x-scheme-handler/httpsYou should see split-browser.desktop.
MIT — see LICENSE.