当我打开某些程序时,Ubuntu Dock 会添加一个新图标

当我打开某些程序时,Ubuntu Dock 会添加一个新图标

我最近将 Terminator(终端模拟器)添加到我的系统中。当我打开 Terminator(无论是通过单击启动器中的图标还是通过按键盘快捷键)时,启动器(Ubuntu Dock)中都会出现一个新图标。

在此处输入图片描述

我可以做什么

  1. 只有一个图标,
  2. 如果 Terminator 已在运行,是否仅激活现有的 Terminator 窗口?

使用 gnome-terminal 时我没有遇到这个问题。

我正在运行 Ubuntu 18.04.4 LTS。

我在看这是 Google Chrome 图标的解决方案,但它不适用:我的$HOME/.local/share/applications不包含任何终结者的桌面文件。

这是我的内容/usr/share/applications/terminator.desktop

[Desktop Entry]
Name=Terminator
Comment=Multiple terminals in one window
TryExec=terminator
Exec=terminator
Icon=terminator
Type=Application
Categories=GNOME;GTK;Utility;TerminalEmulator;System;
StartupNotify=true
X-Ubuntu-Gettext-Domain=terminator
X-Ayatana-Desktop-Shortcuts=NewWindow;
Keywords=terminal;shell;prompt;command;commandline;
[NewWindow Shortcut Group]
Name=Open a New Window
Exec=terminator
TargetEnvironment=Unity

更新:我发现,按 Windows 键、输入“Terminator”、右键单击“Terminator”并选择“添加到收藏夹”可以避免部分此类问题。(在启动器中右键单击“Terminator”图标时,“添加到收藏夹”从来都不是一个选项。)然而,当我按++Ctrl打开终端时,它Altt仍然在启动器中创建一个新图标。

答案1

尝试这个

启动 Terminator 并在终端中运行xprop WM_CLASS。现在将光标(可能看起来像一个十字)放在 Terminator 窗口上并单击:

$ xprop WM_CLASS
# after clicking window
WM_CLASS(STRING) = "terminator", "Terminator"

在您的桌面文件中添加一行内容

StartupWMClass=<second entry in WM_CLASS(STRING) without the quotes>

这也许能解决你的问题。

相关内容