5 # Fred Hamster's Feisty Meow Concerns Ltd. Startup Profile.
7 # This file is useful within .profile or other initialization scripts.
9 # Author: Chris Koeritz
13 # SHELL_DEBUG: if this variable is non-empty, then it causes the feisty meow
14 # scripts to print more diagnostic information when they run. not all
15 # scripts support this, but the core ones do.
17 #export SHELL_DEBUG=true
21 export ERROR_OCCURRED=
22 # there have been no errors to start with, at least. we will set this
23 # to non-empty if something bad happens.
25 if [ -z "$FEISTY_MEOW_GENERATED" ]; then
26 # FEISTY_MEOW_GENERATED is where the generated files are located.
27 # this is our single entry point we can use without knowing any variables
28 # yet in the initialization process.
29 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
30 #hmmm: the above is kind of a constant. that's not so great.
32 # make sure our main variables are established.
33 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
34 if [ ! -f "$GENERATED_FEISTY_MEOW_VARIABLES" ]; then
36 echo "Feisty meow scripts need initialization via the bootstrap process, e.g.:"
37 echo " bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
44 # pull in our generated variables that are the minimal set we need to find
45 # the rest of our resources.
46 source "$GENERATED_FEISTY_MEOW_VARIABLES"
48 # Set up the temporary directory.
49 source $FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh
55 # load the larger body of standard feisty meow variables into the environment.
56 # we actually want this to always run also; it will decide what variables need
58 source $FEISTY_MEOW_SCRIPTS/core/variables.sh
62 # include helpful functions. we do this every time rather than making it part
63 # of variable initialization, because functions cannot be exported to
64 # sub-shells in bash (much like aliases cannot, to our infinite chagrin after
65 # having migrated from korn shell...).
66 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
70 # check hash table before searching path.
72 # don't check path for sourced files.
74 # ignore duplicate lines.
75 HISTCONTROL=ignoredups
76 # append to the history file.
78 # automatically update window size if needed.
83 if [ -z "$LIGHTWEIGHT_INIT" ]; then
84 # perform the bulkier parts of the initialization process.
86 if [ ! -z "$SHELL_DEBUG" ]; then echo "heavyweight init begins..."; fi
88 # set up the aliases for the shell, but only if they are not already set.
89 if [ -z "$CORE_ALIASES_LOADED" ]; then
90 if [ ! -z "$SHELL_DEBUG" ]; then
91 echo "the aliases were missing, now they are being added..."
93 source "$FEISTY_MEOW_GENERATED/fmc_core_and_custom_aliases.sh"
96 # allow connections to our x server from the local host.
97 if [ ! -z "$DISPLAY" ]; then
98 if [ ! -z "$(echo "$OS_TYPE" | grep -i darwin)" ]; then
99 if [ ! -z "$SHELL_DEBUG" ]; then echo "Enabling localhost X connections..."; fi
100 xhost + localhost >/dev/null 2>&1
104 # a minor tickle of the title of the terminal, in case there is one.
105 bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
107 if [ ! -z "$SHELL_DEBUG" ]; then echo "heavyweight init is done."; fi
110 if [ -z "$ERROR_OCCURRED" ]; then
111 # set a sentinel variable to say we loaded the feisty meow environment.
112 export FEISTY_MEOW_SCRIPTS_LOADED=true