first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / core / unix_login.sh
1 #!/bin/bash
2
3 #
4 # Unix Start up information and personal environment for bash.
5 #
6
7 if [ ! -z "$SHELL_DEBUG" ]; then echo unix login begins...; fi
8
9 GENERADIR=$(echo $GENERADIR | sed -e 's/\\/\//g')
10 YETI_SCRIPTS="$(echo $YETI_SCRIPTS | sed -e 's/\\/\//g')"
11 SHELLDIR="$YETI_SCRIPTS"
12
13 # Set up all of the environment's system variables.  This is the first step
14 # in the majestic plan we have for this shell's initialization.
15 source $YETI_SCRIPTS/core/variables.sh
16
17 # Also set up the temporary directory...
18 source $YETI_SCRIPTS/core/create_tempdir.sh
19
20 # ulimit and umask.  umask sets a permission mask for all file
21 # creations.  The mask shown here disallows writing by the "group" and
22 # "others" categories of users.  ulimit sets the user limits.  the core
23 # file size is set to zero.
24 umask 022
25 ulimit -c 0
26
27 # The second part of this sweeping two-part inauguration process is to set
28 # up the aliases for the shell, but only if they are not already set.  The
29 # only alias we know of that's specific to our set is used.
30 alias lsd >/dev/null 2>/dev/null  # see if the 'x' alias exists.
31 if [ $? -ne 0 ]; then
32   if [ ! -z "$SHELL_DEBUG" ]; then
33     echo the aliases were missing, now they are added...
34   fi
35   source $GENERADIR/aliases.sh
36 fi
37
38 # allow connections to our x server from the local host.
39 if [ ! -z "$DISPLAY" ]; then
40   if [ ! -z "$(echo "$OS_TYPE" | grep -i darwin)" ]; then
41     if [ ! -z "$SHELL_DEBUG" ]; then echo Enabling localhost X connections...; fi
42     xhost + localhost >/dev/null 2>&1
43   fi
44 fi
45
46 # a minor tickle of the title of the terminal, in case there is one.
47 bash $YETI_SCRIPTS/tty/label_terminal_with_infos.sh
48
49 if [ ! -z "$SHELL_DEBUG" ]; then echo unix login ends....; fi
50