4a8e80f48385e264a08c49f20c81854462143701
[openpandora.oe.git] / recipes / pandora-system / pandora-skel / .xinitrc
1 # This script sets up a few XDG vairables for the OpenPandora (to find the Xfce defaults etc.)
2 # and then launches the chosen user session (mainly Xfce or PMenu)
3
4 # The makes sure that /etc/xdg/op is added to the vairables to get the defaults for the OP.
5 if test "x$XDG_CONFIG_DIRS" = "x"
6 then
7   XDG_CONFIG_DIRS="/etc/xdg/op:/etc/xdg"
8 else
9   XDG_CONFIG_DIRS="/etc/xdg/op:$XDG_CONFIG_DIRS:/etc/xdg"
10 fi
11 export XDG_CONFIG_DIRS
12
13 if test "x$XDG_DATA_DIRS" = "x"
14 then
15   XDG_DATA_DIRS="/usr/local/share:/usr/share:@_datadir_@"
16   XDG_DATA_DIRS="/etc/xdg/op:/usr/local/share:/usr/share:@_datadir_@"
17 else
18   XDG_DATA_DIRS="$XDG_DATA_DIRS:@_datadir_@"
19   XDG_DATA_DIRS="/etc/xdg/op:$XDG_DATA_DIRS:@_datadir_@"
20 fi
21 export XDG_DATA_DIRS
22
23 # Use FreeDesktop XDG dir vars to put user data in non hidden dirs to make
24 # maintaince easier for users.
25 # These really should be set somewhere better but for now this will work.
26 export XDG_DATA_HOME=$HOME/Applications/Data
27 export XDG_CONFIG_HOME=$HOME/Applications/Settings
28 export XDG_CACHE_HOME=$HOME/Applications/Cache
29
30 #HACK: Run Xsession.d from here :-o
31 #Wrong, wrong, wrong but it works and sorting out OE's X server chain is not going to happen right now.
32
33 if [ -d /etc/X11/Xsession.d ]; then
34     for i in `ls /etc/X11/Xsession.d/` ; do
35         if [ -r "/etc/X11/Xsession.d/$i" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
36             . "/etc/X11/Xsession.d/$i"
37         fi
38     done
39 fi
40
41 # HUP pndnotifyd to make sure it picks up the users home.
42 kill -1 pndnotifyd 
43
44 # The following variable defines the session which is started if the user
45 # doesn't explicitely select a session in SLiM.
46
47 DEFAULT_SESSION=startxfce4
48
49 case $1 in
50 xfce4)
51         exec startxfce4
52         ;;
53 pmenu)
54         exec pmenu
55         ;;
56 *)
57         exec $DEFAULT_SESSION
58         ;;
59 esac