You are not logged in.
better late than never....
had a similar problem and solved it, as Awebb suggested by:
Had to edit /etc/oblogout.conf and change "usehal" to "false" to get it to work.
But otherwise great package
found it on
https://bbs.archlinux.org/viewtopic.php … 34#p806234
M
Offline
i got really pissed because i couldn't find what i was looking for so i rearranged the code, now everything is in 1 file
but still i have that weird image spin
#! /usr/bin/python
try:
import os
import sys
import ConfigParser
import StringIO
import logging
import gettext
import string
import gtk
import cairo
import pygtk
pygtk.require('2.0')
from PIL import Image, ImageFilter
except:
sys.exit()
class OpenboxLogout():
kill_me = "kill `ps -ef | grep /usr/bin/oblogout-2 | grep -v grep | awk '{print $2}'` && "
cmd_shutdown = kill_me + "dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop"
cmd_restart = kill_me + "dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart"
cmd_suspend = kill_me + "dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend"
cmd_hibernate = kill_me + "dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate"
cmd_logout = kill_me + "openbox --exit"
def __init__(self):
# Load configuration file
self.opacity = 50
self.bgcolor = gtk.gdk.color_parse("black")
blist = "suspend, logout, restart, shutdown"
self.shortcut_keys = [('cancel', 'Escape'), ('suspend', 'S')]
self.img_path = "/usr/share/themes/ob-logout/foom"
self.button_list = map(lambda button: string.strip(button), blist.split(","))
gettext.install('oblogout', 'usr/share/locale', unicode=1)
# Start the window
self.__init_window()
def __init_window(self):
# Start pyGTK setup
self.window = gtk.Window()
self.window.connect("destroy", self.quit)
self.window.connect("key-press-event", self.on_keypress)
self.window.connect("window-state-event", self.on_window_state_change)
if not self.window.is_composited():
# Window isn't composited, enable rendered effects
self.rendered_effects = True
else:
# Link in Cairo rendering events
self.window.connect('expose-event', self.on_expose)
self.window.connect('screen-changed', self.on_screen_changed)
self.on_screen_changed(self.window)
self.rendered_effects = False
self.window.set_size_request(620,200)
self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
self.window.set_decorated(False)
self.window.set_position(gtk.WIN_POS_CENTER)
# Create the main panel box
self.mainpanel = gtk.HBox()
# Create the button box
self.buttonpanel = gtk.HButtonBox()
self.buttonpanel.set_spacing(10)
# Pack in the button box into the panel box, with two padder boxes
self.mainpanel.pack_start(gtk.VBox())
self.mainpanel.pack_start(self.buttonpanel, False, False)
self.mainpanel.pack_start(gtk.VBox())
# Add the main panel to the window
self.window.add(self.mainpanel)
for button in self.button_list:
self.__add_button(button, self.buttonpanel)
if self.rendered_effects == True:
w = gtk.gdk.get_default_root_window()
sz = w.get_size()
pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])
pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])
# Convert Pixbuf to PIL Image
wh = (pb.get_width(),pb.get_height())
pilimg = Image.fromstring("RGB", wh, pb.get_pixels())
pilimg = pilimg.point(lambda p: (p * self.opacity) / 255 )
# "Convert" the PIL to Pixbuf via PixbufLoader
buf = StringIO.StringIO()
pilimg.save(buf, "ppm")
del pilimg
loader = gtk.gdk.PixbufLoader("pnm")
loader.write(buf.getvalue())
pixbuf = loader.get_pixbuf()
# Cleanup IO
buf.close()
loader.close()
pixmap, mask = pixbuf.render_pixmap_and_mask()
# width, height = pixmap.get_size()
else:
pixmap = None
self.window.set_app_paintable(True)
self.window.resize(gtk.gdk.screen_width(), gtk.gdk.screen_height())
self.window.realize()
if pixmap:
self.window.window.set_back_pixmap(pixmap, False)
self.window.move(0,0)
def on_expose(self, widget, event):
cr = widget.window.cairo_create()
if self.supports_alpha == True:
cr.set_source_rgba(1.0, 1.0, 1.0, 0.0) # Transparent
else:
cr.set_source_rgb(1.0, 1.0, 1.0) # Opaque white
# Draw the background
cr.set_operator(cairo.OPERATOR_SOURCE)
cr.paint()
(width, height) = widget.get_size()
cr.set_source_rgba(self.bgcolor.red, self.bgcolor.green, self.bgcolor.blue, float(self.opacity)/100)
cr.rectangle(0, 0, width, height)
cr.fill()
cr.stroke()
return False
def on_screen_changed(self, widget, old_screen=None):
# To check if the display supports alpha channels, get the colormap
screen = widget.get_screen()
colormap = screen.get_rgba_colormap()
if colormap == None:
colormap = screen.get_rgb_colormap()
self.supports_alpha = False
else:
self.supports_alpha = True
# Now we have a colormap appropriate for the screen, use it
widget.set_colormap(colormap)
def on_window_state_change(self, widget, event, *args):
if event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN:
self.window_in_fullscreen = True
else:
self.window_in_fullscreen = False
def __add_button(self, name, widget):
""" Add a button to the panel """
box = gtk.VBox()
image = gtk.Image()
if os.path.exists("%s/%s.svg" % (self.img_path, name)):
image.set_from_file("%s/%s.svg" % (self.img_path, name))
else:
image.set_from_file("%s/%s.png" % (self.img_path, name))
image.show()
button = gtk.Button()
button.set_relief(gtk.RELIEF_NONE)
button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
button.set_focus_on_click(False)
button.set_border_width(0)
button.set_property('can-focus', False)
button.add(image)
button.show()
box.pack_start(button, False, False)
button.connect("clicked", self.click_button, name)
label = gtk.Label(_(name))
label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
box.pack_end(label, False, False)
widget.pack_start(box, False, False)
def click_button(self, widget, data=None):
if (data == 'logout'):
os.system(self.cmd_logout)
elif (data == 'restart'):
os.system(self.cmd_restart)
elif (data == 'shutdown'):
os.system(self.cmd_shutdown)
elif (data == 'suspend'):
os.system(self.cmd_suspend)
elif (data == 'hibernate'):
os.system(self.cmd_hibernate)
gtk.main_quit()
def on_keypress(self, widget=None, event=None, data=None):
for key in self.shortcut_keys:
if event.keyval == gtk.gdk.keyval_to_lower(gtk.gdk.keyval_from_name(key[1])):
self.click_button(widget, key[0])
def quit(self, widget=None, data=None):
gtk.main_quit()
def run_logout(self):
self.window.show_all()
gtk.main()
class Usage(Exception):
def __init__(self, msg):
self.msg = msg
def main(argv = sys.argv):
# Start the application
app = OpenboxLogout()
app.run_logout()
return 0
if __name__ == "__main__":
sys.exit(main())Last edited by ali (2011-02-28 20:01:53)
Offline
i got really pissed because i couldn't find what i was looking for so i rearranged the code, now everything is in 1 file
but still i have that weird image spin
Maybe i don't quite understand, what you mean by "image spin" - but if you just want that coloured icons, you posted in that other thread, change "/usr/share/themes/ob-logout/foom" to "/usr/share/themes/ob-logout/oxygen".
Offline
look at the background in my picture
Offline
look at the background in my picture
Aah, thanks - now it's clear. Honestly, i've never seen that before nor experienced myself... 
Offline
Is this script still being developed? If not does this still work in Statler?
/cheers
Update:
Ok I installed the .deb and if I run oblogout in a terminal all is working.
What else do I need to do so I can use it from the menu?
Update: Solved!
Last edited by Pagoda (2011-03-04 05:58:31)
Offline
ali wrote:look at the background in my picture
Aah, thanks - now it's clear. Honestly, i've never seen that before nor experienced myself...
Same issue here:
How to fix it?
Offline
I think you need to have compositing on. Do you have it off?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github || Deviantart
Offline
No, I didn't have it on, turning it on fixed the issue.
Thanks a lot.
Offline
Is there any way when in dual monitors to have it center on one monitor instead of centered between both?
Offline
^ I think that may have something to do with tint2 and strut policies.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
^ I think that may have something to do with tint2 and strut policies.
What do you mean? I need to center it on one monitor, not across both.

Last edited by shauder (2012-01-02 21:56:49)
Offline
Oh, that's different than the issues we've had with tint2 and application window placement in the past. I'm not sure how you'd fix this particular issue; I don't know the code for OBLogout & don't use it. You may be able to set an application rule for it in rc.xml, specifying it starts on the first monitor.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
Yeah I am not sure either, I tried editing some of the python code and rebuilding it but I had no luck =/
Offline
Yeah I am not sure either, I tried editing some of the python code and rebuilding it but I had no luck =/
Offline
Try adding this to the applications section in rc.xml:
<application name="oblogout">
<position>
<x>center</x>
<y>center</y>
<monitor>1</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>
</application>Not sure about the application name because, as I said, I don't use OBLogout. Probably best to put this right above
</applications>
</openbox_config>at the end of rc.xml.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
Try adding this to the applications section in rc.xml:
<application name="oblogout"> <position> <x>center</x> <y>center</y> <monitor>1</monitor> # specifies the monitor in a xinerama setup. # 1 is the first head, or 'mouse' for wherever the mouse is </position> </application>Not sure about the application name because, as I said, I don't use OBLogout. Probably best to put this right above
</applications> </openbox_config>at the end of rc.xml.
TY for taking the time to help, I was able to accomplish what I wanted to do by using this,
<application name="oblogout">
<position>
<x>left</x>
<y>center</y>
<monitor>0</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>
</application>Offline
I've just downloaded oblogout_0.2-1-0ubuntu2_all.deb and installed using Gdebi.
I tried to find the README file that is referred to in the early posts ..... not sure I'm looking in the right place.
When I go to log out I'm still getting the original logout dialogue and oblogout does not appear to work as shown in the screenshots.
What am I doing wrong ..... I'm guessing it is something to do Statler now using cb-exit rather than openbox-logout??
SORTED ..... just replaced cb-exit in menu with oblogout
Last edited by madwoollything (2012-03-17 14:40:10)
Offline
I've just been playing around with Madbox 12.04 and have been configuring the openbox menu.
One thing which has me baffled is how to launch the logout script in Madbox.
(The LXDE menu is not simple to understand or I would just copy the command from the existing LXDE menu).
I've tried oblogout which does not work. I then used /usr/share/oblogout and that gives me a permissions error unless I'm root.
How do you set up a command in the menu that will launch oblogout for an ordinary user?
(I don't want to just change the permissions on the oblogout script as this seems to be not he best solution)
Anyone any ideas what I could try?
ANSWER: /usr/share/oblogout/oblogout
Last edited by madwoollything (2012-10-30 12:36:44)
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.