~ubuntu-branches/ubuntu/saucy/openbox/saucy-proposed

« back to all changes in this revision

Viewing changes to data/xsession/openbox-gnome-session.in

  • Committer: Package Import Robot
  • Author(s): Mateusz Łukasik
  • Date: 2013-10-07 14:58:17 UTC
  • mfrom: (12.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20131007145817-83jqr402jrv0q998
Tags: 3.5.2-3
* debian/control:
  + fix typo in depends openbox-dev package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
      -remove _NET_DESKTOP_NAMES \
13
13
      -remove _NET_CURRENT_DESKTOP 2> /dev/null
14
14
 
15
 
export WINDOW_MANAGER=openbox
16
 
exec gnome-session --session=openbox-gnome
 
15
VER=$(gnome-session --version 2>/dev/null | \
 
16
      sed -e 's/[^0-9.]*\([0-9.]\+\)/\1/')
 
17
 
 
18
MAJOR=$(echo $VER | cut -d . -f 1)
 
19
MINOR=$(echo $VER | cut -d . -f 2)
 
20
 
 
21
# run GNOME with Openbox as its window manager
 
22
 
 
23
if test $MAJOR -lt 2 || (test $MAJOR = 2 && test $MINOR -le 22); then
 
24
  # older gnome-session was easy to work with
 
25
  export WINDOW_MANAGER="@bindir@/openbox"
 
26
  exec gnome-session --choose-session=openbox-session "$@"
 
27
elif test $MAJOR -lt 3; then
 
28
  # old gnome-session requires openbox to be set in gconf and an
 
29
  # openbox.desktop to be installed in the applications directory
 
30
 
 
31
  SPATH=/desktop/gnome/session
 
32
 
 
33
  # get the current default session
 
34
  SESSION=$(gconftool-2 -g $SPATH/default_session 2> /dev/null)
 
35
 
 
36
  # make sure openbox is going to be run
 
37
  if test -z "$SESSION"; then
 
38
      # if its empty then just run openbox
 
39
      SESSION="[openbox]"
 
40
  elif ! echo "$SESSION" | grep -q openbox; then
 
41
      # if openbox isn't in the session then append it
 
42
      SESSION="${SESSION%]},openbox]"
 
43
  fi
 
44
 
 
45
  # get the current GNOME/Openbox session
 
46
  OB_SESSION=$(gconftool-2 -g $SPATH/openbox_session 2> /dev/null)
 
47
 
 
48
  # update the GNOME/Openbox session if needed
 
49
  if test x$OB_SESSION != x$SESSION; then
 
50
      # the default session changed or we didn't run GNOME/Openbox before
 
51
      gconftool-2 -t list --list-type=strings -s $SPATH/openbox_session \
 
52
        "$SESSION" 2> /dev/null
 
53
  fi
 
54
 
 
55
  # run GNOME/Openbox
 
56
  exec gnome-session --default-session-key $SPATH/openbox_session "$@"
 
57
else
 
58
  # new gnome-session requires session file installed in
 
59
  # /usr/share/gnome-session/sessions as well as openbox.desktop to be
 
60
  # installed in the applications directory
 
61
 
 
62
  exec gnome-session --session=openbox-gnome
 
63
fi
17
64
 
18
65
 
19
66