pandora-skel: .xinitrc cleanups
[openpandora.oe.git] / recipes / pandora-system / pandora-skel / .xinitrc
index 282f1c0..fd4bb3f 100644 (file)
@@ -44,11 +44,12 @@ xmodmap ~/.pndXmodmap
 #Write the current user into /tmp/currentuser for any scripts or programs who want to make use of it
 whoami > /tmp/currentuser
 id -u > /tmp/currentuid
-chmod 777 /tmp/currentuser
-chmod 777 /tmp/currentuid
+chmod +r /tmp/currentuser
+chmod +r /tmp/currentuid
 
 # HUP pndnotifyd to make sure it picks up the users home.
-killall -1 pndnotifyd &
+# -- nope, we are not root and can't do it
+# killall -1 pndnotifyd &
 
 # The following variable defines the session which is started if the user
 # doesn't explicitely select a session in SLiM.
@@ -66,9 +67,7 @@ echo $DEFAULT_SESSION > /tmp/gui.load
 
 SESSION=$1
 
-if [ "$SESSION" == "" ]
-
-       then
+if [ "$SESSION" == "" ]; then
        SESSION=$(cat /tmp/gui.load)
 fi
 
@@ -85,12 +84,12 @@ chmod +x /tmp/gui.stop
 # This way, we can easily do a quick switch from any session to the next one by simply
 # echo'ing the new session executable into /tmp/gui.load and exiting.    
 
-nocleanwarn=$(cat /tmp/nocleanwarn)
+nocleanwarn=$(cat /tmp/nocleanwarn 2> /dev/null)
 
-if [ $nocleanwarn = "Yes" ]; then
+if [ "$nocleanwarn" = "Yes" ]; then
 
   pnd_version=$(cat /tmp/pnd_version)
-  if [ "$pnd_version" == "OMAP3630" ]; then
+  if [ "$pnd_version" = "OMAP3630" ]; then
       safespeed="1000"
   else
       safespeed="600"
@@ -110,14 +109,13 @@ do
        rm /tmp/gui.load
 
        if [ "$SESSION" == "" ]
-
        then
-               exit 0;
+               exit 1
        fi
 
        $SESSION
         
-       SESSION=$(cat /tmp/gui.load)
+       SESSION=$(cat /tmp/gui.load 2> /dev/null)
        STOP_SESSION=$(grep $SESSION /etc/pandora/conf/gui.conf | awk -F\; '{print $4}')
         echo $STOP_SESSION > /tmp/gui.stop
         chmod +x /tmp/gui.stop