Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: "Hello Word!" example for XFCE menus?

  1. #1

    Default "Hello Word!" example for XFCE menus?

    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:

    [Desktop Entry]
    Encoding=UTF-8
    Exec=zenity --info --text="Hello World!"
    Type=Application
    Terminal=false
    Name=zenity
    GenericName=zenity
    StartupNotify=true
    Categories=Other

    I've executed xfce4-panel -r but don't see this menu item appear anywhere in any of my multitudinous menus.

    Looking at this page:

    http://wiki.xfce.org/howto/customize-menu#questions

    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.

  2. #2

    Default Re: "Hello Word!" example for XFCE menus?

    Duh... Make that "Hello World!"... Alas, I can't fix the subject now.

  3. #3

    Default Re: "Hello Word!" example for XFCE menus?

    I stumbled upon this page:

    http://wiki.xfce.org/howto/customize-menu

    and this one:

    http://standards.freedesktop.org/bas...ec-latest.html

    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?

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: "Hello Word!" example for XFCE menus?

    On 2014-03-27 18:36, smontanaro wrote:

    > - 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


    Have a look at this thread:
    http://forums.opensuse.org/showthread.php?t=477258

    there is some info about how menus work.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,109
    Blog Entries
    2

    Default Re: "Hello Word!" example for XFCE menus?

    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...

    Maybe helpful,
    TSU

  6. #6

    Default Re: "Hello Word!" example for XFCE menus?

    Thanks for the references, robin_listas and tsu2.

    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:


    1. 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.
    2. 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?

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: "Hello Word!" example for XFCE menus?

    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:

    Code:
    cer@Telcontar:~> rpm -ql meld | grep desktop
    /usr/share/applications/meld.desktop
    cer@Telcontar:~>
    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)

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: "Hello Word!" example for XFCE menus?

    On 2014-03-28 20:56, smontanaro wrote:

    > 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)

  9. #9

    Default Re: "Hello Word!" example for XFCE menus?

    Quote Originally Posted by robin_listas View Post
    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.
    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:

    <Menu>
    <Name>Graphics</Name>
    <Directory>xfce-graphics.directory</Directory>
    <Include>
    <Category>Graphics</Category>
    </Include>
    </Menu>

    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.

    Quote Originally Posted by robin_listas View Post
    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?

    Thx...

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: "Hello Word!" example for XFCE menus?

    On 2014-03-31 20:16, smontanaro wrote:

    > 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)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •