summaryrefslogtreecommitdiffstats
path: root/aaabasicfs/bashrc.etc
diff options
context:
space:
mode:
authortnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
committertnut <tnut at nutyx dot com>2012-01-08 12:12:28 +0100
commit9291e062cb24bac5d7c7059d4dc64669c1917b33 (patch)
treeae6f7e4fb2769d6c53b214c5e0b4d862f1df98dc /aaabasicfs/bashrc.etc
parentc9972ec7f32bf9d37388e853fe9bf633e242d05a (diff)
downloadnutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.gz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.bz2
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.tar.xz
nutyx-pakxe-9291e062cb24bac5d7c7059d4dc64669c1917b33.zip
aaabasicfs 2011-3 et split des dépot base et extra en 2 git séparé
Diffstat (limited to 'aaabasicfs/bashrc.etc')
-rw-r--r--aaabasicfs/bashrc.etc65
1 files changed, 65 insertions, 0 deletions
diff --git a/aaabasicfs/bashrc.etc b/aaabasicfs/bashrc.etc
new file mode 100644
index 000000000..4968c64be
--- /dev/null
+++ b/aaabasicfs/bashrc.etc
@@ -0,0 +1,65 @@
+# Begin /etc/bashrc
+# Written for Beyond Linux From Scratch
+# by James Robertson <jameswrobertson@earthlink.net>
+# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
+
+# System wide aliases and functions.
+
+# System wide environment variables and startup programs should go into
+# /etc/profile. Personal environment variables and startup programs
+# should go into ~/.bash_profile. Personal aliases and functions should
+# go into ~/.bashrc
+
+# Provides a colored /bin/ls command. Used in conjunction with code in
+# /etc/profile.
+
+alias ls='ls --color=auto'
+
+# Provides prompt for non-login shells, specifically shells started
+# in the X environment. [Review the LFS archive thread titled
+# PS1 Environment Variable for a great case study behind this script
+# addendum.]
+
+NORMAL="\[\e[0m\]"
+RED="\[\e[1;31m\]"
+GREEN="\[\e[1;32m\]"
+WHITE="\[\e[1;37m\]"
+INFOMACHINE="`date +%H:%M` `uname -m` `uname -r` `whoami`@`uname -n`"
+prompt_command() {
+# Sauvegarde de la pos courante
+tput sc
+# Calcul de la largeur
+let backwash=$(tput cols)-$(echo $INFOMACHINE | wc -m)-2
+# Pos des curseurs à la position Y=0, X=longueur calculée
+tput cup 0 ${backwash}
+# Spécifie la couleur et la casse de la police
+tput setaf 4; tput bold
+# Affiche le chemin entre crochets
+echo -n "["
+# Specifie la couleur du chemin
+tput setaf 6
+# Affiche le chemin complet
+echo -n "$INFOMACHINE"
+tput setaf 4; tput bold
+# Affiche le crochet fermé
+echo -n "]"
+# Remet le curseur à sa place
+tput rc
+}
+
+PROMPT_COMMAND=prompt_command
+
+case $TERM in
+ xterm|rxvt*)
+ TITLEBAR='\[\033]0;\u@\h \007\]'
+ ;;
+ *)
+ TITLEBAR=''
+ ;;
+esac
+if [[ $EUID == 0 ]] ; then
+PS1="$TITLEBAR$RED[ \w $RED]$NORMAL "
+else
+PS1="$TITLEBAR$GREEN[ \w $GREEN]$NORMAL "
+fi
+# End /etc/bashrc