omarchy-launch-webapp silently demotes unrecognized default browsers to chromium.desktop — web apps open in the wrong profile
System details
Apple MacBookPro18,2 (M1 Max, aarch64), Omarchy 4.0.4-mac.1
(omarchy-debug needs an interactive sudo TTY — supplying details inline; the bug is in the script's logic, not environment-dependent.)
What's wrong?
When the XDG default browser is a .desktop file outside the hardcoded allowlist, omarchy-launch-webapp silently substitutes chromium.desktop and launches the web app in a different browser than the user's configured default — typically a different profile with no logins, cookies, or extensions. The app "opens", so the failure looks like the site is broken rather than the launcher.
Repro
- Make the default browser a custom launcher
.desktop, e.g.browseros.desktopwithExec=/home/user/.local/bin/browseros %U— a wrapper that execs/usr/lib/chromium/chromium --user-data-dir=~/.config/browser-os(a dedicated, signed-in profile). xdg-settings get default-web-browser→browseros.desktop(also set inmimeapps.list).- Launch any bundled web app, e.g.
X.desktop→omarchy-launch-webapp https://x.com/. - Result: the window opens on the stock chromium default profile (
~/.config/chromium) — X shows a login wall even though the configured browser is signed in.
Root cause
browser=$(xdg-settings get default-web-browser)
case $browser in
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*) browser="chromium.desktop" ;;
esac
exec setsid uwsm-app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' .../$browser ...) --app="$1"
browseros.desktop fails the case → is replaced wholesale by chromium.desktop. The configured browser's Exec= line is never even read, so a .desktop that wraps chromium with --user-data-dir/--profile-directory can never be honored.
Verified with bash -x /usr/share/omarchy/bin/omarchy-launch-webapp https://x.com/:
+ browser=chromium.desktop
+ exec setsid uwsm-app -- /usr/bin/chromium --app=https://x.com/
Opening in existing browser session. # <- default-profile singleton
The spawned window (chrome-x.com__-Default, owned by a chromium with no --user-data-dir) lands in a separate instance from the configured browser (--user-data-dir=~/.config/browser-os), confirmed via hyprctl clients + /proc/<pid>/cmdline.
Related but distinct
- #13527 — web apps ride whichever Chrome profile is active (no
--profile-directorypassed). Same symptom family, different seam: this issue is the launcher choosing a different browser executable/profile entirely. - #10988 — wrapper
Exec=lines (env VAR=... brave) are mis-parsed and fail silently with no window. Here the window opens — in the wrong browser. - #7034 — Firefox default unsupported.
Suggested direction
Any of:
- Parse the default
.desktop's ownExec=first; if the resolved binary is a Chromium-family browser, pass--appto it (honors wrappers, custom--user-data-dirflags, and fixes #10988's parsing gap too). Only fall back tochromium.desktopwhen the default truly isn't app-capable. - An opt-in override (
OMARCHY_WEBAPP_BROWSERenv or a config key) forcing which.desktophandles web apps — cheap and covers every custom browser. - At minimum, surface a notification when the configured default is demoted — a silent browser/profile swap is the core UX bug: nothing looks wrong except that every login is missing.
Open PRs touching exactly this path in omarchy-launch-webapp: #11044 ("Allow web apps to open in the default browser") stops forcing the allowlist, #12533 ("Resolve wrapped desktop Exec= in browser and webapp launchers") reads wrapper Exec= lines like your browseros one, and #9206 replaces the silent fallback with a clear warning. Any of them would keep a custom Chromium wrapper with its own --user-data-dir from being swapped for chromium.desktop.
I hit the same failure and ended up writing a user-local workaround for anyone blocked on this in the meantime: See here. It installs an override of omarchy-launch-webapp in ~/.local/bin that uses Firefox's experimental Taskbar Tabs (-taskbar-tab) when Firefox is the default browser, and delegates to the stock launcher otherwise. It doesn't touch /usr/share/omarchy and has an uninstall script.
Caveats: it needs browser.taskbarTabs.enabled in Firefox config (done by install script automatically) and Firefox opens a new window on each launch. Happy to share more detail if this is useful for whoever picks up the proper fix. Write-up: See here
Your diagnosis holds on quattro (47caa9be4), confirmed by reading the source; I did not reproduce it on a worker. omarchy-cmd-default-browser returns browseros.desktop correctly, but the case at bin/omarchy-launch-webapp:8-11 replaces any desktop entry not in its list with chromium.desktop, so your entry's Exec= line is never read. The launcher then hands --app= to the running stock Chromium through its default-profile socket (bin/omarchy-cmd-browser-handoff:16,40), which is the "Opening in existing browser session" you saw.
None of the open pull requests touching this launcher fix your case, despite the earlier comment here: #12533, #13241 and #15077 parse the whole Exec= line, but only after the allowlist has already swapped your entry out; #9206 and #13879 fall back to a known Chromium browser instead, which is still the wrong profile; #11044 only adds an install-time choice to open new web apps with xdg-open; #6078's --browser goes through the same allowlist, and the bundled launchers don't pass it; #14200 only guards an empty Exec. It is related to #7034, #10988 and #13527 but not a duplicate of any of them: those are a missing Chromium, a mis-parsed wrapper on an allowlisted browser, and profile drift inside the chosen browser.
I have not opened a fix. The launcher cannot tell that ~/.local/bin/browseros ends up running Chromium without reading or running the script, so honouring it means choosing a behaviour: trusting any default with --app, adding an override setting, or notifying when the default is replaced. That decision belongs to the maintainer, and this issue is waiting on them.
Reviewed by Claude Opus 5.5, with a second opinion from Codex Medium, which agreed on the mechanism and on every pull request it could read. Since it may have seen this review's reasoning, treat that as agreement rather than an independent check. It also pointed out the handoff to the default-profile socket described above.
Another reproduction worth having on record, because it argues for the opt-in override in suggestion 2 rather than a longer allowlist.
The marketplace plugin Browser Picker (K53N0/omarchy-browser-picker) is designed to hold the default browser slot: it registers browser-picker.desktop as the http handler, shows a profile picker for each link, and launches the chosen browser. With Google Chrome installed and all web apps previously opening in Chrome, setting the picker as default causes omarchy-cmd-default-browser to return browser-picker.desktop, the case at bin/omarchy-launch-webapp:8-11 demotes it to chromium.desktop, and every bundled web app silently moves to Chromium. With Chromium removed, web apps fail to launch.
Parsing the picker's Exec= would not help here, since it is a router rather than a browser. A config key or env var naming the .desktop entry to use for web apps would cover this and the custom wrapper case above. Seen on Omarchy 4.0.6-1 on x86_64.
Since the last review, #15591 by @stevederico proposes a fix for this, and @stbeck11 added a second case. I read #15591 against quattro (175e63b62); I did not run it here, since the pull request gets its own review and worker run.
For the original report it works: a non-allowlisted default is kept when the script its Exec= runs mentions a Chromium browser or --user-data-dir, which a browseros wrapper does. bin/omarchy-cmd-browser-handoff only hands off to the packaged /usr/bin browsers, so the wrapper itself runs with --app= and its own profile is used, provided it passes its arguments on with "$@".
It does not settle the Browser Picker case. The picker is kept only because its script happens to contain chrome://profile-picker. It is then started as browser-picker --app=<url>, and it reads --app= as a flag rather than a URL, so it gets no URL to route; what it opens then depends on the plugin's QML, which I could not check. A router script that does not mention a browser name would still be swapped for Chromium, and fail when Chromium is removed. Separately, everything after the first word of Exec= is still dropped, so an entry like Exec=chromium --user-data-dir=/custom %U would lose its profile and be handed to stock Chromium's running instance, the same bug written a different way.
The explicit setting @stbeck11 suggests, a config key naming the desktop entry to use for web apps, would cover both cases without guessing from a script's contents, but whether to add one is the maintainer's call. This issue waits on the maintainer, and #15591 will be reviewed on its own.
Reviewed by Claude Opus 5.5, with second opinions from Codex Medium and muse-wonder (via pi, thinking high). Both agreed #15591 fixes the original wrapper and that the picker is kept only because of that chrome:// string. Since they may have seen this review's reasoning, read that as agreement, not an independent check. Codex also pointed out that a wrapper which does not pass its arguments on would still lose --app=.