Let any installed browser be the default, Flatpaks included - #10329
Open
28allday wants to merge 1 commit into
Open
Let any installed browser be the default, Flatpaks included#1032928allday wants to merge 1 commit into
28allday wants to merge 1 commit into
Conversation
Defaults > Browser was a fixed list of seven browsers, so a browser installed any other way had no route to becoming the default, and the browser launcher only found desktop entries under ~/.local, the Nix profile and /usr, taking the first word of Exec as the command. A Flatpak browser failed both: its entry lives under Flatpak's exported data dir, and its Exec is a whole `flatpak run ...` line. Add an Other row that lists every installed desktop entry handling web links, wherever it came from, and let omarchy-default-browser accept a desktop id directly. Resolve entries through the XDG data dirs with a shared helper that keeps the full Exec command minus its field codes, so the launcher and web apps run Flatpak browsers too, and focus a Flatpak window by its app id rather than by "flatpak".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setup > Defaults > Browser is a fixed list of seven browsers. A browser installed any other way (Flatpak, AUR, a hand-written desktop entry) shows up in the app launcher but has no route to becoming the default, and
omarchy default browseronly accepts the seven names.Flatpak browsers fail a second way:
omarchy-launch-browserandomarchy-launch-webapponly look for the desktop entry under~/.local, the Nix profile and/usr, and take the first word ofExecas the command. A Flatpak entry lives under Flatpak's exported data dir and itsExecis a wholeflatpak run --command=... app.id @@u %u @@line, so even after setting it withxdg-settingsby hand,Super + Shift + Returndoes nothing.Change
x-scheme-handler/https, wherever it came from, marks the current default, and hands the chosen desktop id toomarchy-default-browser. The row shows ✓ whenever the default is something outside the built-in seven.omarchy default browser <desktop-id>sets any existing entry as the default (nothing to install on its behalf, so an unknown id is refused rather than opening an installer). The seven named browsers behave exactly as before.omarchy-cmd-desktop-entryresolves an entry throughXDG_DATA_HOME/XDG_DATA_DIRS(plus the Nix profile and Flatpak export dirs) and returns itsExecwith field codes and Flatpak's@@u/@@markers stripped. The browser launcher and web-app launcher use it, so Flatpak browsers launch, get the right private-window flag, and are focused by app id rather than by "flatpak".org.chromium.Chromium,com.brave.Browser, ...) instead of falling back to native Chromium.Tests
default-browser-any-test.sh: entry resolution across data dirs (user dir wins, Flatpak export dir found), field-code stripping, setting a default by desktop id, refusing an unknown id, and the picker's listing (Flatpak entry present, shadowed entry listed once,NoDisplayand non-browser handlers skipped).launch-browser-test.shgains a Flatpak browser case: fullflatpak runcommand passed through, markers stripped, window focused by app id.menu-test.shexpects the new Other row.test/shellpasses apart from failures already present onquattrothat this change does not touch (bin-styleonomarchy-remove-ai-openclaw,bar-icon-geometry, and the three tests that need anomarchy-pkgssibling checkout).