Skip to content

ivan-khludov/kde-split-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

kde-split-browser (Split Browser)

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).

What it does

  • Installs a small wrapper (url-handler.sh) and a .desktop entry under your user profile.
  • Registers that entry as the handler for http and https via xdg-mime (and xdg-settings when 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.sh again 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).

Requirements

  • Linux with a typical XDG environment (xdg-mime, ideally xdg-settings).
  • bash, coreutils, date.
  • Two browser commands available on your PATH (e.g. firefox, brave-browser) — terminal names, not .desktop IDs.

Install

Clone or download this repository, then run:

bash run.sh

You will be prompted for:

  1. URL markers — substrings; if the opened URL contains any of them, the first browser is used.
  2. First browser command — for matching URLs.
  3. 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.

KDE

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.

Uninstall

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/applications

Then set your preferred default browser in the desktop environment or with xdg-mime / xdg-settings as usual.

Verify

After install:

xdg-mime query default x-scheme-handler/https

You should see split-browser.desktop.

License

MIT — see LICENSE.

About

Split default browser by URL markers (e.g. TLDs): route links to different browsers on Linux via XDG MIME

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages