Page 1 of 1

How to add a command in the lxpanel menu plugin ?

Posted: Mon Mar 28, 2011 3:19 pm
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 !

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

Posted: Mon Nov 26, 2012 10:17 pm
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).

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

Posted: Mon Nov 26, 2012 11:42 pm
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-)