Running a flatpak app with a different name and icon

Hi,

I use Firefox profiles to seperate personal/work in my browser.

I am wanting to create a .desktop so I can run firefox using my work profile, for ease of use I want to use a custom icon so I can differentiate between regular firefox (default profile) and firefox which uses my work profile.

So far I have been able to create a .desktop that does run firefox with the correct profile however when its running the name and icon stays as Firefox (it disregards the name and icon set in the .desktop file), is there any way to change this behaviour?

I am using Gnome and have looked for possible solutions. For example, I run the firefox work profile with --name firefox-work and have set StartupWMClass=firefox-work in the .desktop but this solved nothing. I used gnomes looking glass tool and can confirm that the wm_class is successfully set to firefox-work however I also see that the app property is set to the .desktop file of the flatpak instead of the .desktop file that started the instance. I don’t know if its possible to change this.

Any help would be appreciated.