Skip to content

Keep the browser chosen on 3.x through the Quattro upgrade - #15074

Merged
ryanrhughes merged 2 commits into
quattrofrom
fix/issue-11632
Oct 27, 2026
Merged

ryanrhughes merged 2 commits into
quattrofrom
fix/issue-11632

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

The Quattro upgrade resets every user's default browser to Chromium. Near the end of the user transition, bin/omarchy-upgrade-to-quattro ran xdg-settings set default-web-browser chromium.desktop unconditionally. By then the retire step has already done the right thing with ~/.config/mimeapps.list: an untouched stock file is removed so /usr/share/applications/mimeapps.list applies, and a customized one is kept. On 3.x, omarchy default browser firefox rewrites the http, https and text/html handlers in that file, so its hash no longer matches the retire entry and it is kept, and then this line overwrote the choice it had just preserved.

Now Chromium is only set when xdg-settings get default-web-browser resolves to nothing. An untouched install still lands on Chromium through the package-owned mimeapps.list, and no longer has a user mimeapps.list re-created after the retire step removed it. A user file naming a browser that is no longer installed also still resolves to Chromium, because xdg-utils skips handlers whose desktop file is missing.

This addresses the browser half of #11632. The terminal half of that issue — xdg-terminals.list files written by omarchy default terminal ghostty or alacritty are byte-identical to the stock files 3.x shipped, so the retire step cannot tell a choice from an untouched default — is a decision about who gets moved to foot, and is left on the issue for the maintainer.

The user transition reset the default browser to Chromium unconditionally, after the retire step had deliberately kept a customized ~/.config/mimeapps.list. Fall back to Chromium only when no default browser resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining test-coverage concern is non-blocking.

Findings

  1. P2 Browser behavior stays untested ▶

Summary

The Quattro upgrade now sets Chromium only when xdg-settings returns no default browser.

  • The upgrade keeps the browser already chosen by the user.

Reviews (2) · Last reviewed commit: "Merge quattro: read the browser past the..." · Reviewed by Greptile

Comment thread test/shell.d/upgrade-to-quattro-test.sh Outdated
Comment on lines +138 to +140
grep -B1 -F 'env -u BROWSER xdg-settings set default-web-browser chromium.desktop' "$upgrade_to_quattro" |
grep -F '[[ -z $(env -u BROWSER xdg-settings get default-web-browser 2>/dev/null) ]]; then' >/dev/null ||
fail "Omarchy 4 upgrade keeps the default browser the user chose"

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.

P2 Browser behavior stays untested

The new test checks source text but never runs the browser fallback. It does not verify that an existing choice stays unchanged, that an empty lookup sets Chromium, or that removing BROWSER prevents it from affecting the lookup. A later change could break those behaviors without this test catching it.

Add tests that run this block with a mock xdg-settings and check which calls occur. Keep a separate fixture for the claimed missing-browser fallback.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the bug Something isn't working label Oct 17, 2026
Quattro now keeps omarchy-browser.desktop in hyprland-mimeapps.list and sets the browser with XDG_CURRENT_DESKTOP cleared, so the check that a browser already resolves has to clear it too, or under Hyprland it would always find omarchy-browser.desktop and the fallback could never fire.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reviewed and verified at b154425. This branch conflicted with quattro after #14441 changed the same line, so I merged quattro in. The merge clears XDG_CURRENT_DESKTOP on the new xdg-settings get as well as the set. Without that, under Hyprland the check would read ~/.config/hyprland-mimeapps.list and find omarchy-browser.desktop, which #14441 put there, instead of the browser itself.

Reproduced on a worker (Omarchy ISO) by running the upgrade's default-browser block against test home directories:

  • ~/.config/mimeapps.list naming Firefox, from a TTY and under Hyprland with the router list present: Chromium on quattro, Firefox at this head.
  • No user mimeapps.list: Chromium both ways. quattro recreates a user mimeapps.list, this head leaves none, so /usr/share/applications/mimeapps.list applies.
  • A user list naming a browser that is no longer installed: Chromium both ways, because xdg-mime skips a handler whose desktop file or binary is missing.

./test/cli passed on the worker, as did upgrade-to-quattro-test.sh, browser-link-handoff-test.sh and default-browser-lookup-test.sh under a real compositor session. CI is green.

Second opinion: Codex Medium reviewed the merged change and found no defects. It agreed the problem is real and the fix is proportionate. That is agreement with a conclusion already written down, so independence is not guaranteed. It also noted that the new test only checks the source text and does not run the block; that matches the rest of upgrade-to-quattro-test.sh, and the worker reproduction above covers the behaviour.

This fixes the browser half of #11632, so it does not close that issue. The terminal half is still open there for a maintainer decision. This pull request now waits on the maintainer.

@ryanrhughes ryanrhughes added this to the 4.5 milestone Oct 26, 2026
@ryanrhughes
ryanrhughes merged commit 4d9ea5a into quattro Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants