I'm thinking about making the switch to Linux because I really miss the classic feel of an OS built for PCs, rather than one designed for touch screens. Right now, I manage my Windows PC with separate user accounts for personal and work use. This setup allows me to open specific links in dedicated browsers for each user. My question is: can I do something similar in Linux without creating an entirely new user account? Specifically, can I have one desktop set with Firefox as the default browser and easily switch to another desktop where Chrome is the default? It's not essential, but it would definitely streamline my multitasking.
3 Answers
When you mention 'desktops,' are you referring to entirely different desktop environments like Gnome and KDE? While you can have multiple desktop environments installed and choose between them at your login screen, that won't let you set different default applications for the same user. A better approach might be to use browser profiles, which allow you to keep work and personal environments separate. You can easily switch between these profiles, which might help with what you're trying to achieve.
It's definitely possible to have different default configurations for different users, but if you want it to work for one user across various desktop environments, a bit of scripting will be necessary. You can write a bash script that checks the currently running desktop environment and launches different browsers accordingly. For example, in KDE, you can use a command to get the current desktop. Depending on the desktop environment you choose, the method to query the current state might differ.
You could write a bash script that selects which browser to open based on the current desktop environment. Then, you could create a .desktop file for your script, setting it up as the default browser with the necessary MimeTypes. This way, you'd have some control over which browser launches depending on the context.

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Fix Not Being Able To Add New Categories With Intuitive Category Checklist For Wordpress
Get Real User IP Without Installing Cloudflare Apache Module
How to Get Total Line Count In Visual Studio 2013 Without Addons
Install and Configure PhpMyAdmin on Centos 7
How To Setup PostfixAdmin With Dovecot and Postfix Virtual Mailbox