Score:0

Identical `.desktop` files in different directories

nl flag

I'm using Ubuntu 22.04 LTS (GNOME 42.5) and messing around with application icons. I noticed that there are some almost identical .desktop files in different files. For example, file bluetooth-sendto.desktop both exists in directories /usr/share/applications/ and ~/.gnome/apps/. The content of the two files are as follow:

  1. /usr/share/applications/bluetooth-sendto.desktop
[Desktop Entry]
Name=Bluetooth Transfer
Comment=Send files via Bluetooth
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=bluetooth
Exec=bluetooth-sendto
Terminal=false
Type=Application
Categories=GTK;GNOME;Utility;FileTools;
StartupNotify=true
NoDisplay=true
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-bluetooth
X-GNOME-Bugzilla-Component=sendto
X-GNOME-Bugzilla-Version=3.34.5
X-Ubuntu-Gettext-Domain=gnome-bluetooth2
  1. ~/.local/share/applications/bluetooth-sendto.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=Bluetooth Transfer
Comment=Send files via Bluetooth
Icon=bluetooth
Exec=bluetooth-sendto
Actions=
Categories=FileTools;GNOME;GTK;Utility;
StartupNotify=true
  1. ~/.gnome/apps/bluetooth-sendto.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=Bluetooth Transfer
Comment=Send files via Bluetooth
Icon=bluetooth
Exec=bluetooth-sendto
Actions=
Categories=FileTools;GNOME;GTK;Utility;
StartupNotify=true
OnlyShowIn=Old;

Since there are multiple files that do basically the same thing, I have two questions:

  1. Is the second and third ones considered "obsolete" or do they just exist to fulfill some backward compatibility?
  2. Which file is controlled by menulibre?
Score:0
cn flag

The menu system in any XDG compliant desktop searches .desktop launchers in specific directories in order to build the application menu. These directories are ~/.local/share/applications and any applications directory under each directory listed in the XDG_DATA_DIRS environmental variable. If files with the same name exist in multiple of these directories, the first one encountered will be used. Thus, for example, a file ~/.local/share/applications/firefox.desktop will be used, and not /usr/share/applications/firefox.desktop. This mechanism allows to override systemwide installed launchers with launchers customized for the current user.

Files where NoDisplay is set to true will not be included in the application menu. This is the case in your first /usr/share/applications/bluetooth-sendto.desktop launcher. The ~/.local/share/applications/bluetooth-sendto.desktop does not have that directive. Because the default for NoDisplay is true, that launcher should cause a menu item to be shown.

  1. Is the second and third ones considered "obsolete" or do they just exist to fulfill some backward compatibility?

The second one is the one that is in use when you are logged in. The first one is the systemwide one, i.e., will be used if a user does not have a private one. The third one is not within the search path for the menu system, at least not on a default Ubuntu system.

  1. Which file is controlled by menulibre?

If you change a .desktop file in menulibre, changes will always be stored in ~/.local/share/applications. If a .desktop launcher is already existing there, changes will be added to that file. If instead a systemwide launcher was in effect, changes made with menulibre will be stored in a copy under ~/.local/share/applications.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.