Skip to content

Allow web apps to open in the default browser - #11044

Open
VideoPants wants to merge 1 commit into
omacom:quattrofrom
VideoPants:webapp-browser-choice
Open

Allow web apps to open in the default browser#11044
VideoPants wants to merge 1 commit into
omacom:quattrofrom
VideoPants:webapp-browser-choice

Conversation

@VideoPants

Copy link
Copy Markdown

Summary

Interactive web app installs can now choose how the launcher opens:

  • Chromium app window — existing behavior via omarchy-launch-webapp (standalone Chromium --app= window)
  • Default browser — opens with xdg-open so the site uses whatever browser the user set as default (Firefox, Helium, Chrome, etc.)

Both kinds of launcher stay on Omarchy’s Remove → Web App list (and related remove paths), because identity is no longer tied solely to Exec=omarchy-launch-webapp.

Why

Today every interactively created web app is forced through Chromium app mode. That is great for “app-like” sites, but it is a poor fit when someone wants:

  • their real default browser (cookies, extensions, profiles, password manager)
  • sites that behave better outside Chromium --app= mode
  • a normal browser tab/window instead of a stripped app window

People who hand-edit .desktop files to xdg-open hit a second problem: Omarchy only treated launchers as web apps when Exec= matched omarchy-launch-webapp / omarchy-webapp-handler. After switching to xdg-open, those apps disappeared from Remove → Web App even though they were still Omarchy-installed web apps. This change fixes that class of breakage and makes the default-browser option a first-class path.

How

  1. omarchy-webapp-install (interactive only)
    After name / URL / icon, asks via gum choose:

    • Chromium app windowExec=omarchy-launch-webapp "<url>"
    • Default browserExec=xdg-open "<url>"
      Non-interactive calls (omarchy-webapp-install name url icon [custom-exec] [mime-types]) are unchanged: still default to omarchy-launch-webapp, and still honor an explicit custom exec. Installer scripts that create web apps keep working with no argument changes.
  2. X-Omarchy-WebApp=true marker
    Every launcher written by omarchy-webapp-install now includes this desktop-entry key. Detection becomes:

    X-Omarchy-WebApp=true
    OR
    Exec=.*(omarchy-launch-webapp|omarchy-webapp-handler)
    

    so:

    • new Chromium and default-browser apps are both discoverable
    • older Chromium-only launchers without the marker still work
    • random xdg-open desktop files are not treated as Omarchy web apps unless marked
  3. Call sites updated to the same detection rule

    • bin/omarchy-webapp-remove
    • bin/omarchy-webapp-remove-all
    • bin/omarchy-remove-launcher-entry
    • default/omarchy/omarchy-menu.jsonc (remove.webapp when)
  4. Migration (migrations/1788959623.sh)
    On update, tags existing user launchers under ~/.local/share/applications/ that already look like Omarchy web apps:

    • Exec uses omarchy-launch-webapp / omarchy-webapp-handler, or
    • Exec is xdg-open with an http(s) URL

    so people who already switched some apps to the default browser get them back on the remove list without reinstalling.

  5. Tests
    Extended test/shell.d/webapp-install-test.sh and webapp-name-test.sh to cover:

    • marker written on normal installs
    • interactive default-browser → xdg-open + marker
    • remove discovering marker-only / default-browser launchers

Test plan

  • bash test/shell.d/webapp-install-test.sh
  • bash test/shell.d/webapp-name-test.sh
  • Manual: Install → Web App → choose Default browser → app launches via default browser and appears under Remove → Web App
  • Manual: Install → Web App → choose Chromium app window → still opens as Chromium --app= and remains removable
  • Manual: previously xdg-open-edited web apps reappear under Remove → Web App after marking / migration logic
  • Reviewer: run ./test/shell (or ./test/all) on a clean tree if desired

Made with Cursor

Interactive installs can choose Chromium app windows or xdg-open, and
X-Omarchy-WebApp keeps both kinds visible in Omarchy web app menus.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant