# HG changeset patch # User Christophe Lincoln # Date 1397684979 -7200 # Node ID 8e1a647b61e74c396d9d713df2b94f7804af8c8d # Parent 0a476090cd091060e65b57322936b632850c0af1 Update /etc/profile and use colored prompt diff -r 0a476090cd09 -r 8e1a647b61e7 rootfs/etc/profile --- a/rootfs/etc/profile Tue Apr 15 06:38:36 2014 +0200 +++ b/rootfs/etc/profile Wed Apr 16 23:49:39 2014 +0200 @@ -4,59 +4,64 @@ LD_LIBRARY_PATH="/usr/lib:/lib:/usr/local/lib" # Prompt format for Ash (Bash use /etc/bashrc). -if [ "`id -u`" -eq 0 ]; then - # Light green and blue colored prompt. - #PS1='\e[1;31m\u@\h\e[0m:\e[1;34m\w\e[0m\$ ' - PS1='\u@\h:\w\$ ' +if [ $(id -u) -eq 0 ]; then + # Red and blue for root + PS1="\[\e[1;31m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " + #PS1='\u@\h:\w\$ ' else - # Light green and blue colored prompt. - #PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " - PS1='\u@\h:\w\$ ' + # Green and blue for users + PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " + #PS1='\u@\h:\w\$ ' fi # Max 64M for programs (prevent memory leak crashes) +# ulimit -d 65536 ulimit -m 65536 -# Screen display for X and encoding for GTK+ apps. +# Screen display for X and encoding for GTK+ apps +# [ -n "$DISPLAY" ] || DISPLAY=:0.0 G_FILENAME_ENCODING=UTF-8 -# Make OpenOffice look better. +# Make OpenOffice look better +# OOO_FORCE_DESKTOP=gnome -# Export all variables defined above and set mask. +# Export all variables defined above and set mask # export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING export OOO_FORCE_DESKTOP ignoreeof umask 022 -# Locale and timezone settings. +# Locale and timezone settings # if [ -s "/etc/locale.conf" ]; then . /etc/locale.conf export LANG LC_ALL fi if [ -s "/etc/TZ" ]; then - TZ=`cat /etc/TZ` + TZ=$(cat /etc/TZ) export TZ fi + +# Update X Terminal window title +# ip=$(ifconfig $(route -n|sed '$!d;s/.* //')|sed '/t a/!d;s/.*:\(.*\) B.*/\1/') case "$TERM" in -xterm*|rxvt*) echo -ne "\033]0;$(hostname) $(cat /etc/slitaz-release) $ip \007";; + xterm*|rxvt*) echo -ne "\033]0;$(hostname) $(cat /etc/slitaz-release) $ip \007";; esac -dirs() -{ +# Bash compatibility + +dirs() { echo $_dirs } -pushd() -{ +pushd() { cd $1 && _dirs="$1 $_dirs" && dirs } -popd() -{ +popd() { [ -n "$_dirs" ] && _dirs="${_dirs#* }" && cd ${_dirs%% *} && dirs }