我的两个 Firefox 配置文件有两个不同的 .desktop 文件。它们都有不同的图标,并分别固定在我的仪表盘上,但运行时它们都运行在默认图标下。我该如何更改这种情况,让它们分别运行?
默认配置文件:
[Desktop Entry]all this seems to do is make them both launch Firefox with a default icon
Version=1.0
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox %u
Terminal=false
Type=Application
Actions=new-window;new-private-window;
Icon=firefox
[Desktop Action new-window]
Name=Open a New Window
Exec=firefox -new-window
[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=firefox -private-window
学校简介文件:
[Desktop Entry]
Version=1.0
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote
Terminal=false
Type=Application
Actions=new-window;new-private-window;
Icon=/home/callum/Pictures/firefox-school.png
[Desktop Action new-window]
Name=Open a New Window
Exec=firefox -P school -no-remote -new-window
[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=firefox -P school -no-remote -private-window
这是我的两个 Firefox 启动器的图像,我目前正在运行学校配置文件,但它显示默认实例已打开:
我正在运行 Kubuntu 19.10 和 KDE Plasma 5.16.5
谢谢!
编辑: 使用类我根据@vanadium 的建议更新了桌面文件以使用类,但第二个配置文件只是使用默认图标启动另一个 Firefox 实例。
默认配置文件:
[Desktop Entry]
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox -P personal -no-remote --class personalProfile
Terminal=false
StartupNotify=true
Type=Application
Icon=firefox
StartupWMClass=personalProfile
学校简介文件:
[Desktop Entry]
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote --class schoolProfile
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/callum/Pictures/firefox-school.png
StartupWMClass=schoolProfile
编辑2:
我修复了!我更新了桌面文件,~/.local/share/applications
而不是usr/share/applications
答案1
我通过向桌面文件添加类来解决这个问题:
[Desktop Entry]
Name=Firefox School
Comment=Browse the World Wide Web
Exec=firefox -P school -no-remote --class schoolProfile
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/callum/Pictures/firefox-school.png
StartupWMClass=schoolProfile
[Desktop Entry]
Name=Firefox Personal
Comment=Browse the World Wide Web
Exec=firefox -P personal -no-remote --class personalProfile
Terminal=false
StartupNotify=true
Type=Application
Icon=firefox
StartupWMClass=personalProfile
然后将新的桌面文件移动到,~/.local/share/applications
而不仅仅是usr/share/applications