You are not logged in.
I updated the logout script to include a suspend option and to have shortcut keys in case you dont want to use the mouse. The shortcut keys are alt + the underlined letter. Here it is if you want to use it:
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import os
class DoTheLogOut:
# Cancel/exit
def delete_event(self, widget, event, data=None):
gtk.main_quit()
return False
# Logout
def logout(self, widget):
os.system("openbox --exit")
# Reboot
def reboot(self, widget):
os.system("gdm-control --reboot && openbox --exit")
# Shutdown
def shutdown(self, widget):
os.system("gdm-control --shutdown && openbox --exit")
# Suspend
def suspend(self, widget):
os.system("gdm-control --suspend")
def __init__(self):
# Create a new window
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("Exit? Choose an option:")
self.window.set_resizable(False)
self.window.set_position(1)
self.window.connect("delete_event", self.delete_event)
self.window.set_border_width(20)
# Create a box to pack widgets into
self.box1 = gtk.HBox(False, 0)
self.window.add(self.box1)
# Create cancel button
self.button1 = gtk.Button("_Cancel")
self.button1.set_use_underline(True)
self.button1.set_border_width(10)
self.button1.connect("clicked", self.delete_event, "Changed me mind :)")
self.box1.pack_start(self.button1, True, True, 0)
self.button1.show()
# Create logout button
self.button2 = gtk.Button("_Log out")
self.button2.set_use_underline(True)
self.button2.set_border_width(10)
self.button2.connect("clicked", self.logout)
self.box1.pack_start(self.button2, True, True, 0)
self.button2.show()
# Create reboot button
self.button3 = gtk.Button("_Reboot")
self.button3.set_use_underline(True)
self.button3.set_border_width(10)
self.button3.connect("clicked", self.reboot)
self.box1.pack_start(self.button3, True, True, 0)
self.button3.show()
# Create shutdown button
self.button4 = gtk.Button("_Shutdown")
self.button4.set_use_underline(True)
self.button4.set_border_width(10)
self.button4.connect("clicked", self.shutdown)
self.box1.pack_start(self.button4, True, True, 0)
self.button4.show()
# Create suspend button
self.button5 = gtk.Button("S_uspend")
self.button5.set_use_underline(True)
self.button5.set_border_width(10)
self.button5.connect("clicked", self.suspend)
self.box1.pack_start(self.button5, True, True, 0)
self.button5.show()
self.box1.show()
self.window.show()
def main():
gtk.main()
if __name__ == "__main__":
gogogo = DoTheLogOut()
main() I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
Hello iggykoopa 
Thank you for taking the time to improve the script, it is really appreciated. I had a crack at it myself, adding suspend and hibernate options; however, for some unknown reason it did not occur to me to add shortcut keys. Doh! Would it be okay by you if I updated my scripts to include similar shortcuts?
P.S. Welcome to the forums, it is good to have you aboard!
Offline
no problem, a user on the wattos forums had requested it so I modified it for him. Figured I'd share it back with you. Thanks for your work on this excellent distro.
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
Nice one, thank you for sharing. I have updated the packages to reflect your changes.
Offline
This is a great collaborative effort
The alt key option is such a nice inclusion.
Offline
Aha this explains the unexpected dependency between the logout script and GDM.
---
I don't like peanuts.
Offline
Hello .. ( sorry for my poor english )
I have similar script to logout .. But I use my wallpaper as background ( screen_width , screen_height ) with nice button
[1440x900] http://www.ad-comp.be/public/openbox/op … esktop.jpg

[1440x900] http://www.ad-comp.be/public/openbox/openbox_logout.jpg

you can find it here : http://www.ad-comp.be/public/projets/my_exit.tar.bz2
Bye ..
David [aka] ADcomp
Offline
That is really nice. The beauty of openbox 
Offline
if you guys want I could change the images to something similar for the existing logout script. I wouldn't be able to set the pseudo-transparent background though.
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
if you guys want I could change the images to something similar for the existing logout script.
I like your script just the way it is 
Offline
@ADcomp, how did you do to put your volume-control on tray ?
Hello .. http://oliwer.net/b/volwheel.html 
depend : libgtk2-perl , libgtk2-trayicon-perl ..
sudo apt-get install libgtk2-perl libgtk2-trayicon-perlJust a little perl script .. I found same in python but volwheel is better
Bye
Last edited by ADcomp (2008-12-23 04:27:47)
David [aka] ADcomp
Offline
for volume control you could look into this http://oliwer.net/b/volwheel.html
edit: lol I was too slow with that one.
Last edited by iggykoopa (2008-12-23 04:33:38)
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
Really impressed with ADComp's logout script.
I created a bash script to wrap around it and imagemagick.
This script snaps the current screen and blurs it, like the GDM logout does.
You could tweak the options in ImageMagick to get just the right effect aswell.
I used scrot for the actual snapshot because I wasn't going to use IM at all at first until I realised I could do with a blur. I'm too tired right now to bother looking up the syntax for screenshots within IM, so, this script will have to remain hackish by using two separate imaging tools.
You might like to remove the convert line for speed, as on my machine at least it's rather slow (a full six (6)! seconds before logout menu is displayed).
I would like to hack this further to support Hibernate and Suspend, too.
#!/bin/sh
scrot -q 50 /home/chris/Junk/my_exit/img/bg.jpg
convert /home/chris/Junk/my_exit/img/bg.jpg -blur 0x3 /home/chris/Junk/my_exit/img/bg.jpg
cd /home/chris/Junk/my_exit
./my_exit.pyLast edited by cdn (2009-01-10 08:45:43)
Offline
here's a copy of the my_exit.py that's been patched to do the same thing http://www.crunchbanglinux.org/pastebin/73 . Hopefully it'll run a little faster for you since it doesn't use any external commands to take the screenshot and do the blur. If you can get me some icons you want to use for the suspend and hibernate I can add that in, but I'm not very graphically inclined.
edit: the only problem I had with it is the method I used to blur it isn't very configurable, so if you don't like the blur effect it gives it I may have to look into another method.
edit again: if it still runs too slow for you change line 56 to
for i in range(1):the blur won't look as nice but it will run a lot faster.
Last edited by iggykoopa (2009-01-11 04:54:43)
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
Offline
Hello .. nice work 
If you just want somethink like gnome/gdm logout ( gray ? ) , replace line 56-57
for i in range(2):
image = image.filter(ImageFilter.BLUR)here you can modify color ( black , red , blue , green or #333333 ...) and alpha ( 0 --> 1 )
color = 'black'
alpha = 0.5
mask = Image.new("RGB", image.size, color)
image = Image.blend(image, mask, alpha)Bye ..
Last edited by ADcomp (2009-01-11 15:25:35)
David [aka] ADcomp
Offline
Hello ..
Add hibernate / suspend button ( but no command ) and blend image with color .. clean little bit code too 
I'm working on panel configuration ( like adeskbar ) ..
Code : http://www.ad-comp.be/public/projets/My … it.tar.bz2
Screenshot : http://www.ad-comp.be/public/projets/My … it_new.jpg

Bye ..
> Edit [1] : icon from Oxygen icon pack ( kde )
> Edit [2] : I don't know command for hibernate/suspend but I think you can find useful info looking for gnome-power-manager and acpi
http://live.gnome.org/GnomePowerManager/FAQ
http://manpages.ubuntu.com/manpages/har … onf.5.html
https://help.ubuntu.com/community/SuspendHowto
Last edited by ADcomp (2009-01-11 19:05:26)
David [aka] ADcomp
Offline
the code for suspend and hibernate is in the openbox-logout-script I don't have a copy right now cause I'm running the netbook remix. If I get ahold of it I can add it in, or if you have it it's there.
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
# Hibernate
def hibernate(self, widget):
os.system("(sleep 1s && gnome-power-cmd.sh hibernate) && killall python /usr/bin/openbox-logout")
# Suspend
def suspend(self, widget):
os.system("(sleep 1s && gnome-power-cmd.sh suspend) && killall python /usr/bin/openbox-logout")Offline
Can we get this code in a bzr repo? I'd like to make the script have a bit more detection (like checking the device can suspend/resume), also it would be nice to switch between graphical and button mode 
Maybe its a idea to start working on a few project in house, instead of the mishmash of code and hacks we're getting at the moment. Maybe some #! packages of our own for the extra stuff we need.
Last edited by Nik_Doof (2009-01-11 18:55:29)
Offline
added suspend and hibernate now here http://www.crunchbanglinux.org/pastebin/74 . I know suspend works but not sure on hibernate since I don't have a big enough swap right now on my mini.
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
@ iggykoopa .. I have a question. Why do you use kill ?
pid = os.getpid()
os.system("(sleep 1s && gnome-power-cmd.sh suspend) && kill " + str(pid))This doesn't work ?
os.system("(sleep 1s && gnome-power-cmd.sh suspend) &")
self.doquit()Can we get this code in a bzr repo? I'd like to make the script have a bit more detection (like checking the device can suspend/resume), also it would be nice to switch between graphical and button mode
no repo yet (.. at least for me ). maybe I can create one on launchpad if you want .. wait & see
Bye 
David [aka] ADcomp
Offline
I was just using it because the original script did. I can test if it works without it.
I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.