How to add a command in the lxpanel menu plugin ?

The standard panel of LXDE - http://wiki.lxde.org/en/LXPanel
Locked
DDZ
Posts: 34
Joined: Wed Aug 25, 2010 5:48 pm

How to add a command in the lxpanel menu plugin ?

Post by DDZ »

Hello !


I want to add a lockscreen command to the lxpanel menu plugin like this :

~/.config/lxpanel/Lubuntu/panels

Plugin {
type = menu
Config {
image=/usr/share/icons/hydroxygen/22x22/places/start-here.png
system {
}
separator {
}
item {
image=system-run
command=run
}
separator {
}
item {
name=Lock screen
image=gnome-lockscreen
command=gnome-screensaver-command --lock
}

item {
image=gnome-logout
command=logout
}
}
}


I can see the new item (name and icon) but the command doesn't work (this command works in a terminal, with the .desktop file in /usr/share/applications).

Any idea ?
Thank you in advance for your answer and have a nice day !
Lubuntu 12.10
rjarvis2010
Posts: 1
Joined: Mon Nov 26, 2012 10:12 pm

Re: How to add a command in the lxpanel menu plugin ?

Post by rjarvis2010 »

Use 'action=<command-line>' instead of 'command=<command-line>'. That should work. (It did for me.) My entry is:
item {
name=Lock Screen
image=system-lock-screen
action=xscreensaver-command -lock
}

I'd be curious to know what 'command' refers to. It appears to refrence a built-in command, but I don't know where they are defined or configured. It would be nice to know what's available, even if they are hard coded into LXDE (which seems doubtful, given the level of customization of everything else).
DDZ
Posts: 34
Joined: Wed Aug 25, 2010 5:48 pm

Re: How to add a command in the lxpanel menu plugin ?

Post by DDZ »

rjarvis2010 wrote:Use 'action=<command-line>' instead of 'command=<command-line>'. That should work. (It did for me.) My entry is:
item {
name=Lock Screen
image=system-lock-screen
action=xscreensaver-command -lock
}
It works for me too. Thank you! 8-)
Lubuntu 12.10
Locked