File: gnome-wm

package info (click to toggle)
gnome-session 3.4.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,900 kB
  • sloc: ansic: 21,616; sh: 11,164; xml: 757; makefile: 484
file content (38 lines) | stat: -rwxr-xr-x 977 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# The user can specify his prefered WM by setting the WINDOW_MANAGER
# environment variable.
#
# If this is not set, we search a list of known windowmanagers and use
# the first one that is found in the users's PATH

# Avoid looping if the session configuration tells us to use gnome-wm or if
# the user forces gnome-wm via WINDOW_MANAGER
if [ "x$WINDOW_MANAGER" = "xgnome-wm" ]; then
  WINDOW_MANAGER=""
fi

if [ -z "$WINDOW_MANAGER" ] ; then
  # Create a list of window manager we can handle, trying to only use the
  # compositing ones when it makes sense

  KNOWN_WM="metacity mutter sawfish"

  for wm in $KNOWN_WM; do
    if [ -x /usr/bin/"$wm" ]; then
      WINDOW_MANAGER=/usr/bin/"$wm"
      break
    fi
  done

fi

# Look for the default window manager on the system

if [ -z "$WINDOW_MANAGER" ] ; then
  WINDOW_MANAGER=$(readlink /etc/alternatives/x-window-manager 2>/dev/null)
fi

exec "$WINDOW_MANAGER" "$@"

echo "ERROR: No window manager could run!"