You are not logged in.
Somehow we are at the new stage hal deprecated and its changes is not easy for newbies to follows. also changing sudoers is a dirty and not safe trick So:
The need for zenity script with these feature:
@ Consolekit +dbus
@Logout
@shoutdown
@restart
@suspend { should we add resume to rc.conf daemons arry? if yes where? at the end?}
@my be cancel
is really being felt.
So if someone how is able to change the old zentiy openbox script comes forward and do the job; we are all appreciating.
Last edited by krax (2011-08-20 01:29:30)
Offline
hi,
aphelion, a friend of mine, did a shutdown script using zenity with all those features. the script is used in his debian-based livecd: Aphelive with awesome as window-manager.
here is the script (fr)... just need little edit for using in openbox:
#!/bin/sh
ACTION=`zenity --width=90 --height=255 --list --radiolist --text="Selectionner une action" --title="Logout" --column "Choice" --column "Action" TRUE Eteindre FALSE Redemarrer FALSE Suspendre FALSE Hiberner FALSE Verrouiller FALSE Deconnecter`
if [ -n "${ACTION}" ];then
case $ACTION in
Eteindre)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
;;
Redemarrer)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
;;
Verrouiller)
xscreensaver-command -lock
;;
Suspendre)
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
;;
Hiberner)
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
;;
Deconnecter)
echo "awesome.quit()" | awesome-client
;;
esac
fiand what it looks like:
hope you could adapt it to your session ![]()
sources: https://github.com/Aphelion/Aphelive
[arpinux.org] - [livarp distro] - [arp'wiki] - [devart page]
Offline
Translation and adapted for openbox:
#!/bin/sh
ACTION=`zenity --width=90 --height=255 --list --radiolist --text="Choose" --title="Logout" --column "Choice" --column "Action" TRUE Exit FALSE Reboot FALSE Suspendre FALSE Hibernate FALSE Lock FALSE Disconnect`
if [ -n "${ACTION}" ];then
case $ACTION in
Exit)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
;;
Restart)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
;;
Lock)
xscreensaver-command -lock
;;
Suspend)
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
;;
Hibernate)
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
;;
Logout)
echo "openbox --exit"
;;
esac
fiNot tested yet.
Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/
Offline
I've still not figured out how to use keyboard shortcuts with "zenity". Is it possible at all, as with "gxmessage"?
gxmessage "Sure you want to quit?" -center -title "== Quit Session =="\
-default "Cancel" -buttons "_Cancel:100,_Reboot:101,_Shutdown:102"
case $? in
100)
;;
101)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart ;;
102)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop ;;
esacHere you might use the mouse or the Alt-c, Alt-r or Alt-s key. I'm trying more and more to switch using the keyboard shortcuts since the mouse starts causing me a tennis elbow ;-))
But in "openbox" there's "oblogout". What's wrong with that?
Offline
I think keychaining should also work in "openbox". These are the "Quit" keychains that I have in "fluxbox" now:
Mod4 Q Mod4 L :Exit
Mod4 Q Mod4 R :Exec dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Mod4 Q Mod4 S :Exec dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.StopIt's just holding the "Super" key and typing "ql" for "logout", "qr" for "reboot" and "qs" for "shutdown"...
Offline