启动 Firefox 时不要设置“Navigator”的 wm_class

启动 Firefox 时不要设置“Navigator”的 wm_class

我按如下方式启动 Firefox:

/usr/bin/firefox --no-remote -P Fastmail --class "FastmailFF"

最终目标是找出一个放入 .desktop 文件的命令,该文件将拥有自己的图标并独立于普通浏览器而存在。

上面的内容被分组在当前的 Firefox 图标下。

当我使用命令检查窗口时xprop WM_CLASS,我得到以下内容:

WM_CLASS(STRING) = "Navigator", "FastmailFF"

以及主要 Firefox 的以下内容:

WM_CLASS(STRING) = "Navigator", "firefox"

所以我认为常见的“Navigator”字符串导致了分组。

有没有办法防止Navigator启动时被添加?

看起来 Firefox 是通过快照安装的:

Version: 1:1snap1-0ubuntu2

我正在运行 gnome 42.5 和 wayland

答案1

更新(2023-07-07):删除-no-remoteCLI 选项可以避免Firefox 已在运行,但没有响应错误。

--name FastmailFF对于我(在 Fedora 37 上使用 Wayland 和 Gnome 43)来说,问题是使用--class FastmailFF.

这是完整的firefox-personal.desktop文件:

[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

相关内容