linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.56k stars 742 forks source link

Missing icon, with modified *.desktop file #11427

Open Nightwing0815 opened 1 year ago

Nightwing0815 commented 1 year ago

When you modify *.desktop files with a new entry, the icon in context menu is missing, but only in start menu. The linked file in panel will show an icon, but not the right one (better, than nothing). Two examples to reproduce:

firefox.desktop (new entry: open a new tab)

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer
Keywords[de]=Internet;WWW;Browser;Web;Explorer;Webseite;Site;surfen;online;browsen
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
NoDisplay=false
Actions=new-tab;new-window;new-private-window;

[Desktop Action new-tab]
Name=Open a new tab
Name[de]=Einen neuen Tab öffnen
Exec=firefox -new-tab about:newtab

[Desktop Action new-window]
Name=Open a New Window
Name[de]=Ein neues Fenster öffnen
Exec=firefox -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Name[de]=Ein neues privates Fenster öffnen
Exec=firefox -private-window

nemo.desktop (open as root)

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Files
Name[de]=Dateien
Comment=Access and organize files
Comment[de]=Dateien aufrufen und organisieren
Exec=nemo %U
Icon=system-file-manager
# Translators: these are keywords of the file manager
Keywords=folders;filesystem;explorer;
Terminal=false
Type=Application
StartupNotify=false
Categories=GNOME;GTK;Utility;Core;
MimeType=inode/directory;application/x-gnome-saved-search;
Actions=open-home;open-root;

[Desktop Action open-home]
Name=Home
Exec=nemo %U

[Desktop Action open-root]
Name=Root
Name[de]=Systemverwaltung
# Exec=sudo -H nemo %U
Exec=sudo -H nemo /

Bildschirmfoto vom 2023-01-16 11-15-24 Bildschirmfoto vom 2023-01-16 11-15-45 Bildschirmfoto vom 2023-01-16 11-15-57 Bildschirmfoto vom 2023-01-16 11-16-09

Don't know, if its a bug or just an error from an user...?!

ToM

mtwebster commented 1 year ago

This is deliberate. At the moment these icons are hardcoded to match common actions to avoid having full color icons show up alongside symbolic ones: https://github.com/linuxmint/Cinnamon/blob/master/files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js#L479-L487

currently supported actions: https://github.com/linuxmint/Cinnamon/blob/master/js/misc/util.js#L801-L867

We can add a 'new-tab' entry - I'm surprised it's not there already.

I didn't realize how ugly it looks though - the label should stay aligned with other labels whether there's an icon or not.

Nightwing0815 commented 1 year ago

Ah okay, I see. Thanks for enlighten me, Michael.

We can add a 'new-tab' entry - I'm surprised it's not there already.

Yep, i was surprised, too. In windows, it is. But that's not an option, to not use mint :smile:

I didn't realize how ugly it looks though - the label should stay aligned with other labels whether there's an icon or not.

Your free to do this :+1:

Apropos ugly: Is there a way, to locally override a single word in the translation files? German translation for root sounds very 1980 or earlier :smile:

ToM