I’m sure this is a common question, but I couldn’t find anything here (never found a forum system with a useful search function), and nothing I found elsewhere on the web looked like what I would call tutorial material. By “tutorial” I mean something that doesn’t assume the reader has already worked with the menu system. Stuff I can’t find:
the basics of how the system is put together
how desktop and directory files are related
a “Hello World” example
complete example of how to add items to existing menus, create new menus
where all the myriad menus on my system are defined
I would like to modify my menus. I can’t believe how many there are, and how much they overlap (even within a single menu)! I have the following:
xfce panel (title: openSUSE)
left mouse menu over root window (title Quick Menu)
right mouse over root window (title: Start)
Searching in /usr/share/applications and ~/.config/menus for files containing those titles, I found nothing.
If nothing else, I’d like a “Hello World” example. I tried creating a file called zenity.desktop in ~/.config/menus that has this content:
I tried creating ~/.config}/menus/xfce-applications.menu as it described. All that did was wipe out the panel menu. (At least I know it pays attention to that directory!)
I don’t want to mess with /usr/share/applications. I just want to do my own thing and not stomp on the system stuff installed by our admins. Any pointers appreciated.
Finally, my apologies for the rather demanding nature of this post. I’ve tried to tackle this problem on my own a few times over the past six months, and every time I have come up empty. I’m writing in a rather frustrated state of mind.
It looked like I should set XDG_DATA_DIRS so it wouldn’t look in /usr/share/applications for .desktop files. I set it like so:
export XDG_DATA_DIRS=$HOME/.local/share
and restarted. That didn’t work so well. Gnome Terminal wouldn’t run. Chrome looked kaleidoscopic. I had no icons. It seems everything depends on that colon-separated list of directories.
So, if I want to eliminate searching of /usr/share/applications, how do I go about doing that?
> - the basics of how the system is put together
> - how desktop and directory files are related
> - a “Hello World” example
> - complete example of how to add items to existing menus, create new
> menus
> - where all the myriad menus on my system are defined
Hmmm…
According to the referenced thread, LXDE and XFCE menus <may> work similarly.
I haven’t explored XFCE menus much, but if they work the same you might find the approach I describe for LXDE a very quick way to approach making new entries. http://en.opensuse.org/User:Tsu2/LXDE-Main_Menu
I’d expect the location for the menu configuration to be different… maybe…
My problem at this point is trying to figure out how to stop the menu generator (whatever that is) from considering /usr/share/applications/.desktop as candidate menu entry definitions. Let’s pretend for the moment that I’m not a Glade user. On my systems I have glade.desktop and glade-3.desktop files. (Even if I was a Glade user, I probably would only want one of them in my menus to avoid the mistake of starting the wrong version.) Both include the following categories: GNOME;GTK;Development;GUIDesigner. Right now, overriding XDG_DATA_DIRS to omit /usr/share altogether doesn’t seem practical, as that means XDG won’t look for anything in /usr/share/ (menus, icons, and I don’t know what all).
The two “solutions” I’m mulling in my head are:
Populate ~/.local/share with symlinks to the directories in /usr/share except for /usr/share/applications itself. Create the applications subdirectory and populate it with exactly the desktop files (or relevant symlinks) I want.
Gratuitously rename all the categories declared in ~/.config/menus/xfce-applications.menu so that nothing in /usr/share/applications/*.desktop matches, then populate ~/.local/share/applications with a set of .desktop files that uses the oddball category names I’ve chosen.
Neither option is particularly appealing. In the first case, I have to make sure that future updates to /usr/share don’t include new directories (which I would have to link to). In the second case, I would basically replicate all the stock .desktop files I do want, but couldn’t just create symlinks. I’d have to copy them and edit their Categories directive.
I can’t believe the XDG folks completely forgot to consider the case where someone might want to define their own menus, but so far it looks kind of like they did. Where might XDG folks hang out so I can accost them with questions?
On 2014-03-28 19:16, tsu2 wrote:
>
> Hmmm…
> According to the referenced thread, LXDE and XFCE menus <may> work
> similarly.
> I haven’t explored XFCE menus much, but if they work the same you might
> find the approach I describe for LXDE a very quick way to approach
> making new entries.
> http://en.opensuse.org/User:Tsu2/LXDE-Main_Menu
>
> I’d expect the location for the menu configuration to be different…
> maybe…
Every openSUSE package contains at least one desktop entry:
This file contains the definitions for the menus of all desktops used in
the system, they are autogenerated from the desktop files in the
“/usr/share/applications/” directory. So that directory has to be
mandatorily considered.
This is defined somewhere in the freedesktop specs, but I don’t know
exactly what code does the conversion from desktop files to menu files,
but each desktop may have its own conversion method.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
> I can’t believe the XDG folks completely forgot to consider the case
> where someone might want to define their own menus, but so far it looks
> kind of like they did. Where might XDG folks hang out so I can accost
> them with questions?
I think the approach is wrong. Instead of changing the system menu,
create a new menu from scratch, and then create a new menu on your
desktop that reads that new menu file instead of the default menu
definition.
In the case of XFCE, you add a menu to the panel (application menu),
then go to change properties, and tell that menu to use a custom menu file.
In the case of XFCE, you can also edit the default system menu, add
entries to it, deactivate others…
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
Thanks. I see how to do that. That still doesn’t solve the category problem or the (Unix) directory search problem. If I want a “Graphics” category, but don’t want Shotwell included, I can’t have a category named “Graphics”. That section of the system menu looks like this:
If I understand correctly, the <Directory> file basically tells the system how to display the word “Graphics” in a language-dependent fashion. I can thus leave the <Name> and <Directory> entries alone, yes? OTOH, the <Category> has to change to something that the Shotwell desktop file won’t match. I took that approach with my Network menu entry. That works, but sure seems like it will be tedious.
Sorry, I can’t see how to do that. Can you provide a pointer?
> robin_listas;2633681 Wrote:
>> In the case of XFCE, you can also edit the default system menu, add
>> entries to it, deactivate others…
>
> Sorry, I can’t see how to do that. Can you provide a pointer?
Right click on the icon of the menu, select properties. There is a
button in the dialog that comes up named “Edit Menu”.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
> Alas, not seeing that… Here’s the snapshot:
>
> http://tinyurl.com/pjyok9q
>
> (Can’t link from here - apparently the G+ URL isn’t recognized as a PNG
> file.)
That link gives an error:
+++̣̣̣··························
500. That’s an error.
There was an error. Please try again later. That’s all we know.
̣̣̣··························+±
Look in ~/.local/share/applications/
You should see menu items in there. If you put your zenity.desktop in the above folder, it should should show in your XFCE menu. It should only show in your user’s menu.