Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-11-23 04:34:15

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Editing menus (sigh) RESOLVED

I have probably well over a hundred apps installed and keeping the launch menus straight has long been a problem. Many are involved with videos, but the stock menu system just displays a category 'Multimedia' and throws into it players, editors, and subtitle editors. So several years ago I used the wiki article here https://wiki.xfce.org/howto/customize-menu to delete the Multimedia category and create three to replace it: Multimedia-Editors, Multimedia-Players, and Multimedia-Subtitles. This has worked very well for me, but it has been a while since I tidied things up, plus a recent dist-upgrade from Xubuntu 16.04 to 18.04 has created a lot of housekeeping work.

I started by corralling all the .desktop files into /usr/share/applications, .desktop files which package installers put all over the place. (That is, except for the .desktop files for each of the three directories, which I created myself, and which are in ~/local/share/desktop-directories.) In the process I deleted a lot of duplicates, and also verified the Category= line for most of the multimedia apps.

Now for the problem: About half of them do not appear in the menu where they belong, in fact they do not appear anywhere in the menu in any category. Case in point: I have seven subtitle editors, and the Category line for each is uniformly 'Categories=Multimedia-Subtitles.' Of the seven, four appear in Multimedia-Subtitles where they belong, and the other three are nowhere to be found. I can launch the other three by double clicking on their .desktop files, so I know there is nothing wrong with their installation.

Note: In the past I have used Llxmenu Editor, Mx Menu Editor, and Alacarte, and all are buggier than a summer picnic. I give them a wide berth.

Does anyone have any ideas or suggestions? I could really use some help!

Last edited by John Jason Jordan (2019-11-27 16:50:10)

Offline

#2 2019-11-23 17:09:32

CwF
Member
Registered: 2018-01-28
Posts: 52

Re: Editing menus (sigh) RESOLVED

You could use the "Applications Menu" plugin and point it to a custom menu file.

https://forum.xfce.org/viewtopic.php?id=12555

Offline

#3 2019-11-23 17:45:13

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

Thanks for the tip. It took me a few minutes to figure out that '"Applications Menu" plugin' meant to right click on the Mouse that opens the menu, and then edit the location of my custom menu file. Indeed, the location was blank, so I entered its location (~/config/menus/xfce.applications.menu. I had high hopes that this would fix the problem, but it did not. About a third of all my desktop files still do not appear anywhere in the menus.

Offline

#4 2019-11-24 17:48:54

ctac
Member
Registered: 2017-05-08
Posts: 48

Re: Editing menus (sigh) RESOLVED

I think your desktop files are not valid or not in a well know directory for the menu.
If the menu can't find the Categories for your menus, they are add to Other.
If you can't find them anywhere, this come from your desktop files.

Offline

#5 2019-11-24 18:36:33

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

ctac wrote:

I think your desktop files are not valid or not in a well know directory for the menu.
If the menu can't find the Categories for your menus, they are add to Other.
If you can't find them anywhere, this come from your desktop files.

Thanks for the suggestions.

1) All the .desktop files are in the same folder, /usr/share/applications.
2) They all have the exact same Categories= line (copied and pasted).
3) I do not have an Other category because when creating my own menu I deleted the Other category.

And my custom menu file, stored in ~/config/menus/xfce.applications.menu, is working fine, else the 39 programs that do appear would also be missing. 

Update: After rebooting, of my 45 multimedia programs only six now fail to appear. It would be really helpful if there was a way to reload just the panel without killing and restoring the whole desktop. Or even just reload the Applications panel plugin. Usually when I make a change to a .desktop file the change is reflected in the menu immediately with no other action on my part required, but being able to force an update might be useful.

Offline

#6 2019-11-24 22:58:25

CwF
Member
Registered: 2018-01-28
Posts: 52

Re: Editing menus (sigh) RESOLVED

John Jason Jordan wrote:
ctac wrote:

I think your desktop files are not valid or....

helpful if there was a way to reload just the panel...

If everything is straight the custom menu file is updated without restarting.

Offline

#7 2019-11-25 00:18:09

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

... helpful if there was a way to reload just the panel...

If everything is straight the custom menu file is updated without restarting.

I'm not sure that is completely correct. Most of the time when I change the Categories= line in a .desktop file and save it the menu is updated immediately, but not always. But yesterday I had about 16 that I had changed and the menu did not update for them, but then I rebooted. After rebooting 10 of the 16 appeared in the menu. I have no explanation for this.

As for the remaining six that I still can't get to appear in the menu, I must assume that there is something wrong with them, but figuring out what is wrong is vexing me. The Categories= line in each one is identical to .desktop files that do appear in the menu (copied and pasted from working .desktop files). I have commented out everything else in them except Name=, Exec=, Type=Application, and Terminal=false, and they still fail to appear.

Offline

#8 2019-11-26 21:11:48

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

I've spent several hours trying to get all my programs to appear in the menu, and of a little over 250 desktop files I have all but 16 working. In the process I discovered that I had desktop-file-utils installed, which includes three utilities: desktop-file-validate, desktop-file-install, and update-desktop-database. I've been using the validate utility on my remaining .desktop files, and each time I get an error message that the category that I specified was not registered, and therefore the category needs 'X-' in front of it. I edited each .desktop file to add the X-, but it didn't make any difference; the application still fails to appear.

What I am wondering now is how do I register a category? My new categories appear in the menu, and each has a .directory and a .desktop file in ~/.local/share/desktop-directories, but apparently that is not enough. I've searched all over the net for how I can register my categories, but so far I haven't found the secret. And, even though my categories are not registered, most of my .desktop files appear in them anyway.

Any suggestions welcome!

Offline

#9 2019-11-27 06:30:40

alcornoqui
Member
Registered: 2014-07-28
Posts: 493

Re: Editing menus (sigh) RESOLVED

Did you see this? Registered Categories

Offline

#10 2019-11-27 07:24:33

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

alcornoqui wrote:

Did you see this? Registered Categories

No, I didn't. Thanks so much for pointing it out!

So it appears that my three new categories are impossible, because they are not in the list of registered main, additional, or reserved categories. Yet they work for most of my applications without listing any additional categories in the .desktop file. But some applications fail to appear.

I found that if you want to use a custom category, like mine:

Multimedia-Editors
Multimedia-Players
Multimedia-Subtitles

You have to create your category in ~/.config/menus/xfce-applications.menu that looks like this:

    <Menu>
        <Name>Multimedia Players</Name>
        <Directory>Multimedia-Players.directory</Directory>
        <Include>
                <Or>
                  <Category>Multimedia-Players</Category>
                  <Category>AudioVideo></Category>
                </Or>
        </Include>
    </Menu>

Note how I used the <Or> section to refer to AudioVideo, a registered category, so that any application with Categories=AudioVideo; will also appear in my Multimedia-Players category.

The weird thing is that 17 of my 20 'player' applications appear in the Multimedia-Players category even though their Categories= line contains only 'Multimedia-Players;'. For three of them I had to add 'AudioVideo' to the list of categories in order to get them to appear. Why?

Oh well, I am happy to say that I now have 100% of my applications appearing in the categories where I want them. That is, until I install or reinstall an application and dpkg or apt screws everything up again. sad

Thanks again for the link!

Last edited by John Jason Jordan (2019-11-27 07:28:03)

Offline

#11 2019-11-27 08:05:59

alcornoqui
Member
Registered: 2014-07-28
Posts: 493

Re: Editing menus (sigh) RESOLVED

Oh, that's great!

For the record, I just did a quick DuckDuckGo search.

You can edit the post title to add a [SOLVED] tag

wink

Offline

#12 2019-11-27 16:46:45

ctac
Member
Registered: 2017-05-08
Posts: 48

Re: Editing menus (sigh) RESOLVED

Like say by alcornoqui, take a look at this link and specifically at sysconfdir/menus/applications-merged/
This way, you can get menu and sub-menu with the name you want without take care of registered main, additional, or reserved categories.

Offline

#13 2019-11-27 16:55:21

John Jason Jordan
Member
Registered: 2019-11-22
Posts: 12

Re: Editing menus (sigh) RESOLVED

John Jason Jordan wrote:

Update: After rebooting, of my 45 multimedia programs only six now fail to appear. It would be really helpful if there was a way to reload just the panel without killing and restoring the whole desktop. Or even just reload the Applications panel plugin. Usually when I make a change to a .desktop file the change is reflected in the menu immediately with no other action on my part required, but being able to force an update might be useful.

I should add that I finally found a command to refresh just the panel - xfce4-panel -r. Saves a lot of time!

Offline

Board footer

Powered by FluxBB