Xfce:
cairo-menu has the DBus interface address for the Xfce session manager, in gnome-menu-builder.c.
GNOME:
If the DBus interface for GNOME's session manager isn't found, check for the environment variable GNOME_DESKTOP_SESSION_ID. If that's found and gnome-session-save exists in the PATH, use that.
I can tell you exactly how to detect it, but I won't code it myself.
KDE: www.purinchu. net/wp/ 2009/06/ 12/oh-fun/ for the KDE session manager logout behavior.
See http://
Xfce: builder. c.
cairo-menu has the DBus interface address for the Xfce session manager, in gnome-menu-
GNOME: SESSION_ ID. If that's found and gnome-session-save exists in the PATH, use that.
If the DBus interface for GNOME's session manager isn't found, check for the environment variable GNOME_DESKTOP_