Can I create in dock two icons referring to two instances of the same application with different parameters? In this case I mean two Thunderbirds for two accounts? Ubuntu 24.04.01 Thank you
1 Answers
Sort of but I expect you are not going to like it. (Basically its a bit of a hack.)
WARNING: At your own risk. See warnings at end of this post.
Firstly I am assuming you are using an apt version like me and my description will be for that. I think it will work for snap but will use different directories: -
You first need to locate the Thunderbird desktop file in the following location:-
/usr/share/applications/thunderbird.desktop
Make a copy of it and put it in the local location, changing its name at the same time (append '2' to the name): -
sudo cp /usr/share/applications/thunderbird.desktop $HOME/.local/share/applications/thunderbird2.desktop
Copy a different version (lower resolution?) of the Icon you are using to a local place and change its name (append '2').
sudo cp /usr/share/icons/hicolor/22x22/apps/thunderbird.png $HOME/.local/share/icons/hicolor/22x22/apps/thunderbird2.png
(You might have to create the directories.)
Edit the file (I am using vi) : -
sudo vi $HOME/.local/share/applications/thunderbird2.desktop
Change (keep a commented out copy) the Exec line to the following: -
Exec=/bin/gnome-terminal -e "thunderbird -P [Name-Of-Profile]"
(You may be able to refine this without the gnome-terminal. For me it needs further thought.)
Change the Icon to the following: -
Icon=thunderbird2.png
Change the Name (add '2') to: -
Name=Thunderbird2 Mail
Finally add the following line (you might not need this): -
StartupWMClass=thunderbird2
Finally, you need to logout and login again to reset all the gnome extensions.
If you don't have thunderbird on the DASH then you (hopefully) will now find two icons showing in the ShowApps (bottom left) You can tell them apart because one is low resolution and one high resolution. The name is also different but you can't see that when it is in the DASH
LIMITATIONS What will not work, however, is which one is marked as running. It will always show the high resolution icon even if you started the other one. (If you just have the low resolution icon pinned it will add the high resolution one while it is running.) This is because of the way the Icon and the application are connected through the WM-class which I believe is built into the application exectutable. It may be possibly to override this in some way but I do not know how to do it.
WARNING Running the thunderbirds at the same time might be tricky. I suspect this is not even allowed. I was not prepared to try this in case it trashes the profiles.
- 937