Problem
When working with multiple Identity accounts. i.e Google, AWS, X(Twitter), It get confusing trying to manage the login, especially when logging in using SSO login with google, or when trying to manage production and dev accounts. We have firefox-containers from : <link>
Now I'm using buku for managing my bookmarks. And with each bookmark, I add a tag like : firefox-container-$PROFILE
.
$PROFILE - I assign a profile ID to different accounts, eg : personal
, work
, aws-prod
, aws-dev
, content
Idea is to assign the bookmarked links each to one profile.
So, for instance we want to open gmail.com
always in work container.
Solution
Using the xdg-mime
tool, a custom bash script and a .dekstop
file as Application entrypoint.
xdg-mime :
This will allow us to take control of URL handling call from OS.
xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types
xdg-mime default
: Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes.
custom-url-handler.desktop
To call our bash script with URL handling logic.
Bash script
To implement the actual URL handling control flow.