Repository navigation
Reflect default browser changes in bindings and webapps - #871
Conversation
|
I believe this would break webapps for users with firefox as their default browser |
|
I think you mean that if the default browser is Firefox, then webapps will break as Firefox isn't supported in Omarchy as a webapp launcher. I'll update my code so that webapps are only launched by Chromium or Google Chrome (depending on system defaults). If you have Firefox set as a default, it'll still fall back to Chromium for webapps (that's the way it is prior to this change). Will submit changes soon. |
|
@alexperreault I've made the necessary changes. WDYT? |
|
Whilst I'm no maintainer, I like your solution splitting browser and webapps! |
|
Some people user brave (chromium based) in place of choromium for both browser, and hence webapp. |
|
@sailoz Prior to this change, Omarchy had no special support for brave. Adding that support shouldn't be the responsibility of this change. Brave users will automatically benefit from default browser access through this change. It won't make a difference for the webapps. I have authored this change with extensibility in mind so you can extend omarchy-webapp and the get_args_for_browser function within omarchy-browser-utils to support additional browsers. |
|
I've also added a migration script. Until there's any further code review comments, this PR is complete. |
|
I like the idea of consistency and a simpler way to make this change but it does come with the inherent Firefox challenge you've already encountered. If we were to keep this, I'd suggest we rename to Secondarily, I think we need to simplify the approach dramatically. There's a ton of code here, parsing .desktop files, etc. to perform an action that's really pretty simple. It'd be better to take a much more direct approach that really boils it down to the launch exec and flags. |
|
@ryanrhughes thank you for the feedback. I agree with what you've said and have submitted a new commit that should address the concern. The code is much simpler but trades off flexibility for hardcoding assumptions (i.e. google-chrome.desktop -> google-chrome-stable). I think those assumptions are pretty sound though. All feedback welcome. |
|
Just a quick note: Microsoft Edge can also launch web applications using the same |
|
@BartoGabriel I'm sure there will be lots of other Chromium based browsers that this commit doesn't cover. I've built this PR to be extensible so folks can easily add their choices in as a separate PR. I've included the suggested browsers in these comments but won't add any more as that should be a separate PR. @ryanrhughes what else do you feel that this PR needs in order to be merged? |
|
I like the idea, but it's too much code. We should have |
|
@dhh, it would be great to have a simple installer similar to archinstall, where basic preferences can be selected before installation—like choosing the default browser, or for example being able to pick between Docker and Podman. Are you considering (or do you have any plans for) something like this? |
@dhh is this already been worked on somewhere? One concern I have with this solution is that its introducing a different way to set default browsers. Most of the browsers ask users if they'd like to set at default. The solution you're proposing won't be compatible with it. That's why I was using "xdg-settings" to get the default browser. |
… the browser .desktop files.
…ak webapps for browsers other than Chromium or Google Chrome.
…th launch terminology.
99680f0 to
ff1aaff
Compare
|
@dhh I simplified this quite a lot and I think it's in a good spot. @ankurkotwal is right that using xdg-settings is the right way to go on this one. That makes it compatible with the browsers themselves and how other apps interact. We don't really have any need to add anything to the Omarchy menu (though we could make it part of installing those browsers) because the xdg-settings works with the built in "Set as default" button inside of a browser. So if you launch Firefox, click Set as Default, everything will start launching in Firefox.
Webapps aren't supported in Firefox-based browsers so we just have a little logic to fallback to Chromium if you have anything that isn't set in the nice list. I also noticed that for apps, we were setting |
|
You're right. This is great. Just tested it with all the browsers. Only failure state will be if people install Firefox, then uninstall Chrome, then their webapps will break. But easy fix just to install that back again. |
|
Thanks @ryanrhughes and @dhh |
* Abstract default browser to omarchy-browser (a wrapper) * Fix the omarchy-browser command as it used to loop. Extract info from the browser .desktop files. * Clean up and fix bugs * Cleanup unused change * Fix indentation * Separate out omarchy-browser from omarchy-webapp so that we don't break webapps for browsers other than Chromium or Google Chrome. * Fix incorrect function call * Add a migration script * Migration script fixes * Simplify the browser and webapp commands. Rename commands to align with launch terminology. * Add support for Microsoft Edge, Opera and Vivaldi * Fix errors * Remove --name and --class -- They're not respected when --app is defined * We don't ship with Chrome * Simplify launchers * Use launch commands everywhere --------- Co-authored-by: Ryan Hughes <[email protected]>
* Abstract default browser to omarchy-browser (a wrapper) * Fix the omarchy-browser command as it used to loop. Extract info from the browser .desktop files. * Clean up and fix bugs * Cleanup unused change * Fix indentation * Separate out omarchy-browser from omarchy-webapp so that we don't break webapps for browsers other than Chromium or Google Chrome. * Fix incorrect function call * Add a migration script * Migration script fixes * Simplify the browser and webapp commands. Rename commands to align with launch terminology. * Add support for Microsoft Edge, Opera and Vivaldi * Fix errors * Remove --name and --class -- They're not respected when --app is defined * We don't ship with Chrome * Simplify launchers * Use launch commands everywhere --------- Co-authored-by: Ryan Hughes <[email protected]>
* Abstract default browser to omarchy-browser (a wrapper) * Fix the omarchy-browser command as it used to loop. Extract info from the browser .desktop files. * Clean up and fix bugs * Cleanup unused change * Fix indentation * Separate out omarchy-browser from omarchy-webapp so that we don't break webapps for browsers other than Chromium or Google Chrome. * Fix incorrect function call * Add a migration script * Migration script fixes * Simplify the browser and webapp commands. Rename commands to align with launch terminology. * Add support for Microsoft Edge, Opera and Vivaldi * Fix errors * Remove --name and --class -- They're not respected when --app is defined * We don't ship with Chrome * Simplify launchers * Use launch commands everywhere --------- Co-authored-by: Ryan Hughes <[email protected]>
I prefer using Google Chrome over Chromium but found that Chromium had been hard coded throughout Omarchy. This change introduces a omarchy-browser wrapper that respects the user's xdg-settings for default-web-browser. This extends to webapps as well.
The default installation still uses Chromium but if the user changes their default browser, the SUPER+B bind will use the new default as will all webapps.
Additionally, the new omarchy-browser wrapper script is extensible so if other browsers needed specific launch flags, they could easily be added in.