Skip to content

Let any installed browser be the default, Flatpaks included - #10329

Open
28allday wants to merge 1 commit into
omacom:quattrofrom
28allday:any-default-browser
Open

Let any installed browser be the default, Flatpaks included#10329
28allday wants to merge 1 commit into
omacom:quattrofrom
28allday:any-default-browser

Conversation

@28allday

@28allday 28allday commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 browser only accepts the seven names.

Flatpak browsers fail a second way: omarchy-launch-browser and omarchy-launch-webapp only look for the desktop entry under ~/.local, the Nix profile and /usr, and take the first word of Exec as the command. A Flatpak entry lives under Flatpak's exported data dir and its Exec is a whole flatpak run --command=... app.id @@u %u @@ line, so even after setting it with xdg-settings by hand, Super + Shift + Return does nothing.

Change

  • Other row at the bottom of Defaults > Browser. It opens a picker listing every installed desktop entry that handles x-scheme-handler/https, wherever it came from, marks the current default, and hands the chosen desktop id to omarchy-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.
  • New hidden helper omarchy-cmd-desktop-entry resolves an entry through XDG_DATA_HOME / XDG_DATA_DIRS (plus the Nix profile and Flatpak export dirs) and returns its Exec with 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".
  • Web apps recognise the Flatpak ids of the Chromium-family browsers (org.chromium.Chromium, com.brave.Browser, ...) instead of falling back to native Chromium.
  • Manual page for browsers updated.

Tests

  • New 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, NoDisplay and non-browser handlers skipped).
  • launch-browser-test.sh gains a Flatpak browser case: full flatpak run command passed through, markers stripped, window focused by app id.
  • menu-test.sh expects the new Other row.

test/shell passes apart from failures already present on quattro that this change does not touch (bin-style on omarchy-remove-ai-openclaw, bar-icon-geometry, and the three tests that need an omarchy-pkgs sibling checkout).

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".
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