Advertisement
corrosiontears

Bash.bashrc Crunchbang/Debian

Jun 13th, 2013
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.33 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. # set a fancy prompt (non-color, overwrite the one in /etc/profile)
  19.  
  20. #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  21.  
  22. if [ "$(id -un)" == "root" ]; then
  23.  PS1='\n\[\e[0;90m\][\h] [\[\e[0;33m\]\w\[\e[0;90m\]]\n\[\e[0;90m\][\[\e[0;31m\]\u\[\e[0;90m\]] >>\[\e[0m\] '
  24.  PS2='\[\e[0;90m\][\[\e[0;31m\]\u\[\e[0;90m\]] >>\[\e[0m\] '
  25. else
  26.  PS2='\[\e[0;90m\][\[\e[0;32m\]\u\[\e[0;90m\]] >>\[\e[0m\] '
  27.  PS1='\n\[\e[0;90m\][\h] [\[\e[0;33m\]\w\[\e[0;90m\]]$(__git_ps1 " [\[\e[0;34m\]%s\[\e[0;90m\]]")\n\[\e[0;90m\][\[\e[0;32m\]\u\[\e[0;90m\]] >>\[\e[0m\] '
  28. fi
  29.  
  30. # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
  31. # If this is an xterm set the title to user@host:dir
  32. #case "$TERM" in
  33. #xterm*|rxvt*)
  34. #    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  35. #    ;;
  36. #*)
  37. #    ;;
  38. #esac
  39.  
  40. # enable bash completion in interactive shells
  41. if ! shopt -oq posix; then
  42.   if [ -f /usr/share/bash-completion/bash_completion ]; then
  43.     . /usr/share/bash-completion/bash_completion
  44.   elif [ -f /etc/bash_completion ]; then
  45.     . /etc/bash_completion
  46.   fi
  47. fi
  48.  
  49. # if the command-not-found package is installed, use it
  50. if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
  51.     function command_not_found_handle {
  52.             # check because c-n-f could've been removed in the meantime
  53.                 if [ -x /usr/lib/command-not-found ]; then
  54.            /usr/bin/python /usr/lib/command-not-found -- "$1"
  55.                    return $?
  56.                 elif [ -x /usr/share/command-not-found/command-not-found ]; then
  57.            /usr/bin/python /usr/share/command-not-found/command-not-found -- "$1"
  58.                    return $?
  59.         else
  60.            printf "%s: command not found\n" "$1" >&2
  61.            return 127
  62.         fi
  63.     }
  64. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement