summaryrefslogtreecommitdiff
path: root/packages/x11/x11-common/etc/X11/Xsession
blob: cfa3a9a6e30f54c967c04d2ba593eb5c2af82249 (plain)
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
39
40
41
42
43
44
45
46
47
#!/bin/sh

# this location MUST be consistent with /etc/X11/gpe-login.pre-session
HOME_VOLATILE=/home/$USER/ramdisk
export HOME_VOLATILE

if [ -f /usr/bin/dbus-launch ]; then
  ## test for an existing bus daemon, just to be safe
  if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
     ## if not found, launch a new one
     eval `dbus-launch --auto-syntax --exit-with-session`
     echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
  fi
fi

. /etc/profile

if [ -f $HOME/.profile ]; then
 . $HOME/.profile
fi

SYSSESSIONDIR=/etc/X11/Xsession-gpe.d

if [ ! -d $SYSSESSIONDIR ]; then
  SYSSESSIONDIR=/etc/X11/Xsession.d
fi

# Use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other.

# Can't use run-parts like this, busybox doesn't support it. Use ls instead
#SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)

SESSIONFILES=`ls -X $SYSSESSIONDIR`
if [ -n "$SESSIONFILES" ]; then
  for SESSIONFILE in $SESSIONFILES; do
  # Test if script is executable first before sourcing it
    if [ -x "$SYSSESSIONDIR/$SESSIONFILE" ]; then
      . $SYSSESSIONDIR/$SESSIONFILE
    fi
  done
fi

exit 0