working drag and drop for files/folders to/fro client-ui.
[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 fi
45
46 ##############
47
48 # load the larger body of standard feisty meow variables into the environment.
49 # we actually want this to always run also; it will decide what variables need
50 # to be set again.
51 source $FEISTY_MEOW_SCRIPTS/core/variables.sh
52
53 ##############
54   
55 # include helpful functions.  we do this every time rather than making it part
56 # of variable initialization, because functions cannot be exported to
57 # sub-shells in bash (much like aliases cannot, to our infinite chagrin after
58 # having migrated from korn shell...).
59 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
60   
61 ##############
62   
63 # check hash table before searching path.
64 shopt -s checkhash
65 # don't check path for sourced files.
66 shopt -u sourcepath
67
68 ##############
69
70 if [ -z "$LIGHTWEIGHT_INIT" ]; then
71   # perform the bulkier parts of the login and initialization.
72
73   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login begins...; fi
74
75   # set up the aliases for the shell, but only if they are not already set.
76   alias regenerate &>/dev/null  # see if a crucial alias exists.
77   if [ $? -ne 0 ]; then
78     if [ ! -z "$SHELL_DEBUG" ]; then
79       echo the aliases were missing, now they are added...
80     fi
81     source "$FEISTY_MEOW_GENERATED/fmc_core_and_custom_aliases.sh"
82   fi
83
84   # allow connections to our x server from the local host.
85   if [ ! -z "$DISPLAY" ]; then
86     if [ ! -z "$(echo "$OS_TYPE" | grep -i darwin)" ]; then
87       if [ ! -z "$SHELL_DEBUG" ]; then echo Enabling localhost X connections...; fi
88       xhost + localhost >/dev/null 2>&1
89     fi
90   fi
91
92   # a minor tickle of the title of the terminal, in case there is one.
93   bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
94
95   if [ ! -z "$SHELL_DEBUG" ]; then echo heavyweight login ends....; fi
96 fi
97