I found this on the net, but shamefully cannot remember where...
So, I'm
not claiming originallity for it, and appologise to the original author!:
----------------------------------------
Making poweroff and reboot buttons
In Slackware when we want to power-off we need to give the command shutdown -h now as root in a terminal. (Because there is no entry for shutdown in the menu)
We can make a power-off button, but it needs some work, here is how to do that:
Edit the sudoers file, as root, with vi.
There is a special command to open the sudoers file in vi though - NOT vi sudoes, but:
This will open the file in vi so press i to put vi in insert mode and paste the next line at the end of the file:
Code:
username ALL=(ALL) NOPASSWD: /sbin/shutdown -h now, /sbin/reboot
You need to do this for every user you will allow to reboot and halt.
Then save and close the file:
We now gave bruno sudo permission to give the commands sudo /sbin/reboot and sudo /sbin/halt and we can meke special buttons on the tastbar:
Rightclick on the taskbar and choose
Add | Special Button | Non-KDE application. You will get a little GUI where you can put in the top box (Executable):
Click the icon button to change the icon to the one you like. Click OK and you are ready.
Do the same for:
Every user you did add in the sudoers file will be able to press the buttons and reboot or halt the system.
------------------------------------------------
After that, I made a toolbar short cut to
/sbin/shutdown -h now which works. So, when logged in as a regular user, I can shut the PC off properly without having to log out, login as root & then shutdown.