Guest User

.bashrc

a guest
Apr 27th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.60 KB | None | 0 0
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4.  
  5. export EDITOR="gedit"
  6.  
  7. # If not running interactively, don't do anything
  8. [ -z "$PS1" ] && return
  9.  
  10. # don't put duplicate lines in the history. See bash(1) for more options
  11. export HISTCONTROL=ignoredups
  12. # ... and ignore same sucessive entries.
  13. export HISTCONTROL=ignoreboth
  14.  
  15. # check the window size after each command and, if necessary,
  16. # update the values of LINES and COLUMNS.
  17. shopt -s checkwinsize
  18.  
  19. # make less more friendly for non-text input files, see lesspipe(1)
  20. [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
  21.  
  22. # set a fancy prompt (non-color, unless we know we "want" color)
  23. # Define some colors first:
  24. red='\[\033[0;31m\]'
  25. RED='\[\033[1;31m\]'
  26. green='\[\033[0;32m\]'
  27. GREEN='\[\033[1;32m\]'
  28. yellow='\[\033[0;33m\]'
  29. YELLOW='\[\033[1;33m\]'
  30. blue='\[\033[0;34m\]'
  31. coldblue="\[\033[0;38;5;33m\]"
  32. BLUE='\[\033[1;34m\]'
  33. magenta='\[\033[0;35m\]'
  34. MAGENTA='\[\033[1;35m\]'
  35. cyan='\[\033[0;36m\]'
  36. CYAN='\[\033[1;36m\]'
  37. white='\[\033[0;37m\]'
  38. WHITE='\[\033[1;37m\]'
  39.  
  40. NC='\[\033[0m\]'              # No Color
  41.  
  42. function pre_prompt {
  43. newPWD="${PWD}"
  44. user="whoami"
  45. host=$(echo -n $HOSTNAME | sed -e "s/[\.].*//")
  46. datenow=$(date "+%a, %d %b %y")
  47. let promptsize=$(echo -n "--[$user@$host]---[${PWD}]---" \
  48.                  | wc -c | tr -d " ")
  49. let fillsize=${COLUMNS}-${promptsize}
  50. fill=""
  51. while [ "$fillsize" -gt "0" ]
  52. do
  53.     fill="${fill}—"
  54.     let fillsize=${fillsize}-1
  55. done
  56. if [ "$fillsize" -lt "0" ]
  57. then
  58.     let cutt=3-${fillsize}
  59.     newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
  60. fi
  61.  
  62. }
  63.  
  64. PROMPT_COMMAND=pre_prompt
  65.  
  66. #export black="\[\033[0;38;5;0m\]"
  67. #export red="\[\033[0;38;5;1m\]"
  68. #export green="\[\033[0;38;5;2m\]"
  69. #export yellow="\[\033[0;38;5;3m\]"
  70. #export blue="\[\033[0;38;5;4m\]"
  71. #export magenta="\[\033[0;38;5;55m\]"
  72. #export cyan="\[\033[0;38;5;6m\]"
  73. #export white="\[\033[0;38;5;7m\]"
  74. #export coldblue="\[\033[0;38;5;33m\]"
  75. #export smoothblue="\[\033[0;38;5;111m\]"
  76. #export iceblue="\[\033[0;38;5;45m\]"
  77. #export turqoise="\[\033[0;38;5;50m\]"
  78. #export smoothgreen="\[\033[0;38;5;42m\]"
  79.  
  80. PS1="$cyan┌──[$RED\u@\h$cyan]─\${fill}─[$BLUE\$newPWD\
  81. $cyan]──\n$cyan└──[$YELLOW\$(date \"+%H:%M:%S\")$cyan]─$YELLOW\$$NC "
  82.  
  83. # Comment in the above and uncomment this below for a color prompt
  84. #PS1="$RED[ \u ] $NC$green\h $NC$yellow[\w]$NC > "
  85. #\[\033]0;\${TERM} [\u@\h] \w\007\]
  86.  
  87.  
  88. # Alias definitions.
  89. # You may want to put all your additions into a separate file like
  90. # ~/.bash_aliases, instead of adding them here directly.
  91. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  92.  
  93. # user-defined aliases
  94. alias ll='ls -alh'
  95. alias lx='ls -alhX'
  96. alias rm='rm -vi'
  97. alias cp='cp -vi'
  98. alias mv='mv -vi'
  99. alias df='df -h'
  100. alias mplayers='mplayer -vc ffh264vdpau,ffmpeg12vdpau,ffvc1vdpau,ffwmv3vdpau, -vo vdpau '
  101. alias du='du -mhc'
  102. alias vobcopy='vobcopy -m -v -i'
  103.  
  104. #if [ -f ~/.bash_aliases ]; then
  105. #    . ~/.bash_aliases
  106. #fi
  107.  
  108. # enable color support of ls and also add handy aliases
  109. if [ "$TERM" != "dumb" ]; then
  110.    eval "`dircolors -b`"
  111.    alias ls='ls --color=auto'
  112.    #alias dir='ls --color=auto --format=vertical'
  113.    #alias vdir='ls --color=auto --format=long'
  114. fi
  115.  
  116. # some more ls aliases
  117. #alias ll='ls -l'
  118. #alias la='ls -A'
  119. #alias l='ls -CF'
  120.  
  121. # enable programmable completion features (you don't need to enable
  122. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  123. # sources /etc/bash.bashrc).
  124. if [ -f /etc/bash_completion ]; then
  125.    . /etc/bash_completion
  126. fi
Advertisement
Add Comment
Please, Sign In to add comment