fixed misplaced quoting for new imported xauth
[feisty_meow.git] / scripts / core / launch_feisty_meow.sh
index 3a9344ef3c3b1b66f483f406cf4c2fc992acce3a..913f82b43b2ac6c53273ecb2caa368799d5d21cf 100644 (file)
@@ -19,7 +19,7 @@
 ##############
 
 # this script cannot handle figuring out where it lives, so approaches that
-# get the WORKDIR will fail.  this is a consequence of this always being used
+# get the THISDIR will fail.  this is a consequence of this always being used
 # in bash's 'source' directive, which does not pass the script name as
 # argument 0.  instead, we just check for the bad condition of a malconfigured
 # script system and try to repair it.
@@ -92,6 +92,13 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then
   if [ -z "$USER" -a ! -z "$CRONUSER" ]; then
     export USER="$CRONUSER"
   fi
+
+  # use the xauth info if we were given one in the environment.
+  # this allows root or other su'd identities to create windows with same
+  # display variable.
+  if [ ! -z "$DISPLAY" -a ! -z "$IMPORTED_XAUTH" ]; then
+    xauth add $IMPORTED_XAUTH
+  fi
   
   ##############
   
@@ -123,19 +130,13 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then
   
     ##############
 
-echo POINT A
-  
     if [ -z "$ERROR_OCCURRED" ]; then
-
-echo POINT B
       # pull in our generated variables that are the minimal set we need to find
       # the rest of our resources.
       source "$FEISTY_MEOW_VARIABLES_LOADING_FILE"
   
-echo POINT C
       # Set up the temporary directory.
       source "$FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh"
-echo POINT D
     fi
   
   fi
@@ -143,15 +144,11 @@ echo POINT D
   ##############
 
   if [ -z "$ERROR_OCCURRED" ]; then
-
-echo POINT E
-
-    # load the larger body of standard feisty meow variables into the environment.
-    # we actually want this to always run also; it will decide what variables need
-    # to be set again.
+    # no error occurred in our tests above, so load the larger body of standard feisty
+    # meow variables into the environment.  we actually want this to always run also;
+    # it will decide what variables need to be set again.
     source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
 
-echo POINT F
     ##############
 
     # include helpful functions.  we do this every time rather than making it part
@@ -159,11 +156,9 @@ echo POINT F
     # sub-shells in bash.
     source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
 
-echo POINT G
     # load some helper methods for the terminal which we'll use below.
     source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh"
 
-echo POINT H
     ##############
 
 #hmmm: abstract this to a twiddle shell options method.
@@ -179,7 +174,6 @@ echo POINT H
     shopt -s checkwinsize
 
     ##############
-echo POINT I
 
     # make history writes immediate to avoid losing history if bash is zapped.
     echo $PROMPT_COMMAND | grep -q history
@@ -194,19 +188,15 @@ echo POINT I
 
     if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init begins..."; fi
 
-echo POINT J
     # set up the aliases for the shell, but only if they are not already set.
     type CORE_ALIASES_LOADED &>/dev/null
     if [ $? -ne 0 ]; then
       if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
         echo "the aliases were missing, now they are being added..."
       fi
-echo HEEE HAHAHAHAHA
       source "$FEISTY_MEOW_LOADING_DOCK/fmc_core_and_custom_aliases.sh"
-echo HOOOOEY
     fi
 
-echo POINT K
     #echo before the new labelling, terminal titles have:
     #show_terminal_titles
 
@@ -232,6 +222,23 @@ echo POINT K
     unset FEISTY_MEOW_SHOW_LAUNCH_GREETING
   fi
 
+  # only run this hello file if the core feisty meow support haven't been loaded already.  this
+  # hopefully guarantees we show the info at most once in one shell continuum.
+  # this can also be disabled if the NO_HELLO variable has a non-empty value.
+  type CORE_VARIABLES_LOADED &>/dev/null
+  if [ $? -ne 0 -a -z "$NO_HELLO" ]; then
+    # print out a personalized hello file if we find one.
+    if [ -f ~/hello.txt ]; then
+      echo
+      sep 28
+      perl $FEISTY_MEOW_SCRIPTS/*/filedump.pl ~/hello.txt
+      sep 28
+      echo
+    fi
+    # from now on there should be no extra helloing.
+    export NO_HELLO=true
+  fi
+
   # load the last bits we do here.
   source "$FEISTY_MEOW_LOADING_DOCK/fmc_ending_sentinel.sh"