SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
while it is no problem for me, the rest of the family finds that having to open a terminal and remember to type su - and then do halt to do shutdown really annoys them
can i get it so that when i select logoff from the menu i get an option to shutdown/reboot (as user)
Originally posted by TheOneAndOnlySM while it is no problem for me, the rest of the family finds that having to open a terminal and remember to type su - and then do halt to do shutdown really annoys them
can i get it so that when i select logoff from the menu i get an option to shutdown/reboot (as user)
i boot into runlevel 4 so this should be do-able
I make the robust assumption that you are using Gnome when I ask you to check
I tried both (Slack 9.1 w/Gnome 2.4.0) to the extent that the options for the appearance of the shutdown/reboot options do seem to exist (although I did not actually TRY them as I boot into a text login...I'll leave it up to you to try the suggestions in those posts).
Well - I have never used X to shutdown my system. But I have setup "sudo" to allow some regular users to shutdown or reboot the system.
%loginloc roadwarrior = NOPASSWD: /sbin/reboot,/sbin/shutdown -h now
I added the above line to my sudoers file in /etc/, it allows any member of the loginloc (local login) group to run the commands /sbin/shutdown and reboot with not needing the root password on the machine called roadwarrior.
ok, the systemmenu=true thing worked, but i now need to log out and then from there click system and shutdown
here's something bad i did
i logged in as root with gui and when i click logout from there, i actually right there get a dialog asking to logout, reboot, or shutdown
id really like to see the answer to that, ive been searching here for quite a while, and i keep seeing people say gdm.
the quick answer for slack is to get dropline, by default it lets users logout the way mentioned above, and also gives the x sudo thing, where if you try to run something that can only be run by root in x (like gdmconfig) it pops up a prompt for password.
im now using arch, and would like to know how to enable both of those things
First, make sure you have sudo installed. IF you do, as root:
# visudo
and add the line:
username ALL=NOPASSWD: /sbin/shutdown -h now, /sbin/shutdown -r now
at the bottom near the examples. Substitute username with your normal user's name (duh!).
Now, make sure you have the program xdialog (do a google for it and install if necessary). Xdialog allows you to make a nifty little GUI for any bash script you could write. I have made a simple one that mimics the windows style shutdown/restart menu. make a file in your $HOME dir called shtdwn.sh (or whatever) and put this in it:
Code:
#!/bin/sh
DIALOG=Xdialog
$DIALOG --title "SHUTDOWN" \
--radiolist "choose:" 0 0 3\
"-h" "Shutdown" off \
"-r" "Restart" on 2>/tmp/checklist.tmp.$$
retval=$?
choice=`cat /tmp/checklist.tmp.$$`
rm -f /tmp/checklist.tmp.$$
case $retval in
0)
sudo /sbin/shutdown $choice now ;;
1)
echo "Cancel pressed.";;
255)
echo "Box closed.";;
esac
now, chmod the shtdwn.sh file:
chmod 777 shtdwn.sh
Now test it. In your $HOME dir as your normal user you should be able to:
./shtdwn.sh
and a little box will popup and ask if you want to shutdown or restart. pick one and hit OK. Your system should shutdown or reboot depending on your choice.
Now, just add a shortcut/icon on your desktop or a menu item that points to the shtdwn.sh script, and voila! instant GUI shutdown.
DUDE!! awesome, i can tell you put your fair share of time into that post, im deffinitely going to try that soon as im not studying for a forign language final.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.