ppu is a rule-based link/URI router for Linux. Set it as your default
browser and it decides which actual browser (or app) opens each link,
based on rules you define — e.g. work links in one Chrome profile, personal
links in Firefox, and steam:// links in the Steam client itself.
ppuregisters itself as a.desktopapplication handlingx-scheme-handler/http,x-scheme-handler/https, and any other URI schemes you register (e.g.steam).- When something opens a link, the desktop environment invokes
ppu <url>. ppureads its rule list (~/.config/ppu/config.toml), checks each enabled rule top-to-bottom, and launches the command from the first matching rule.- If no rule matches, it falls back to the configured default action.
Each rule is a glob pattern matched against the full URL/URI, plus a command to launch:
[default]
name = "Default browser"
command = "firefox"
args = ["%u"]
[[rules]]
name = "Steam links -> Steam app"
pattern = "steam://*"
command = "steam"
args = ["%u"]
enabled = true
[[rules]]
name = "YouTube -> Chrome"
pattern = "*youtube.com*"
command = "google-chrome-stable"
args = ["--profile-directory=Work", "%u"]
enabled = truepatternsupports*,?, and[...]glob wildcards.%uinargsis replaced with the URL; if omitted, the URL is appended as the last argument.- Rules are evaluated in order — reorder them in the TUI to control priority.
- Non-browser apps work the same way: point a rule's
commandat any executable (steam,discord,spotify, ...) and register its URI scheme withppu register-scheme <scheme>.
ppu # opens the rule-editor TUI (same as `ppu edit`)
ppu edit # opens the rule-editor TUI (alias: `ppu gui`)
ppu <url> # dispatches a URL per the rules (used by the desktop file)
ppu register-scheme steam # routes steam:// links through ppu's rules too
ppu export rules.toml # exports the current rule set
ppu import rules.toml # appends rules from a file to the current rule set
ppu import rules.toml -f # replaces the current config entirely (--force)An imported file can be a full config (what ppu export writes) or just a
list of [[rules]] with no [default] section. --force replaces the whole
config, so it needs the full form.
The TUI (ppu edit) lets you add/edit/reorder/delete rules, edit the
default fallback action, import/export the rule file, and register
additional URI schemes — all without hand-editing TOML. Press / to search
rules by name, pattern, command, or args, then n/N to step through the
matches; the full key list is along the bottom of the screen.
./install.shuninstall.sh reverses it (--purge also deletes your saved rules).
makepkg -si~/.config/ppu/config.toml. A starter config is written there
automatically the first time ppu runs.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.