Skip to content

Add an omarchy:// link handler for installing plugins from a web page - #7622

Open
hegjon wants to merge 2 commits into
omacom:quattrofrom
hegjon:url-handler
Open

hegjon wants to merge 2 commits into
omacom:quattrofrom
hegjon:url-handler

Conversation

@hegjon

@hegjon hegjon commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

A plugin's web page (or a directory like omarchyplugins.com) can now offer an Install in Omarchy link:

<a href="omarchy://plugin/add?url=https%3A%2F%2Fgithub.com%2Facme%2Fomarchy-weather.git&enable=1">Install in Omarchy</a>

Clicking it opens the floating presentation terminal running omarchy plugin add <url> [--enable] — the same flow as Setup > Plugins > Add Plugin, so the trust warning and confirmation still stand between the click and the clone. The link only pre-fills the command; nothing is installed silently and --yes is never passed.

How it's wired

  • bin/omarchy-url-handler (hidden, omarchy cmd url-handler) parses the link and execs omarchy-launch-floating-terminal-with-presentation.
  • applications/omarchy-url-handler.desktop is a NoDisplay entry with MimeType=x-scheme-handler/omarchy;, shipped like HEY.desktop.
  • default/applications/mimeapps.list gets x-scheme-handler/omarchy=omarchy-url-handler.desktop, the same mechanism that routes mailto: to HEY, so it works system-wide without per-user xdg-mime calls.
  • A migration copies the desktop entry into existing users' ~/.local/share/applications/; new users get it from /etc/skel and omarchy-refresh-applications.
  • manual/32-shell-plugins.md shows plugin authors how to build the link in the "Sharing yours with the world" section.

Safety

Links come from untrusted pages, so the handler only accepts https:// repository URLs. ssh://, file://, ext:: transports, local paths, option-looking strings (--upload-pack=…), URLs with whitespace, unknown actions, and missing parameters are all rejected with a desktop notification saying why. The URL path is namespaced (plugin/add), leaving room for other actions later without changing the scheme.

Testing

  • test/shell.d/url-handler-test.sh covers the accepted forms (encoded/unencoded URL, enable=1, plugin/install alias, omarchy: without slashes) and every rejection above, using the suite's mock-bin pattern.
  • ./test/cli passes; ./test/shell passes apart from the three omarchy-pkgs coverage checks, which need a sibling omarchy-pkgs checkout and fail the same way on quattro here.
  • Migration run against a scratch $HOME installs the entry and is idempotent; desktop-file-validate passes.
  • Verified end to end on a running Omarchy install: xdg-open 'omarchy://plugin/add?url=…&enable=1' from the browser opens the presentation terminal at the "Clone and add this plugin?" prompt with the decoded URL shown.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BHgeZuuzTBV7kEeEXJrtTE

A plugin's web page can now offer an "Install in Omarchy" link:

  omarchy://plugin/add?url=https%3A%2F%2Fgithub.com%2Facme%2Fomarchy-weather.git&enable=1

omarchy-url-handler is registered as the x-scheme-handler for omarchy://
through the shipped mimeapps.list and a NoDisplay desktop entry, the same
way mailto links reach HEY. It turns the link into `omarchy plugin add` in
the floating presentation terminal, so the trust warning and confirmation
still stand between the click and the clone.

Links come from untrusted pages, so only https:// repo URLs are accepted;
ssh, file, ext:: transports, local paths and option-looking strings are
rejected with a notification. A migration copies the desktop entry into
existing users' launchers, and the manual's plugin sharing section shows
how to build the link.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BHgeZuuzTBV7kEeEXJrtTE
Copilot AI balanced review requested due to automatic review settings August 20, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a system-wide omarchy:// handler for interactively installing shell plugins from web links.

Changes:

  • Adds URL parsing, validation, desktop registration, and migration support.
  • Documents install links for plugin authors.
  • Adds handler acceptance and rejection tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bin/omarchy-url-handler Parses links and launches plugin installation.
applications/omarchy-url-handler.desktop Registers the desktop handler.
default/applications/mimeapps.list Associates the omarchy scheme.
migrations/1787219051.sh Installs the handler for existing users.
manual/32-shell-plugins.md Documents web installation links.
test/shell.d/url-handler-test.sh Tests accepted and rejected links.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Exercise the handler on an installed system the way a browser hands a link
off: the desktop entry must be seeded for the user, x-scheme-handler/omarchy
must resolve to it, and xdg-open on a plugin link must land in the floating
terminal showing the plugin trust prompt without cloning anything first. A
link with a non-https repo URL must be rejected without opening a terminal.

Verified against an ISO built from this branch with omarchy-iso-test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017YPMCSH93n7NuZguVYdDo8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants