The goal is to open a different profile for work-related URLs opened anywhere on the desktop.
- Copy default-browser.sh to $HOME/bin (or somewhere else in your PATH)
- Copy default-browser.desktop to $HOME/.local/share/applications
- Update $HOME/.config/mimeapps.list with proper values (or create file from scratch)
- Go to Settings > Default Applications and configure "Default Browser" for Web
To open a URL with the work profile, you just have to set the environment variable WORK=1
beforehand.
$ WORK=1 xdg-open https://google.com
You can add WORK=1
anywhere needed. For example, in a Flatpak's configuration so that Flatpak app always use the work profile. Use Flatseal to edit the environment variables.