Page 1 of 2

BASE Main Menu Shortcut, NOT in a submenu!

Posted: Wed May 25, 2011 12:46 pm
by thraspic
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?

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

Posted: Fri May 27, 2011 11:54 am
by sportscliche
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

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

Posted: Sat May 28, 2011 1:33 pm
by thraspic
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.

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

Posted: Sat May 28, 2011 1:48 pm
by thraspic
I've played around with my first instincts. Will post a full guide when I get back from a trip.

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

Posted: Sat May 28, 2011 2:05 pm
by Brad R
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.

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

Posted: Sat May 28, 2011 10:06 pm
by thraspic
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"

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

Posted: Sun May 29, 2011 2:03 pm
by Brad R
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

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

Posted: Mon May 30, 2011 6:38 pm
by sportscliche
Hmm, what am I missing? Can't you edit LXPanel directly as described in the wiki?

http://wiki.lxde.org/en/LXDE:Questions#LXPanel

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

Posted: Mon May 30, 2011 10:19 pm
by thraspic
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.

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

Posted: Mon May 30, 2011 10:51 pm
by sportscliche
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.