You are not logged in.
Pages: 1
Topic closed
I`m writing a shutdown script for my awesome wm.
it looks like this
[c!/bin/bash
ACTION=`zenity --width=90 --height=200 --list --radiolist --text="Select logout action" --title="Logout" --column "Choice" --column "Action" TRUE Shutdown FALSE Reboot FALSE LockScreen FALSE Suspend`
if [ -n "${ACTION}" ];then
case $ACTION in
Shutdown)
#zenity --question --text "Are you sure you want to halt?" &&
dbus-send --system --print-reply \
--dest=org.freedesktop.ConsoleKit \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.Stop
;;
Reboot)
#zenity --question --text "Are you sure you want to reboot?" && gksudo reboot
dbus-send --system --print-reply \
--dest=org.freedesktop.ConsoleKit \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.Restart
;;
Suspend)
#gksudo pm-suspend
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
;;
LockScreen)
slock
;;
esac
fiand i makedd it executable with chmod +x. But it sims that she is not working.When i run it as root the script works.And when i run it like user onli suspend semams to working.
Offline
You don't have to use the deprecated hal! Here are my scripts which I use(d). All you need is
exec ck-launch-session awesomein your .xinitrc.
shutdown
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stopreboot
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restarthibernate
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Hibernateand suspend
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.SuspendLast edited by Army (2010-12-25 20:42:09)
Offline
same thing.nothin.but thus time i got an error msg in terminal
Error org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not AuthorizedOffline
https://bbs.archlinux.org/viewtopic.php?pid=820631
Thought this may help
Mr Green
Offline
i tried editing policykit.conf but /etc/PolicyKit/PolicyKit.conf give that /etc/PolicyKit/PolicyKit.conf: No such file or directory
but policykit but policykit is instaled.
Offline
i delited dbus-send --system --print-reply \
--dest=org.freedesktop.ConsoleKit \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.Stop
and putt xterm -e sudo shutdown -h now and this works
Offline
you could gksudo shutdown -h now to avoid the xterm
GitHub | Git Server | Blog
Offline
you could also use systemd for that.
Meh, did not see the date of the Thread …
Last edited by Into the Pit (2012-12-27 09:21:04)
Offline
oops... didn't see that either ![]()
Is there a way to suspend without asking for a pass?
GitHub | Git Server | Blog
Offline
start x properly so you get a proper session https://wiki.archlinux.org/index.php/Ge … ermissions , then just do shutdown -h now . no need for sudo or anything similiar
Offline
ttouch, I am sure in the last 2 years since the last post in this thread, the op figured it out. Infact he mentions it that it works in his last post. Please do not necrobump.
Policy for reference :: https://wiki.archlinux.org/index.php/Fo … Bumping.22
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Pages: 1
Topic closed