updated scheme for locating revision control assets; uses a list (in a
[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 # FEISTY_MEOW_GENERATED is where the generated files yeti uses are located.
20 # this is our single entry point we can use without knowing any variables
21 # yet in the initialization process.
22 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
23
24 # make sure our main variables are established.
25 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
26 if [ ! -f "$GENERATED_FEISTY_MEOW_VARIABLES" ]; then
27   echo -e '\n\n'
28   echo "The yeti scripts need to be initialized via the bootstrap process, e.g.:"
29   echo "  bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
30   echo -e '\n\n'
31 fi
32
33 ##############
34
35 # pull in our generated variables that are the minimal set we need to find
36 # the rest of our resources.
37 source "$GENERATED_FEISTY_MEOW_VARIABLES"
38
39 ##############
40
41 # load all the standard feisty meow variables into the environment.
42 source $FEISTY_MEOW_SCRIPTS/core/variables.sh
43
44 # Set up the temporary directory.
45 source $FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh
46
47 ##############
48
49 # check if this is dos/windows.
50 if [ "$OS" == "Windows_NT" ]; then
51   if [ -z "$HOME" ]; then
52     # set a default that might not be appropriate for everyone, but should
53     # still work.
54     export HOME=/c/home
55   fi
56   if [ ! -d "$HOME" ]; then mkdir $HOME; fi
57 fi
58
59 ##############
60
61 if [ -z "$LIGHTWEIGHT_INIT" ]; then
62   # perform the bulkier parts of the login and initialization.
63
64   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login begins...; fi
65
66   # set up the aliases for the shell, but only if they are not already set.
67   alias regenerated &>/dev/null  # see if a crucial alias exists.
68   if [ $? -ne 0 ]; then
69     if [ ! -z "$SHELL_DEBUG" ]; then
70       echo the aliases were missing, now they are added...
71     fi
72     source "$FEISTY_MEOW_GENERATED/fmc_core_and_custom_aliases.sh"
73   fi
74
75   # allow connections to our x server from the local host.
76   if [ ! -z "$DISPLAY" ]; then
77     if [ ! -z "$(echo "$OS_TYPE" | grep -i darwin)" ]; then
78       if [ ! -z "$SHELL_DEBUG" ]; then echo Enabling localhost X connections...; fi
79       xhost + localhost >/dev/null 2>&1
80     fi
81   fi
82
83   # a minor tickle of the title of the terminal, in case there is one.
84   bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
85
86   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login ends....; fi
87 fi
88