BASE Main Menu Shortcut, NOT in a submenu!  Topic is solved

Please post all general support questions for LXDE here.

BASE Main Menu Shortcut, NOT in a submenu!  Topic is solved

Postby thraspic » Wed May 25, 2011 1:46 pm

I would like to put shortcuts for some programs on the BASE of the main menu, NOT in a Category/submenu. Logout and Run are already like this, but I don't understand how they manage it from the *desktop file and the 'panel' config file.

Every guide about adding Main Menu items to the lxde main menu fails to mention how to do this, yet I don't know anyone who wants ALL their shortcuts in longer-to-get-to submenus.

http://linux.koolsolutions.com/2009/09/ ... lxde-menu/

The link above alludes to doing what I'm asking, but the promised follow-up article that was supposed to describe the procredure was never published.

Is this a conspiracy by a trans-dimensional monster that feeds off unnecessary categorization?
thraspic
 
Posts: 12
Joined: Thu Mar 17, 2011 7:22 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby sportscliche » Fri May 27, 2011 12:54 pm

Like all the major desktop environments, LXDE is following the standards of freedesktop.org. Post #5 in the following thread should explain how to implement the customizations you want:

http://ubuntuforums.org/showthread.php?t=1136881
sportscliche
 
Posts: 24
Joined: Fri Feb 11, 2011 1:39 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby thraspic » Sat May 28, 2011 2:33 pm

sportscliche,

Post #5 refers to freedesktop standards, it's true, but it does not describe placing an item on the base of the menu.

The freedesktop specifications are long, technical, long, and lack a serious diversity of examples (two examples in the whole bloody thing if I remember right, you'd need more to see what's different, what's the same, etc.)

I wrote to the author of lxmed (http://lxmed.sourceforge.net/) and he responded:


Thank you for using lxmed!

As far as I know, there is no way to put a program on such level of main menu. However, if I discover how it can be done, I'll let you know of how to do it.

Best regards,
Marko Čičak



Now I am truly distressed, because I can't even determine if such a simple thing is possible. But I insist it must be possible, since lacking such a feature would be absurd to say the least.

I had some half-assed success with one technique that I tried initially. I am going back to play with it some more, because even though this is such a simple thing to ask, the answer seems buried.

There is a "Questions" section on LXDE's page, which wrongly characterizes 'alacarte' as being a capable of editting the menu. This needs to be changed. At most, alacarte can remove entries -- a far cry from compatible. Despite similar freedesktop standards, menu editors and menu editting techniques are just different enough between environemtns to muck everything up.
thraspic
 
Posts: 12
Joined: Thu Mar 17, 2011 7:22 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby thraspic » Sat May 28, 2011 2:48 pm

I've played around with my first instincts. Will post a full guide when I get back from a trip.
thraspic
 
Posts: 12
Joined: Thu Mar 17, 2011 7:22 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby Brad R » Sat May 28, 2011 3:05 pm

I'm still trying to figure this out myself. But while playing with alacarte, and trying to get it to edit the LXDE menu, I did manage to add an application entry to the main menu (not a submenu). Here's the tail of my lxde-applications.menu:

Code: Select all
   <!-- End Settings -->
   <Include>
      <Filename>alacarte-made-1.desktop</Filename>
   </Include>
   <DefaultLayout inline="false"/>
   <Menu>
      <Name>alacarte-made-1</Name>
      <Directory>alacarte-made-1.directory</Directory>
   </Menu>
   <Layout>
      <Merge type="menus"/>
      <Menuname>Accessories</Menuname>
      <Menuname>CrossOver</Menuname>
      <Separator/>
      <Menuname>Education</Menuname>
      <Menuname>Electronics</Menuname>
      <Menuname>Games</Menuname>
      <Menuname>Graphics</Menuname>
      <Menuname>Hamradio</Menuname>
      <Menuname>Internet</Menuname>
      <Menuname>Office</Menuname>
      <Menuname>Other</Menuname>
      <Menuname>Development</Menuname>
      <Menuname>Multimedia</Menuname>
      <Menuname>System</Menuname>
      <Menuname>Universal Access</Menuname>
      <Menuname>Windows Applications</Menuname>
      <Menuname>wine-wine</Menuname>
      <Separator/>
      <Menuname>DesktopSettings</Menuname>
      <Filename>alacarte-made-1.desktop</Filename>
      <Merge type="files"/>
   </Layout>
</Menu>
<!-- End Applications -->


I think the key entries are the <Include> near the top, and the <Filename> at the bottom of the layout. alacarte has obviously created an "alacarte-made-1.desktop" file to hold the application (in this case, Kwrite).

alacarte also managed to add a Separator before the Education menu; I just did this as a test.
Brad R
 
Posts: 3
Joined: Thu May 26, 2011 4:46 pm

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby thraspic » Sat May 28, 2011 11:06 pm

Brad R.

This looks interesting. Can you post the contents of that custom alacarte-made desktop file?

My solution to adding a program to the base main menu is to edit not the desktop or .menu files, but instead just editting ~/.config/lxpanel/LXDE/panels/panel

Obviously this is said to be ill-advised, but I will be using this solution until there is a problem.

The part I changed in ~/.config/lxpanel/LXDE/panels/panel was

Code: Select all

Plugin {
    type = menu
    Config {
        image=/home/churly/1.png
        system {
        }
        item {
            command=run
        }
        item {
            action=midori
            image=midori
       name=Midori
        }
        item {
            image=gnome-logout
            command=logout
        }



As you can see I added Midori, the web browser. The Run and Logout entries use "command=" which has to be changed to "action=" to run a basic command external of LXDE. Also, I think the Run and Logout entries are relying on their corresponding *.desktop files to name them. So Midori's icon was showing but the name was blank until I added "name=Midori"
thraspic
 
Posts: 12
Joined: Thu Mar 17, 2011 7:22 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby Brad R » Sun May 29, 2011 3:03 pm

Here it is. It's just an ordinary .desktop file. The only thing at all unusual is the hash-bang on the first line, which I presume is to allow this .desktop file to be run as an executable program.

Code: Select all
#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=Kwrite Text Editor
Exec=kwrite
Comment[en_US]=basic text editor
Name=Kwrite Text Editor
Comment=basic text editor
Icon=gnome-panel-launcher
Brad R
 
Posts: 3
Joined: Thu May 26, 2011 4:46 pm

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby sportscliche » Mon May 30, 2011 7:38 pm

Hmm, what am I missing? Can't you edit LXPanel directly as described in the wiki?

http://wiki.lxde.org/en/LXDE:Questions#LXPanel
sportscliche
 
Posts: 24
Joined: Fri Feb 11, 2011 1:39 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby thraspic » Mon May 30, 2011 11:19 pm

sportscliche,

The wiki link you posted doesn't mention how to add a program shortcut to the BASE or ROOT of the main menu. This link only describes and has examples for how to add a program to a Category/submenu on the main menu, as it neglects to show an example of a non-Categorized program shortcut. If that link does have information which implies how to add a shortcut that is not in a sub-menu, please post/quote the info directly so we know what you're talking about.

I am currently using the technique I posted above, simply adding 5 lines to the lxpanel config file "panel", and it's been working fine.
thraspic
 
Posts: 12
Joined: Thu Mar 17, 2011 7:22 am

Re: BASE Main Menu Shortcut, NOT in a submenu!

Postby sportscliche » Mon May 30, 2011 11:51 pm

Ahh OK, I understand now, I didn't read the OP carefully enough. I suggest that you modify the LXDE wiki since this is very useful information.
sportscliche
 
Posts: 24
Joined: Fri Feb 11, 2011 1:39 am

Next

Return to General Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest