LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 07-03-2022, 08:41 AM   #1
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
system menu: which *.desktop files are relevant?


Debian bookworm
Fluxbox
FBPanel

Good afternoon

Short: I had duplicate entries in my system menu and found the reason in additional *.desktop files in a sub-directory to /usr/share.

Longer: If the *.desktop files in /usr/share/applications create entries in the system menu, and others in different sub-directories do the same, how do I know, which directories and files are taken into account?

The SoftMaker Office-suite – commercial and freeware – used to create such duplicate entries, years ago. I had not seen it happen since, but today found again two entries for each of the Freeoffice-components (screen shot). The desktop-files which were responsible were in /usr/share/applications, as expected, but also in /usr/share/freeoffice2021/mime.

I can duplicate other *.desktop files and put them into sub-directories of /usr/share, without noticing changes in the system menu...

My search-criteria may be ill-chosen, but I cannot find information on the Web. What am I missing?
Attached Thumbnails
Click image for larger version

Name:	sc_systemmenu_duplicate_entries.png
Views:	10
Size:	22.8 KB
ID:	39208  

Last edited by Michael Uplawski; 07-03-2022 at 08:45 AM.
 
Old 07-03-2022, 12:01 PM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 942

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
Have you tried right-clicking on duplicate items or on the menu root? Don't know about your shell, but in KDE right-click menu will eventually lead you to the location of desktop file.

Last edited by lvm_; 07-03-2022 at 12:22 PM.
 
Old 07-04-2022, 06:37 AM   #3
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by lvm_ View Post
Have you tried right-clicking on duplicate items or on the menu root? Don't know about your shell, but in KDE right-click menu will eventually lead you to the location of desktop file.
A right-click opens the application in the same way as a left click. I do not know if this is Debian-specific or related to fbpanel, Fluxbox or what else.
Apart from that, I find every desktop file I want. What I do not know is: Where is it configured that certain folders with desktop-files will create menu-entries and others not
 
Old 07-14-2022, 06:13 AM   #4
WindowMaker
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian
Posts: 12

Rep: Reputation: 1
Arrow There are two folders, but beware of other implications

The default directory of *.desktop shortcuts for programs installed system-wide is indeed `/usr/share/applications`. However, there is also another directory with the same role, but intended for programs installed for a specific user, and that is `.local/share/applications` in user's home directory.

Extra note for the record: the actual file name of each *.desktop shortcut do not necessarily reflect its display text; thus you can have two *.desktop shortcuts both showing "FreeOffice 2021 TextMaker" name even they are both in the same folder- because each of them actually use different file name. (You might have to use command line to inspect this, since your favorite file manager might display them using self-proclaimed name specified in the shortcut themselves, instead of actual filename they use on the filesystem)

To find which *.desktop files are responsible for "FreeOffice 2021 TextMaker" menu item, the following command line should get you covered:
Code:
grep -F -R -i -l 'FreeOffice 2021 TextMaker' /usr/share/applications ~/.local/share/applications
If you found the duplicate one in the latter (user-specific) folder, then you should be able to solve that by moving the offending *.desktop shortcut out of that folder, or change its file extension to something that is not `.desktop`.

Quote:
Originally Posted by Michael Uplawski View Post
My search-criteria may be ill-chosen, but I cannot find information on the Web. What am I missing?
If you would like to get into the nitty-gritty details, the *.desktop shortcut format is described in FreeDesktop.org Desktop Entry Specification, and how the launcher menus gathers the shortcuts together is described in FreeDesktop.org Desktop Menu Specification. Note that these are developer documentation, but can be relevant for power users as well. (The point about `.local/` in home directory is not spelled out here however)

P.S. The relevant FreeDesktop specification on launcher menus seems to also allow menu itself to specify its own custom *.desktop directory, but I don't think that happens very often; and especially not in the case shown in the screenshot: which was just a stock "Office" menu provided by desktop environment, rather than a submenu dedicated to specific a brand of application suites.
 
Old 07-15-2022, 03:27 PM   #5
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
@WindowMaker: Thank you for the detailed information. I had indeed taken a look at .local/share/applications but found the desktop-files for the duplicate entries in /usr/share/freeoffice2021/mime. This directory must have been created by the FreeOffice installer or upon installing with apt. Removing these desktop-files solved my initial problem.

Now I still wonder, how they get their own directory honored by the menu. What I *hope for*, is some configuration file, where it sais that /usr/share/freeoffice2021/mime is meant to contain desktop-files for the system menu. The same directory contains the utility-script xdg-desktop-menu. The only possibility that I see is that the script – upon execution – looks in the current directory and adds all it finds there to the system menu. I do not understand it, yet, but I keep reading it.

Else I continue to not understand. On the other hand, if I am guessing right, I will call this procedure Bull.

Last edited by Michael Uplawski; 07-15-2022 at 03:30 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telegram Desktop = Telegram FOSS? (Pinephone Pro/ custom ROM relevant.) Eucalyp333 Linux - Software 9 02-04-2022 08:09 PM
[SOLVED] (No longer relevant) Need help setting up a backup system for system partition and data files Tem2 Linux - Newbie 10 01-19-2022 10:40 AM
Moving bash files to relevant directory salmanahmed Linux - Newbie 7 07-03-2020 04:32 AM
LXer: Java still relevant, Linux desktop, and more industry trends LXer Syndicated Linux News 1 09-25-2019 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration