You are not logged in.
hi
ive just setup slim on my machine to log into openbox on boot. before i used slim, i used to ctrl+alt+backspace to kill X, then ctrl+alt+delete to reboot.
now, slim respawns, i am wondering if i can put a command or script into the openbox menu to reboot/shutdown? i am currently having to open a terminal, login as root, then type a command!
thanks
Last edited by ninjaprawn (2009-01-22 22:16:42)
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline
you can use sudo (with NOPASSWD), and make a openbox menu entry that executes sudo halt.
By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin
Offline
menu.xml
<item label="Exit">
<action name="Exit"/>
</item>
<item label="Reboot">
<action name="Execute">
<prompt>
Are you sure you want to reboot?
</prompt>
<execute>
sudo shutdown -r now
</execute>
</action>
</item>
<item label="Shutdown">
<action name="Execute">
<prompt>
Are you sure you want to shutdown?
</prompt>
<execute>
sudo shutdown -h now
</execute>
</action>
</item>
Offline
thanks!
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline
sorry, but does setting up sudo with no password mean that any time sudo is used, no password is ever required, and that root priveleges are obtained??
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline
ninjaprawn: You're right, I suggest putting the following into you're /etc/sudoers, so that only shutdown/reboot needs no password:
%users localhost=/sbin/shutdown -h now
%users localhost=/sbin/shutdown -r now
Offline
thanks, i was just trying that! can i replace "%users" with my user name?
also, once all is installed and set up, i go to my menu, click reboot, get the yes/no question, then nuthing happens!
menu.xml
<separator />
<item label="Run...">
<action name="Execute">
<command>bashrun</command>
</action>
</item>
<item label="Exit">
<action name="Exit"/>
</item>
<item label="Reboot">
<action name="Execute">
<prompt>
Are you sure you want to reboot?
</prompt>
<execute>
sudo shutdown -r now
</execute>
</action>
</item>
<item label="Shutdown">
<action name="Execute">
<prompt>
Are you sure you want to shutdown?
</prompt>
<execute>
sudo shutdown -h now
</execute>
</action>
</item>
<item label="Log Out">
<action name="SessionLogout">
<prompt>yes</prompt>
</action>
</item>
</menu>
</openbox_menu>
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline
Here's another alternative.
From the slim documentation:
3. Special user names: reboot
You may shutdown, reboot, suspend, exit or even launch a terminal from the SLiM login screen. To do so, enter the appropriate value in the username field, and the root password in the password field:
* To launch a terminal, enter console as the username (defaults to xterm which must be installed separately... edit /etc/slim.conf to change terminal preference)
* For shutdown, enter halt as the username
* For reboot, enter reboot as the username
* For suspend, enter suspend as the username
* To exit to the shell, enter exit as the username
Offline
thanks, i was just trying that! can i replace "%users" with my user name?
%users is the group, of which your username is a part of.
Offline
@jaloz
thanks, but if you read what you wrote, that is to be typed in at the login prompt, so of no use.
@SkonesMickLoud
%users localhost=/sbin/shutdown -h now NOPASSWD
%users localhost=/sbin/shutdown -r now NOPASSWD
with this, nothing happens, so i tried the command in a terminal, and it asks for a password!
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline
solved!!!
%users ArchLinux = NOPASSWD: /sbin/shutdown -h now, /sbin/shutdown -r now
thanks for the advice, i hadnt changed localhost!
2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound
Offline