You are not logged in.
Pages: 1
The question is easy.
How can I get to shutdown my computer with LXDE?
I want to shutdown with the menu, but also I want to know a command in order to shutdown until I get what I've questioned.
Thanks everybody!
Last edited by halcor (2008-09-20 00:06:35)
Offline
You can use the commands "poweroff" and "reboot" to shutdown and reboot your system, resp. You need superuser privileges to do that though, and to use them in the menu, you need to add a line like this to your sudoers file:
%<some group here> ALL=NOPASSWD: /sbin/poweroff, /sbin/reboot
or
<your user name> ALL=NOPASSWD: /sbin/poweroff, /sbin/reboot
To edit the file, use
visudo
After that you can shutdown with "sudo poweroff" etc without entering your password. The following lines in your openbox menu file (~/.config/openbox/menu.xml) will add the commands to your menu with a yes/no dialogue:
<item label="Reboot">
<action name="Execute">
<command>sudo reboot</command>
<prompt>Reboot?</prompt>
</action>
</item>
<item label="Shutdown">
<action name="Execute">
<command>sudo poweroff</command>
<prompt>Shutdown?</prompt>
</action>
</item>
Add them between the <menu> tags of the root menu, at the end just before the </menu> tag. Change the prompt question between the <prompt> tags to whatever you like, or remove the <prompt> tags altogether to skip the prompt.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Xine, I add the second option in visudo. (:w & :q)
In my computer don't exist ~/.config/openbox/menu.xml but exist ~/.config/openbox/lxde-rc.xml
In lxde-rc.xml I found a big xml and I found the tags <menu> I put like this, but nothing happen.
<menu>
<!-- You can specify more than one menu file in here and they are all loaded,
just don't make menu ids clash or, well, it'll be kind of pointless -->
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<file>/usr/share/lxde/openbox/menu.xml</file>
<hideDelay>200</hideDelay>
<!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again -->
<middle>no</middle>
<!-- center submenus vertically about the parent entry -->
<submenuShowDelay>100</submenuShowDelay>
<!-- this one is easy, time to delay before showing a submenu after hovering
over the parent entry -->
<applicationIcons>yes</applicationIcons>
<!-- controls if icons appear in the client-list-(combined-)menu -->
<manageDesktops>yes</manageDesktops>
<!-- show the manage desktops section in the client-list-(combined-)menu -->
<item label="Reboot">
<action name="Execute">
<command>sudo reboot</command>
<prompt>Reboot?</prompt>
</action>
</item>
<item label="Shutdown">
<action name="Execute">
<command>sudo poweroff</command>
<prompt>Shutdown?</prompt>
</action>
</item>
</menu>
Don't work, the menu don't show me new buttons.
Offline
Unfortunately, the rc.xml file won't do the trick...that file holds the preferences for Openbox, not the menu entries. I have no experience whatsoever with LXDE, but Openbox when run by itself uses ~/.config/openbox/menu.xml to define the menu entries.
I would suggest googling LXDE to determine how they have implemented the menu.
thayer williams ~ cinderwick.ca
Offline
Ok, I found that the menu of openbox is in: /usr/share/lxde/openbox/menu.xml
I open as a root and I change it and now it is like that:
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="apps-menu" label="Applications">
<item label="PCManFM">
<action name="Execute">
<startupnotify><enabled>yes</enabled><icon>pcmanfm</icon></startupnotify>
<command>pcmanfm</command></action>
</item>
<item label="Sakura">
<action name="Execute"><command>sakura</command></action>
</item>
<item label="Kazehakse">
<action name="Execute"><command>kazehakase</command></action>
</item>
</menu>
<menu id="root-menu" label="LXDE">
<separator label="LXDE" />
<menu id="apps-menu" />
<separator />
<menu id="client-list-menu" />
<separator />
<item label="ObConf">
<action name="Execute">
<startupnotify><enabled>yes</enabled><icon>openbox</icon></startupnotify>
<command>obconf</command>
</action>
</item>
<item label="Reload Config Files">
<action name="Reconfigure" />
</item>
<separator />
<item label="Desconectar">
<action name="Execute"><command>lxde-logout</command></action>
</item>
<item label="Reiniciar">
<action name="Execute">
<command>sudo reboot</command>
<prompt>Reboot?</prompt>
</action>
</item>
<item label="Apagar">
<action name="Execute">
<command>sudo poweroff</command>
<prompt>Shutdown?</prompt>
</action>
</item>
</menu>
</openbox_menu>
And now if I click with second button of the mouse, I can shutdown or restart the computer. It's good but I want that the options appear in the menu applications.
Thanks!
Offline
I think should you have a look at the Openbox wiki for Arch. You shouldn't edit the default menu.xml (in /etc) because it will be replaced on upgrades...the wiki has the details.
Last edited by thayer (2008-09-18 22:19:03)
thayer williams ~ cinderwick.ca
Offline
From ~/.config/openbox/lxde-rc.xml that you posted:
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<file>/usr/share/lxde/openbox/menu.xml</file>
Undo all changes that you've made (remove everything that you added to /usr/share/lxde/openbox/menu.xml and to ~/.config/openbox/lxde-rc.xml).
Copy /usr/share/lxde/openbox/menu.xml to ~/.config/openbox/menu.xml
Add the item tags that I posted to ~/.config/openbox/menu.xml]
Change
<file>/usr/share/lxde/openbox/menu.xml</file>
in ~/.config/openbox/lxde-rc.xml
to
<file>menu.xml</file>
or, if that doesn't work, to
<file>/home/<username>/.config/openbox/menu.xml</file>
If you want them to appear among the menu applications, place them in between these tags:
<menu id="apps-menu" label="Applications">
</menu>
As thayer mentioned, there's more information in the wiki about configuring openbox, including applications that can help edit the menu.
Here's the openbox menu documentation on the openbox website: http://icculus.org/openbox/index.php/Help:Menus
Last edited by Xyne (2008-09-18 22:48:53)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
The question is easy.
How can I get to shutdown my computer with LXDE?
I want to shutdown with the menu, but also I want to know a command in order to shutdown until I get what I've questioned.
Thanks everybody!
I created a sort of menu with zenity:
#!/bin/bash
action="$(zenity --list --column="" --column="action" --radiolist --title="list" FALSE Standby TRUE Shutdown FAlSE Reboot)"
case "$action" in
Shutdown) sudo shutdown now -h ;;
Standby) sudo standby.sh ;;
Reboot) sudo shutdown now -r ;;
*) [ $? -eq 0 ] && notify-send "Error" "cannot $action" ;;
esac
I bound the menu to Windows+q
Offline
If you wanted a login manager as well gdm, will give you the restart and shutdown options from lxpanel.
Offline
From ~/.config/openbox/lxde-rc.xml that you posted:
<!-- default menu file (or custom one in $HOME/.config/openbox/) --> <file>/usr/share/lxde/openbox/menu.xml</file>
Undo all changes that you've made (remove everything that you added to /usr/share/lxde/openbox/menu.xml and to ~/.config/openbox/lxde-rc.xml).
Copy /usr/share/lxde/openbox/menu.xml to ~/.config/openbox/menu.xml
Add the item tags that I posted to ~/.config/openbox/menu.xml]
Change<file>/usr/share/lxde/openbox/menu.xml</file>
in ~/.config/openbox/lxde-rc.xml
to<file>menu.xml</file>
or, if that doesn't work, to
<file>/home/<username>/.config/openbox/menu.xml</file>
If you want them to appear among the menu applications, place them in between these tags:
<menu id="apps-menu" label="Applications"> </menu>
As thayer mentioned, there's more information in the wiki about configuring openbox, including applications that can help edit the menu.
Here's the openbox menu documentation on the openbox website: http://icculus.org/openbox/index.php/Help:Menus
It works fine now, also it works fine before I do that you say. Now, i hope that in future updates I won't lose my configuration. Thanks.
If I add the item to menu applications, the options appear in the menu applications but also in right button from the Desktop, not in the menu of the taskbar. But it's ok.
I created a sort of menu with zenity:
#!/bin/bash action="$(zenity --list --column="" --column="action" --radiolist --title="list" FALSE Standby TRUE Shutdown FAlSE Reboot)" case "$action" in Shutdown) sudo shutdown now -h ;; Standby) sudo standby.sh ;; Reboot) sudo shutdown now -r ;; *) [ $? -eq 0 ] && notify-send "Error" "cannot $action" ;; esac
I bound the menu to Windows+q
Use zenity requires install dependecies of gnome, and I try not to install any dependecies.
tesjo wrote:If you wanted a login manager as well gdm, will give you the restart and shutdown options from lxpanel.
It's the same, I don't want install gnome dependecies. In fact I prefer an autologin that uses a login manager. Thanks for the info.
Thanks everybody.
Offline
If you use Hal see https://wiki.kubuntu.org/DebuggingGNOME … 20to%20HAL, you can use:
$ dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
or, why not $ lxsession-logout ?
Offline
halcor
Updates will not change anything in your home directory, so you will not lose any changes (but you would lose changes in /etc).
Check the openbox menu documentation (and maybe lxde documentation) to learn how to customize the menu further.
If you consider the problem solved, please add [Solved] to your original post title.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hello
When installing Openbox which is a part of what is installed to get LXDE working the user must do that.
$ mkdir -p ~/.config/openbox/
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml
Edit: forgot to say that these commands must be run as regular user and not root.
Then if you want to modify the menu entry you would have to modify the menu.xml in the /config/openbox/menu.xml
I believe if this would be done it would be possible to modify the menu. I would have to try it once I get home.
Last edited by phil90 (2008-09-19 17:33:18)
Offline
I've investigated about LXDE and Openbox.
The menu of LXDE is given by a subprogram called LXPANEL.
Lxpanel generate the taskbar, and the menu is a plugin of the panel (or taskbar).
So I was looking in files of configuration and in: /home/halcor/.config/lxpanel/LXDE/panels/panel
there is a file which has these: (Black letter are interesting)
# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.
Global {
edge=bottom
allign=left
margin=0
widthtype=percent
width=100
height=26
transparent=0
tintcolor=#000000
alpha=0
setdocktype=1
setpartialstrut=1
usefontcolor=1
fontcolor=#ffffff
background=1
backgroundfile=/usr/share/lxpanel/images/background.png
}
Plugin {
type = space
Config {
Size=2
}
}
[b]Plugin {
type = menu
Config {
image=/usr/share/lxpanel/images/my-computer.png
system {
}
separator {
}
item {
command=run
}
separator {
}
item {
image=gnome-logout
command=logout
}
}
}[/b]
Plugin {
type = launchbar
Config {
Button {
id=pcmanfm.desktop
}
Button {
id=sakura.desktop
}
}
}
Plugin {
type = space
Config {
Size=4
}
}
Plugin {
type = wincmd
Config {
Button1=iconify
Button2=shade
}
}
Plugin {
type = space
Config {
Size=4
}
}
Plugin {
type = space
Config {
Size=4
}
}
Plugin {
type = taskbar
expand=1
Config {
tooltips=1
IconsOnly=0
AcceptSkipPager=1
ShowIconified=1
ShowMapped=1
ShowAllDesks=0
UseMouseWheel=1
UseUrgencyHint=1
FlatButton=0
MaxTaskWidth=120
spacing=1
}
}
Plugin {
type = cpu
}
Plugin {
type = tray
}
Plugin {
type = dclock
Config {
ClockFmt=%R
TooltipFmt=%A %x
BoldFont=0
}
}
So I trr to create a new option:
Plugin {
type = menu
Config {
image=/usr/share/lxpanel/images/my-computer.png
system {
}
separator {
}
item {
command=run
}
separator {
}
item {
image=gnome-logout
command=logout
}
[b]item {
image=gnome-logout
command=sudo poweroff
}[/b]
}
}
And linux create a copy of security (, but I didn't do!!) in /home/halcor/.config/lxpanel/default/panels/panel
Also I created the same item in default folder.
Then a new option appear in my menu but there is only an image. A new hole with the same image than logout, but without title.
When I press it, the computer didn't do anything. I don't know where is the problem. ¿¿Somebody can help me??
Offline
I don't know any command Sudo poweroff.
I believe it should be sudo shutdown -h now
I use Shutdown -h now everyday.
Offline
Solutionated.
I've got a trouble mounting usb devices (flahs memories). I've got hal and dbus in rc.conf as daemons. I quit dbus, and I agrre some rules (to flahs memories) like says the wiki. And....
Now I can poweroff the computer from lxpanel.
Thanks to everybody!
Offline
I don't know any command Sudo poweroff.
I believe it should be sudo shutdown -h now
I use Shutdown -h now everyday.
Here's some information concerning poweroff vs shutdown -h and reboot vs shutdown -r
http://www.linuxtopia.org/online_books/ … -down.html
http://forums.fedoraforum.org/showthread.php?t=64462
Check the poweroff and reboot man pages too.
I asked if it was more correct to use one instead of the other in another thread and there was no clear answer. Here's one perspective on it though that I found on google:
http://aplawrence.com/Linux/halt_shutdown_reboot.html
The way it currently works, poweroff will call shutdown -h when the system is running normally and also make sure that the system powers off. It seems to be the best way to do it. If you know of a reason why "shutdown -h now" is better, let me know.
Last edited by Xyne (2008-09-20 00:17:18)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Well I don't know if any is better than the other I just always have been using the shutdown -h . I did not even know about the poweroff never needed to since I was getting what I Was looking for. I will have to read this information tought.
Thanks for letting me know about this. That's exaclty what I was looking for learning new things.
Last edited by phil90 (2008-09-20 00:29:08)
Offline
Keep it Simple, Sexy
Offline
Keep it simple, just add yourself to the 'power' group.
1. Make sure hal is in your rc.conf daemons line
2. As root, run gpasswd -a username power
That's it!
When you click logout, you will now have the options of Shutdown, Reboot, Suspend, Hibernate, and Logout.
See this link: http://wiki.archlinux.org/index.php/LXD … _from_LXDE
Bob
Last edited by Hrod beraht (2008-09-30 23:37:03)
Offline
Pages: 1