Compiz-based desktop

Table of Contents

Configuration
Ending the X session
Customizing Compiz

Ending the X session

by ross at 04:03:22 on October 29, 2012

To close X session you simply need to terminate the initial client which is LXPanel (lxpanelctl exit). All open windows will die which is bad.

Here's my little script to do graceful logout: close-session.sh. In order to use it you will need x11/xvinfo, x11/xprop, x11/wmctrl and security/sudo set up to execute reboot and halt -p without password.

I wrote it for Openbox but it works with Compiz too. Just edit it and uncomment the following line:

EXIT_COMMAND="lxpanelctl exit"

Place the script in /usr/local/bin, chmod it to be executable for everyone and edit ~/.config/lxpanel/default/config:

Logout=close-session.sh

Run in terminal lxpanelctl restart to restart the panel.

You may also want to add Reboot and Shutdown items to Applications menu of LXPanel. Edit ~/.config/lxpanel/default/panels/panel:

Plugin {
    type = menu
    Config {
        image=/share/pictures/freebsd-logo.png
        system {
        }
        separator {
        }
        item {
            command=run
            image=system-run
        }
        separator {
        }
        item {
            command=logout
            image=system-log-out
        }
        item {
            image=gnome-session-halt
            name=Reboot
            action=close-session.sh -r
        }
        item {
            image=gnome-session-halt
            name=Shutdown
            action=close-session.sh -h
        }
    }
}

 

Comments
Great work man! But, why don't you use dbus to shutdown/reboot the system instead of sudo?
i.e.
dbus-send --print-reply --system --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
-- Dola Marco
Tuesday, January 8, 2013, 12:46:05
Well, everyone has sudo installed anyway.

But you are right I should probably switch to dbus to remove an unnecessary dependency.
-- ross
Wednesday, January 9, 2013, 9:16:16