4

I have two different .desktop files for my two Firefox profiles. Both have different icons and are pinned separately to my dash, but when they run they both run under the default icon. How can I change this so they run separately?

Default profile file:

[Desktop Entry]all this seems to do is make them both launch Firefox with a default icon
Version=1.0
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox %u
Terminal=false
Type=Application
Actions=new-window;new-private-window;
Icon=firefox

[Desktop Action new-window]
Name=Open a New Window
Exec=firefox -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=firefox -private-window

School profile file:

[Desktop Entry]
Version=1.0
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote
Terminal=false
Type=Application
Actions=new-window;new-private-window;
Icon=/home/callum/Pictures/firefox-school.png

[Desktop Action new-window]
Name=Open a New Window
Exec=firefox -P school -no-remote -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=firefox -P school -no-remote -private-window

Here is an image of my two launchers of Firefox, I'm currently running the school profile, but it shows the default instance is open:

Image

I am running Kubuntu 19.10 with KDE Plasma 5.16.5

Thanks!

EDIT: Using classes I updated the desktop files to use classes as per @vanadium 's suggestion, but the second profile just launches another Firefox instance with the default icon. This is what I see when I open the Firefox school .desktop file with the FIrefox personal .desktop file open as well

Default profile file:

[Desktop Entry]
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox -P personal -no-remote --class personalProfile
Terminal=false
StartupNotify=true
Type=Application
Icon=firefox
StartupWMClass=personalProfile

School profile file:

[Desktop Entry]
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote --class schoolProfile
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/callum/Pictures/firefox-school.png
StartupWMClass=schoolProfile

EDIT 2: I fixed it! I updated the desktop files in ~/.local/share/applications rather than the ones in usr/share/applications

1 Answers1

4

I solved this by adding classes to the desktop files:

[Desktop Entry]
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote --class schoolProfile
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/callum/Pictures/firefox-school.png
StartupWMClass=schoolProfile
[Desktop Entry]
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox -P personal -no-remote --class personalProfile
Terminal=false
StartupNotify=true
Type=Application
Icon=firefox
StartupWMClass=personalProfile

and then moving the new desktop files to ~/.local/share/applications rather than just the ones in usr/share/applications

  • Nice. The '--class' flag was exactly what I was looking for. – LUser May 11 '20 at 08:57
  • Note for KDE Plasma users: after modifying a .desktop file manually, you need to "Edit application" via application launcher, do any change and click OK, only then the changes propagate to KWin and StartupWMClass starts having any effect. – blade Aug 22 '22 at 19:51