From: Dana Jansens Date: Tue, 8 Dec 2009 20:18:57 +0000 (-0500) Subject: Make openbox-gnome-session work with gnome-session > 2.22 X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=4e0a4fb53b859d818a4184564a441fce29c12be0;p=chaz%2Fopenbox Make openbox-gnome-session work with gnome-session > 2.22 --- diff --git a/data/xsession/openbox-gnome-session.in b/data/xsession/openbox-gnome-session.in index 278ac6a8..d93bab0c 100644 --- a/data/xsession/openbox-gnome-session.in +++ b/data/xsession/openbox-gnome-session.in @@ -7,6 +7,27 @@ if test -n "$1"; then exit fi +VER=$(gnome-session --version 2>/dev/null | \ + sed -e 's/[^0-9.]*\([0-9.]\+\)/\1/') + +MAJOR=$(echo $VER | cut -d . -f 1) +MINOR=$(echo $VER | cut -d . -f 2) + # Run GNOME with Openbox as its window manager export WINDOW_MANAGER="@bindir@/openbox" -exec gnome-session --choose-session=openbox-session "$@" + +if test $MAJOR -lt 2 || (test $MAJOR = 2 && test $MINOR -le 22); then + # old gnome-session allows multiple sessions to be saved + exec gnome-session --choose-session=openbox-session "$@" +else + # make sure the gnome-wm script is being used + gconftool-2 -t string \ + -s /desktop/gnome/session/required_components/windowmanager "gnome-wm" \ + 2> /dev/null + + # new gnome-session does not allow multiple sessions + exec gnome-session "$@" +fi + + +