summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2009-12-08 15:18:57 -0500
committerDana Jansens <danakj@orodu.net>2009-12-08 15:52:07 -0500
commit4e0a4fb53b859d818a4184564a441fce29c12be0 (patch)
treee20fef3983be8947cf35b5df705c2947f4a8ece2 /data
parent2d6efece61a752a69ebe0287ceff21c88739e60d (diff)
Make openbox-gnome-session work with gnome-session > 2.22
Diffstat (limited to 'data')
-rw-r--r--data/xsession/openbox-gnome-session.in23
1 files changed, 22 insertions, 1 deletions
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
+
+
+