got language fixed in inits.
[feisty_meow.git] / scripts / core / launch_feisty_meow.sh
1 #!/bin/bash
2
3 ##############
4
5 # Fred Hamster's Feisty Meow Concerns Ltd. Startup Profile.
6 #
7 # This file is useful within .profile or other initialization scripts.
8 #
9 # Author: Chris Koeritz
10
11 ##############
12
13 export SHELL_DEBUG=true
14   # this variable causes the scripts that listen to it to print more information
15   # when they run.
16
17 ##############
18
19 if [ -z "$FEISTY_MEOW_GENERATED" ]; then
20   # FEISTY_MEOW_GENERATED is where the generated files yeti uses are located.
21   # this is our single entry point we can use without knowing any variables
22   # yet in the initialization process.
23   export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
24 #hmmm: the above is kind of a constant.  that's not so great.
25
26   # make sure our main variables are established.
27   GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
28   if [ ! -f "$GENERATED_FEISTY_MEOW_VARIABLES" ]; then
29     echo -e '\n\n'
30     echo "The yeti scripts need to be initialized via the bootstrap process, e.g.:"
31     echo "  bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
32     echo -e '\n\n'
33   fi
34
35   ##############
36
37   # pull in our generated variables that are the minimal set we need to find
38   # the rest of our resources.
39   source "$GENERATED_FEISTY_MEOW_VARIABLES"
40
41   # Set up the temporary directory.
42   source $FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh
43
44   ##############
45
46   # load the larger body of standard feisty meow variables into the environment.
47   source $FEISTY_MEOW_SCRIPTS/core/variables.sh
48
49 fi
50
51 # check hash table before searching path.
52 shopt -s checkhash
53 # don't check path for sourced files.
54 shopt -u sourcepath
55
56 ##############
57
58 if [ -z "$LIGHTWEIGHT_INIT" ]; then
59   # perform the bulkier parts of the login and initialization.
60
61   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login begins...; fi
62
63   # set up the aliases for the shell, but only if they are not already set.
64   alias regenerated &>/dev/null  # see if a crucial alias exists.
65   if [ $? -ne 0 ]; then
66     if [ ! -z "$SHELL_DEBUG" ]; then
67       echo the aliases were missing, now they are added...
68     fi
69     source "$FEISTY_MEOW_GENERATED/fmc_core_and_custom_aliases.sh"
70   fi
71
72   # allow connections to our x server from the local host.
73   if [ ! -z "$DISPLAY" ]; then
74     if [ ! -z "$(echo "$OS_TYPE" | grep -i darwin)" ]; then
75       if [ ! -z "$SHELL_DEBUG" ]; then echo Enabling localhost X connections...; fi
76       xhost + localhost >/dev/null 2>&1
77     fi
78   fi
79
80   # a minor tickle of the title of the terminal, in case there is one.
81   bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
82
83   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login ends....; fi
84 fi
85