You are not logged in.

#1 2008-08-25 14:09:08

greenfuse
Member
Registered: 2008-02-14
Posts: 57

logout of compiz standalone session

I am using compiz as a stand-alone window manager, with lxpanel. The logout command does not work from the lxpanel menu (it wants to be in a lxde session). Does anybody know a command which will provide graceful way of logging out of a session, back to the login manager (gdm). Or perhaps an applet which can be used to provide logout/shutdown/reboot instructions.

Ctrl-Alt-Backspace just feels a bit crude.

Offline

#2 2008-08-25 14:25:28

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: logout of compiz standalone session

It depends entirely on how you're starting the session -- basically you have to kill the program that keeps the X session alive.  In my case it's something like: killall -SIGTERM fusion-icon.

Offline

#3 2008-08-25 14:45:37

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: logout of compiz standalone session

Install compiz-fusion, and use the logout applet/addon/module/thingy


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2008-08-25 14:46:15

greenfuse
Member
Registered: 2008-02-14
Posts: 57

Re: logout of compiz standalone session

Thanks fwojciec you have led me to a solution.

Killing fusion-icon on its own just made the icon disappear from the panel tray. I found that I needed to kill my session startup script.

Offline

#5 2008-08-25 14:52:08

greenfuse
Member
Registered: 2008-02-14
Posts: 57

Re: logout of compiz standalone session

Thanks for the advice Mr.Elendig. I have tried to enable the login/logout effect in the settings manager - is that the thingy you mean? It does not appear to do anything.

Offline

#6 2008-08-25 17:50:21

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: logout of compiz standalone session

greenfuse wrote:

the login/logout effect in the settings manager

My guess is that it only works when used with a login manager like GDM.

Offline

#7 2010-06-29 08:22:37

bhante
Member
Registered: 2008-05-20
Posts: 22

Re: logout of compiz standalone session

I am using this code : Stolen & Modified
The Credit  goes to the original author of ob-logout

#!/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

    def onkeypress(self, widget, event):
        if event.keyval == gtk.keysyms.Escape:
            gtk.main_quit()
            return False

    def lost_focus(self, widget, event):
        if self.focus_check:
            gtk.main_quit()
            return False


    # Logout
    def logout(self, widget):
        os.system("skill -TERM $DESKTOP_SESSION")

    # Reboot
    def reboot(self, widget):
        os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")

    # Shutdown
    def shutdown(self, widget):
        os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")


    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_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_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_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_border_width(10)
        self.button4.connect("clicked", self.shutdown)
        self.box1.pack_start(self.button4, True, True, 0)
        self.button4.show()


        self.focus_check = True
        self.window.connect("focus-out-event", self.lost_focus)
    self.window.connect("key-press-event", self.onkeypress)

        self.box1.show()
        self.window.show()

def main():
    gtk.main()

if __name__ == "__main__":
    gogogo = DoTheLogOut()
    main()

Name the script as  wm-logout and run

note:
if not running as expected

echo $DESKTOP_SESSION
compiz

if compiz is not the output  modify the script : replace DESKTOP_SESSION as compiz and save

Last edited by bhante (2010-06-29 08:27:41)

Offline

#8 2010-06-29 14:22:58

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: logout of compiz standalone session

Since it's 2 years since op had the question, I suspect that he has found some solution already.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#9 2011-05-04 01:11:29

koepked
Member
Registered: 2011-05-04
Posts: 1

Re: logout of compiz standalone session

The OP probably found a solution, but I hadn't. Thanks bhante.

Last edited by koepked (2011-05-04 01:12:24)

Offline

Board footer

Powered by FluxBB