A way to have a different Firefox icons per profile on the xfce-panel and in XFCE window-buttons plugin and Alt-Tab list

I use a separate Firefox profile for my work-related tasks since it needs a separate set of addons. I want the work profile to stand out and be different at the first glance from the normal profile at the task bar (XFCE panel “Window buttons”).

So I’m trying to assign a different icon to that Firefox profile. I have created a desktop file that launches that profile and set its “Icon” property to my custom icon.

However, this changes the icon only for the desktop file itself: the icon displayed in Whisker menu (and I suppose the icon displayed if I put this file on my desktop), but the icon displayed on the window button on XFCE panel and when I press Alt-Tab is still the default Firefox icon.

Does anyone know a way to display a custom icon in these places?

Pretty sure it cannot be done.
Maybe if you use a dock plugin, i am not sure. But if the standart window buttons pluging does not read the desktop files, there is not much you can do.

A pity :slightly_frowning_face: Well, I guess, I have to do without it then

Oh, wait! I found a way to do it in X session at least! It is a way that is (I suppose) DE-independent, and in XFCE it works.

  • Install xseticon from AUR
  • Find the WINDOWID of the app for which you want to change its icon “globally” (xdotool search --name "<windowname>")
  • xseticon -id "$WINDOWID" path/to/icon.png

I was half-expecting it to affect only the icon that is displayed in the top-left corner of the app window, but it seems to affect everything: the window buttons on XFCE panel, the list through which you switch apps via Alt-Tab, the Window Menu panel item.

If anyone is reading it and is interested in trying it out, would you be so kind as to post here your results — did it work for you too?

Mod edit: Consecutive posts merged.

3 Likes

I’m late to the show, sorry for that.

There is a way to do it, using a custom launcher, not directly with Firefox though. Create a custom launcher, somewhere in any of your panels, with as many commands as you have profiles, each with a different icon. The default will be Firefox’s, of course but you can at least change which icon you’ll see attached with each of the custom command. That custom command would select which profile you want to launch Firefox with, of course.

Caveat: the application icon you’ll see in the task manager will be Firefox’s default. But since you’ve found a way to dynamically set the process’ icon, then you can combine that with the above trick(s).

Hope this helps.

1 Like

Which was the actual question. I guess it is time for a topic title change since it is misleading (just did it).

That said, had the OP tried to make 2 different .desktop files and to specify different icons there? Just an idea.

And another thing to think about: xfce will also be going wayland in an year or two so the X methods won’t work then.

1 Like

had the OP tried to make 2 different .desktop files and to specify different icons there?

Yes, the first thing I have tried :slight_smile:

1 Like

I don’t think this is possible. It might hardcoded into the application which actual icon it has.

@Kzer-Za

The following should work for you; however, a small disclaimer that this is mostly from memory. :wink:

Well, if I’m understanding your request, you wish to have two Firefox profiles, and load each of them with it’s own .desktop file – yes, this is possible.

Each .desktop file should have a different filename – a different icon is optional – and each should point to a different Firefox profile.

1. Create your two Firefox profiles – for the sake of convenience, let’s call them profile1 and profile2 – but, they can be anything you choose.

To learn how to create Firefox profiles, please see:

The Mozilla article is a little dated, but still indicates what is needed. Note that the location in which Firefox profiles are stored has recently changed and could be in either of two locations …

Profile Location(s):

  • (Old) ~/.mozilla/firefox
  • (New) ~/.config/mozilla/firefox

I suggest leaving the default Firefox profile alone, and creating two others.

2. Create two custom .desktop files – you can start by copying the /usr/share/applications/firefox.desktop to your Desktop folder – rename each of them as shown below.

Again, these are examples, but there is very little to change; open each in turn with your favourite text editor, and make the following changes:

  1. firefox-profile1.desktop:
Exec=/usr/lib/firefox/firefox -P profile1 %u
Icon=firefox
Name=Firefox (Profile1)
  1. firefox-profile2.desktop:
Exec=/usr/lib/firefox/firefox -P profile2 %u
Icon=firefox
Name=Firefox (Profile2)

Icons: Unless one is particularly obsessed with icons, the naming of each .desktop should be enough to differentiate between the two, otherwise, include the path to a custom icon after Icon=.

Example:

  • ~/.local/share/icons/myfirefox1.png
  • ~/.local/share/icons/myfirefox2.png

You might find Firefox icons to your liking here:

Note: The reason for creating two separately .desktop files (with different filenames) is to allow each of them to be automatically discovered and listed in the Application Menu.

Both .desktop files can be placed in either of:

  • /usr/share/applications/
  • ~/.local/share/applications/
  • Remember to make them executable.

I hope this was helpful.

Regards.

2 Likes

For the panel, it’s easy:

  1. Right-click the panel, select Add new items
  2. Select Launcher
  3. From the Launcher properties, click the “+” sign
  4. Add the program you want, then edit the launcher again
  5. Select the added launcher, then Edit the currently selected item
  6. Change the icon, then save
1 Like

Except he doesn’t want it in the panel but in the alt-tab list and in window-buttons.

Still, the idea of different names might be a valuable workaround. One should be able to differentiate between the two.

1 Like

The default Firefox launcher can be copied to home folder to have 2 similar launchers
in Whisker menu

cp /usr/share/applications/firefox.desktop ~/.local/share/applications/firefox.desktop

The local launcher can then be modified with MenuLibre Menu Editor, and launchers can then be dragged to desktop or panel

1 Like

I used to script each workspace to load a specific list of applications, forcing the icon I wanted with xseticonAUR. It’s an old program, but it still works.

1 Like