Advertisement
Guest User

Linux Mint 8 bashrc

a guest
May 20th, 2010
3,669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.38 KB | None | 0 0
  1. # System-wide .bashrc file for interactive bash(1) shells.
  2.  
  3. # To enable the settings / commands in this file for login shells as well,
  4. # this file has to be sourced in /etc/profile.
  5.  
  6. # If not running interactively, don't do anything
  7. [ -z "$PS1" ] && return
  8.  
  9. # check the window size after each command and, if necessary,
  10. # update the values of LINES and COLUMNS.
  11. shopt -s checkwinsize
  12.  
  13. # set variable identifying the chroot you work in (used in the prompt below)
  14. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  15.     debian_chroot=$(cat /etc/debian_chroot)
  16. fi
  17.  
  18. use_color=false
  19.  
  20. # Set colorful PS1 only on colorful terminals.
  21. # dircolors --print-database uses its own built-in database
  22. # instead of using /etc/DIR_COLORS.  Try to use the external file
  23. # first to take advantage of user additions.  Use internal bash
  24. # globbing instead of external grep binary.
  25. safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
  26. match_lhs=""
  27. [[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
  28. [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
  29. [[ -z ${match_lhs}    ]] \
  30.         && type -P dircolors >/dev/null \
  31.         && match_lhs=$(dircolors --print-database)
  32. [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
  33.  
  34. if ${use_color} ; then
  35.         # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
  36.         if type -P dircolors >/dev/null ; then
  37.                 if [[ -f ~/.dir_colors ]] ; then
  38.                         eval $(dircolors -b ~/.dir_colors)
  39.                 elif [[ -f /etc/DIR_COLORS ]] ; then
  40.                         eval $(dircolors -b /etc/DIR_COLORS)
  41.                 fi
  42.         fi
  43.  
  44.         if [[ ${EUID} == 0 ]] ; then
  45.                 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
  46.         else
  47.                 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
  48.         fi
  49.  
  50.         alias ls='ls --color=auto'
  51.         alias grep='grep --colour=auto'
  52. else
  53.         if [[ ${EUID} == 0 ]] ; then
  54.                 # show root@ when we don't have colors
  55.                 PS1='\u@\h \W \$ '
  56.         else
  57.                 PS1='\u@\h \w \$ '
  58.         fi
  59. fi
  60.  
  61. # Try to keep environment pollution down, EPA loves us.
  62. unset use_color safe_term match_lhs
  63.  
  64. # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
  65. # If this is an xterm set the title to user@host:dir
  66. #case "$TERM" in
  67. #xterm*|rxvt*)
  68. #    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  69. #    ;;
  70. #*)
  71. #    ;;
  72. #esac
  73.  
  74. # enable bash completion in interactive shells
  75. if [ -f /etc/bash_completion ]; then
  76.     . /etc/bash_completion
  77. fi
  78.  
  79. # sudo hint
  80. if [ ! -e $HOME/.sudo_as_admin_successful ]; then
  81.     case " $(groups) " in *\ admin\ *)
  82.     if [ -x /usr/bin/sudo ]; then
  83.     cat <<-EOF
  84.     To run a command as administrator (user "root"), use "sudo <command>".
  85.     See "man sudo_root" for details.
  86.    
  87.     EOF
  88.     fi
  89.     esac
  90. fi
  91.  
  92. # if the command-not-found package is installed, use it
  93. if [ -x /usr/lib/command-not-found ]; then
  94.     function command_not_found_handle {
  95.             # check because c-n-f could've been removed in the meantime
  96.                 if [ -x /usr/lib/command-not-found ]; then
  97.            /usr/bin/python /usr/lib/command-not-found -- $1
  98.                    return $?
  99.         else
  100.            return 127
  101.         fi
  102.     }
  103. fi
  104.  
  105. /usr/bin/mint-fortune
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement