]> git.pld-linux.org Git - projects/setup.git/blobdiff - etc/profile
- added setting of xterm-window title for bash and zsh. TODO: ksh*
[projects/setup.git] / etc / profile
index a60ec06f4f61c91c99ad9180511230682047c94d..3575dccc358ad2029cac71f3a127feb1c02e19f7 100644 (file)
@@ -4,8 +4,9 @@
 # System wide environment and startup programs
 # Functions and aliases go into the shells dependent startup files
 
-[ "`echo $PATH | grep -q /usr/X11R6/bin`" = "" ] && PATH="$PATH:/usr/X11R6/bin"
-[ "`echo $PATH | grep -q "$HOME/bin"`" = "" ] && PATH="$PATH:$HOME/bin"
+echo "$PATH" | grep -q /usr/X11R6/bin || PATH="$PATH:/usr/X11R6/bin"
+echo "$PATH" | grep -q /usr/local/bin || PATH="$PATH:/usr/local/bin"
+echo "$PATH" | grep -q "$HOME/bin" || PATH="$PATH:$HOME/bin"
 
 if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
        umask 002
@@ -15,15 +16,18 @@ fi
 
 USER=`id -un`
 LOGNAME=$USER
-MAIL="/var/mail/$USER"
 
-HOSTNAME=`/bin/hostname`
+HOSTNAME=`/bin/uname -n`
 HISTFILE="$HOME/.history"
 HISTSIZE=1000
 HISTFILESIZE=1000
 
+# home_etc user config-dirs
+#CONFIG_DIR=etc
+#export CONFIG_DIR
+
 #
-# Setup the environment for varius shells
+# Setup the environment for various shells
 #
 
 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
@@ -46,7 +50,14 @@ fi
 
 case "$SH" in
   bash)
-       PS1="[\u@\h \W]\\$ "
+       case $TERM in
+               xterm*)
+                       PS1="\[\033]0;\u@\h: \w\007\][\u@\h \W]\\$ "
+                       ;;
+               *)
+                       PS1="[\u@\h \W]\\$ "
+                       ;;
+       esac
        ;;
   ksh|pdksh)
        if [ `id -u` -eq 0 ]; then
@@ -113,6 +124,8 @@ case "$SH" in
        ;;
   zsh)
        PS1='[%n@%m %~]%(!.#.%\$) '
+       RPS1="%T"
+       export RPS1
 
        # Setup key bindings
        bindkey -e >/dev/null 2>&1
@@ -131,6 +144,9 @@ case "$SH" in
                bindkey '^[[D' backward-char >/dev/null 2>&1
                bindkey '^[[C' forward-char >/dev/null 2>&1
                ;;
+       xterm*)
+               precmd () { print -Pn "\e]0;%n@%m: %~\a"i; }
+               ;;
        esac
        # other HISTFILE, zsh uses diffrent fmt
        HISTFILE=~/.historyz
This page took 0.039237 seconds and 4 git commands to generate.