Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-07-26 14:56:38

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

How to give each Firefox-Profile a unique icon

I have seen these posts and spent too much time trying to understand what to do, to no avail.
https://forum.xfce.org/viewtopic.php?pid=72119#p72119
https://forums.linuxmint.com/viewtopic.php?t=382925
https://askubuntu.com/questions/1000818 … buntu-dock


this is where i'm at:

===
[Desktop Entry]
Name=MyFireFox
Exec=firefox -p Default -no-remote --app-id firefox.Default --class firefox.Default
Terminal=false
Type=Application
StartupNotify=true
Icon=accessories-calculator
StartupWMClass=firefox.Default

===

would someone kindly hit me with a clue-stick and share a minimum viable example of a .desktop file that can give ffox(current) on xfce(current) on debian(current) a different icon for each profile. also the other browsers???

also... desktop-actions; they are not supported in xfce, right? and if, how?

tyvvm!

Last edited by ConfusedUser7893 (2023-07-26 14:57:26)

Offline

#2 2023-07-26 17:36:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to give each Firefox-Profile a unique icon

Hello and welcome.

ConfusedUser7893 wrote:

would someone kindly hit me with a clue-stick and share a minimum viable example of a .desktop file that can give ffox(current) on xfce(current) on debian(current) a different icon for each profile. also the other browsers???

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser - ToZ Profile
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=/usr/lib/firefox/firefox --class 0ad --name 0ad -P Toz %u
Icon=0ad
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
Categories=Network;WebBrowser;
StartupWMClass=0ad

A couple of secrets and one issue:

  • add "--name and --class to the firefox line

  • change "StartupWMClass"

The issue is that this doesn't work on the window buttons plugin, but does work with xfce4-docklike-plugin. Will test later on a git built of xfce4-panel to see if it recognizes the different icon.

also... desktop-actions; they are not supported in xfce, right? and if, how?

Yes they are, but I only think you can see them in the Whiskermenu when you right-click on the item. I don't believe they are processed anywhere else.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2023-07-27 09:50:53

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

Re: How to give each Firefox-Profile a unique icon

re-ordered the lines, changed app-id to name.
it looks fine on the desktop but does not give the app the icon.

.. does this minimal example work for you?

===
[Desktop Entry]
Version=1.0
Name=MyFireFox
Terminal=false
Type=Application
StartupNotify=true
Exec=firefox --new-instance --class ffoxx --name ffoxx -P Default %u
StartupWMClass=ffoxx
Icon=accessories-calculator
===

Offline

#4 2023-07-27 13:19:56

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to give each Firefox-Profile a unique icon

ConfusedUser7893 wrote:

but does not give the app the icon.

Where are you expecting that this icon will appear? On the Windows buttons (tasklist) panel plugin? If so, that doesn't work for me - the different icon only shows up using the docklike plugin.

.. does this minimal example work for you?

Yes. But I had to add "Categories=Network;WebBrowser;" to have it display in the menu. Again, the different icon only appears in the docklike plugin.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2023-07-27 14:27:33

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

Re: How to give each Firefox-Profile a unique icon

" the different icon only appears in the docklike plugin."

When i open xfce "Panel Preferences", i find "Window Buttons" under "Items."
and I'm looking to have the Icons that show up in those buttons and those in the Firefox frames themselves change. that doesn't happen yet. have never seem it happen yet. wish it would. thanks for trying!

Last edited by ConfusedUser7893 (2023-07-27 14:29:03)

Offline

#6 2023-07-27 14:50:12

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

ConfusedUser7893 wrote:

" the different icon only appears in the docklike plugin."

When i open xfce "Panel Preferences", i find "Window Buttons" under "Items."
and I'm looking to have the Icons that show up in those buttons and those in the Firefox frames themselves change. that doesn't happen yet. have never seem it happen yet. wish it would. thanks for trying!

Greetings!

For some reason, the "webapps-manager" (an older app adopted by Linux Mint) does just what you are looking for: a "launched" URL that has its own (fav-)icon which, once launched, shows up in XFCE's "Window Buttons" among the open/running apps. Without looking over its source code, I can't figure out how the webapps' internal URL-launch buttons work -- in order to place it on XFCE's panel or desktop -- but it does a slick job in creating browser- and site-specific profiles under ~/.local/share/ice. It helps some of my senior users to just browse the few sites they want to visit without having to deal with tab bars, tool bars, or other/unneeded browser features.

Cheers, m4a

PS: the webapps-manager has a feature that retrieves a site's favicon via the site's URL, and places those icons in ~/.local/share/ice/icons (I presume to use across multiple browsers), imho a very handy function.


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

#7 2023-07-27 16:09:09

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

Re: How to give each Firefox-Profile a unique icon

Greeting!   https://fosspost.org/how-to-install-webapps-on-linux/  .. looks great. figures it was the laucher, but i'd never thought of yours. ty!

Offline

#8 2023-07-27 20:59:41

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

ConfusedUser7893 wrote:

Greeting!   https://fosspost.org/how-to-install-webapps-on-linux/  .. looks great. figures it was the laucher, but i'd never thought of yours. ty!

You are welcome!

After looking into this more, I found that the webapps-manager creates for each webapp a custom .desktop file in the ~/.local/share/applications folder. When I looked up one of my webapps' .desktop file locate there, I was able to glean the specifics of the Exec= parm that launches the app. With a little tweak (replacing the "sh" with "bash") I was able to create a webapps' launch-button command parm ON THE PANEL, and by pointing the button's icon to the previously-gleaned icon it looked good as well. And the panel's window-buttons show the proper icon, too. Here's a copy of what I used (replace "xxxxx" with your user-name)

bash -c 'XAPP_FORCE_GTKWINDOW_ICON="/home/xxxxx/.local/share/ice/icons/TheReg.png"  firefox --class WebApp-TheReg5139 --profile /home/xxxxx/.local/share/ice/firefox/TheReg5139 --no-remote --private-window "https://www.theregister.com/"'

to access TheRegister.com from the panel.

Even though it is a multi-step setup process (ie the profile of each webapp must be created and then managed by the webapps-manager app), imo it is worth the simplicity (point n click) for the end-user to access their 4-5 usual websites without messing with/up bookmarks, tabs and such, or having to use the webapps-manager itself to launch any of those select websites...

Cheers, m4a


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

#9 2023-07-28 01:11:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to give each Firefox-Profile a unique icon

@ConfusedUser7893, I think you clicked on "Report" instead of "Quote" for your last reply. Here it is:

installed the webapp-manager
discovered that i needed debutils

needed to
pip install setproctitle
pip install tldextract
sudo apt install debhelper

to run ./test ... and ..

./test
user@host:~/Downloads/webapp-manager$ Running /home/user/.local/share/applications/webapp-ffoxdefault1613.desktop
Executing sh -c 'XAPP_FORCE_GTKWINDOW_ICON="webapp-manager" firefox --class WebApp-ffoxdefault1613 --profile /home/user/.local/share/ice/firefox/ffoxdefault1613 --no-remote -P Default %u"http://localhost"'

unfortunately, no go. the launcher works fine,
the icon works but does not stick/does not carry to the frame or dock.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2023-07-28 14:57:58

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

Your experience was just like my initial one, too.

I got it to work my webapp in the terminal, though, by chaining `firefox` via `&&` to the XAPPS- environment override. But that left me with an extra (open) terminal session. The same happened when I created a launch button -- an extra terminal session for each webapp; not what I liked to see.

Then I recalled what ToZ had mentioned a while ago about Xfce's "limited" built-in shell that processes launcher's command lines. So i compared the webapps' command line to other, 1-liner commands i use in a bunch of other launch buttons. I found that a) I had to use `bash` instead of `sh`, and b) remove the superfluous `&&` chaining. Once I fixed that, the webbapp worked, the chosen icon flowed fine, and the extra terminal session was no longer opened.

Now, when I look over your example I see that the `%u` parm you have is not being generated by the webapps-manager afaict, nor the `-P Default` parm (where do these come from?), and the "http://localhost" errors out (for me, anyway). Once I tweaked your example as explained, the webapp worked, the chosen icon flows just fine from the launch button to the windows-list, and giving it a meaningful URL that webpage opened ok.

Cheers, m4a

PS: I can see many good uses for this, ie having a dedicated launch button to access a wifi-router, network printer etc...


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

#11 2023-07-28 18:57:07

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

Re: How to give each Firefox-Profile a unique icon

desktop file for 'the reddit app'
made by ms-edge.
works perfectly:
... just not for ffox etc.
===========
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Bing AI - Search
Exec=/opt/microsoft/msedge-dev/microsoft-edge-dev --profile-directory=Default --app-id=gnoccggpipgoeclfcdpikbkngpefelgi "--app-url=https://www.bing.com/"
Icon=msedge-gnoccggpipgoeclfcdpikbkngpefelgi-Default
StartupWMClass=crx__gnoccggpipgoeclfcdpikbkngpefelgi
===========

m4a, if you could share a tweaked copy of the example i gave, that would be great.
because, no, this does not work. nor do i see why it should.

$ XAPP_FORCE_GTKWINDOW_ICON="/usr/local/share/icons/hicolor/32x32/apps/emacs.png"  firefox --class WebApp-TheReg5139 -P Default --no-remote "localhost"

maybe somebody has a working pattern to give each ffox(any browser/exectable)  icon-overrides.
maybe not. i have yet to see this work anywhere .. except in the microsoft code.

using current versions of ffox/xfce/debian

Offline

#12 2023-07-28 20:12:42

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

"One is glad to be of service..."

Step 1: I used the webapps-manager to create the entry for "Bing AI Search", letting the app locate the icon and save it as "BingAISearch.png"; nav-bar and private window enabled; no other parms. The app saved the following .desktop file:

[Desktop Entry]
Version=1.0
Name=Bing AI - Search
Comment=Web App
Exec=sh -c 'XAPP_FORCE_GTKWINDOW_ICON="/home/xxxxx/.local/share/ice/icons/BingAISearch.png" firefox --class WebApp-BingAISearch7605 --profile /home/xxxxx/.local/share/ice/firefox/BingAISearch7605 --no-remote --private-window "https://bing.com"'
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/xxxxx/.local/share/ice/icons/BingAISearch.png
Categories=GTK;WebApps;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupWMClass=WebApp-BingAISearch7605
StartupNotify=true
X-WebApp-Browser=Firefox
X-WebApp-URL=https://bing.com
X-WebApp-CustomParameters=
X-WebApp-Navbar=true
X-WebApp-PrivateWindow=true
X-WebApp-Isolated=true

in ~/.local/share/applications/webapp-BingAISearch7605.desktop

Step 2: gleaned/copied the parms from the above Exec= command line, changed `sh` to `bash`, to look like

bash -c 'XAPP_FORCE_GTKWINDOW_ICON="/home/xxxxx/.local/share/ice/icons/BingAISearch.png" firefox --class WebApp-BingAISearch7605 --profile /home/xxxxx/.local/share/ice/firefox/BingAISearch7605 --no-remote --private-window "https://bing.com"

Step 3: created a new launch button using the tweaked parms (omitting the Exec=) as the "Command" to be executed by the button. Of course, I had to point the button's icon to use Bing's that was saved in ~/.local/share/ice/icons.

The new button brings up Bing.com just fine, using Bing's icon in the title bar instead of firefox's, and the window-list shows Bing's icon as well.

Hope this helps. Cheers, m4a


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

#13 2023-07-29 15:23:33

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

Fwiw -- I just experienced a pleasant surprise, a solution that's even simpler than what I explained above: instead of creating an "empty" launcher and then populating it with the desired command (establishing a custom icon for a browser-"launched" website), I used the "+" option to allow the Xfce-panel to present me with the list of installed apps.

Surprise: the 2 "Bing-"related buttons I had previously created (using firefox vs. vivaldi) were listed, but without the `webapp-` prefix their respective .desktop file shows in ~/.local/share/applications. Even better, Xfce copied the .desktop file's full command string without changing the `sh` to `bash` as I had tweaked it earlier. When launching the NEW (pre-filled) button, the website's custom icon appeared just fine in the window's title bar (instead of the browser's icon), and appeared just fine in the window-list of open apps, WITHOUT launching the superfluous terminal session I mentioned/observed earlier.

Upshot: when you use Mint's webapp-manager app to create such "webapps", the name you give the webapp will then appear in the panel's app-selection list when creating a new launch button, and it will correctly pre-fill that button's fields thus adding a "launchable website" to your panel(s). So as long there's a launch button on your panel, there's no need to open the webapp-manager to open the desired website.

Once again, I am amazed about the level of Xfce's desktop-integration with what's installed...
Cheers, m4a


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

#14 2023-07-29 15:46:19

ConfusedUser7893
Member
Registered: 2023-07-26
Posts: 6

Re: How to give each Firefox-Profile a unique icon

ok ... ignoring the wonderful launcher, the command-line you gave:

bash -c 'XAPP_FORCE_GTKWINDOW_ICON="/home/xxxxx/.local/share/ice/icons/BingAISearch.png" firefox --class WebApp-BingAISearch7605 --profile /home/xxxxx/.local/share/ice/firefox/BingAISearch7605 --no-remote --private-window "https://bing.com"

works out to the following for me:

XAPP_FORCE_GTKWINDOW_ICON="/home/x/dev/c/emacs.png" firefox --class WebApp-BingAISearch7605 --profile /home/x/.mozilla/firefox/profiles/Default-esr.profile ""

the icon file is a copy from the distro.  neither it, nor the .png version, nor an (ascii) XPM file result in any change whatsoever.

we are still at the point that i started at.
and what you've is no different than what you proposed earlier,
meaning,

i am forced to accept your claim that the following works for you:

XAPP_FORCE_GTKWINDOW_ICON="/home/xxxxx/.local/share/ice/icons/BingAISearch.png" firefox --class WebApp-BingAISearch7605 --profile /home/xxxxx/.local/share/ice/firefox/BingAISearch7605 --no-remote --private-window "https://bing.com"


while i have two _x64 and one _x32 system that disagree.

can you/someone please suggest another place for me to ask this question.  i'm probably going to walk away from xfce over this and the lack if support for desktop actions after 8+ years.

Offline

#15 2023-07-29 21:05:13

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 276

Re: How to give each Firefox-Profile a unique icon

My regrets that I can't be of any further help. It looks like you've come across a longer-running, thorny issue (see GitLab discusssion @ https://github.com/linuxmint/webapp-manager/issues/103 ). The systems I support are all older _x64 models, running Mint 21.1 & 21.2, Xfce 4.14 & 4.18, respectively. Since Mint comes with firefox's .deb package, and doesn't preinstall other browsers such as firefox-esr, or edge, or chrome, etc. I'm at the end of my rope here.

However, I do have Vivaldi installed on my test system and found that the above solution does work with it, too. Good luck! Cheers, m4a


Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 627.48 KiB (Peak: 660.77 KiB) ]