6

I have different Firefox profiles that I launch in kiosk mode in order to have small apps for YouTube and Netflix. I saw this problem asked multiple times but I tried other answers and it still doesn't work.

I use a youtube.desktop file that launches Firefox with a custom WM_CLASS:

[Desktop Entry]
Name=Youtube
Comment=Launch Youtube in kiosk mode
Type=Application

Exec=firefox --no-remote --new-instance -P "kiosk-youtube" --kiosk --class Firefox-kiosk-youtube https://youtube.com Terminal=false

Icon=/home/user/.local/share/icons/kiosk-firefox-icons/youtube.png StartupWMClass=Firefox-kiosk-youtube

Different Firefox profiles are still grouped together and using the basic Firefox icon.

I'm on GNOME, Ubuntu.

Thanks

1 Answers1

5

Update (2023-07-07): Removing the -no-remote CLI option avoids the Firefox is already running, but is not responding error.

For me (using Wayland and Gnome 43 on Fedora 37), the catch was to use --name Firefox-kiosk-youtube instead of --class Firefox-kiosk-youtube. Both of these command line arguments are defined by GTK and Firefox does not document them.

To have GNOME Shell show a nice icon and the contents of Name rather than WM_CLASS (or wmclass) directly, you also need to set StartupWMClass to the same value (e.g. Firefox-kiosk-youtube).

Here is my complete firefox-personal.desktop file:

[Desktop Entry]
Version=1.0
Name=Firefox (Personal)
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox -P personal --name FirefoxPersonal %u
Icon=firefox
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;
StartupNotify=true
# NOTE: If this is not set to the same as the argument of the --name option,
# then GNOME Shell won't show the nice Firefox icon and the user facing
# "Firefox (Personal)" text along with it.
StartupWMClass=FirefoxPersonal
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;

X-Desktop-File-Install-Version=0.26

[Desktop Action new-window] Name=Open a New Window Exec=firefox -P personal --name FirefoxPersonal --new-window %u

[Desktop Action new-private-window] Name=Open a New Private Window Exec=firefox -P personal --name FirefoxPersonal --private-window %u

To verify the WM_CLASS value, one can use GNOME Shell's built-in tool Looking Glass.

Press Alt + F2, type lg and press Enter. In the top-right panel, select "Windows".

The WM_CLASS will be displayed under the wmclass key.

For example: enter image description here

tjanez
  • 223