Advertisement
edps

bashrc-debian

Nov 21st, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.86 KB | None | 0 0
  1. #-----------------------------------------------------------------------------------------#
  2. #-----------------System-wide .bashrc file for interactive bash(1) shells.----------------#
  3. #-----------------------------------------------------------------------------------------#
  4. #-------To enable the settings / commands in this file for login shells as well,----------#
  5. #------------------this file has to be sourced in /etc/profile.---------------------------#
  6. #-----------------------------------------------------------------------------------------#
  7.  
  8. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  9. # If not running interactively, don't do anything.
  10. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  11.  
  12. if [ -z "$PS1" ]; then
  13.     return
  14. fi
  15.  
  16. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  17. # Update the values of LINES and COLUMNS when resizing
  18. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  19.  
  20. shopt -s checkwinsize
  21.  
  22. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  23. # The history list is appended to the file named by the value of the
  24. # HISTFILE variable when shell exits, no overwriting the file.
  25. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  26.  
  27. shopt -s histappend
  28.  
  29. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  30. #
  31. # HISTCONTROL = If  set  to a value of ignorespace, lines which begin with a space
  32. # character are not entered on the history list.  
  33. # If set to a value of ignoredups, lines matching the last history line are not entered.
  34. # A value of ignoreboth combines the two options.
  35. #
  36. # HISTFILE = The name of the file in which command history is saved.
  37. # The default value is ~/.bash_history.
  38. #
  39. # HISTFILESIZE = The  maximum number of lines contained in the history file.
  40. # The default value is 500.
  41. #
  42. # HISTIGNORE = A colon-separated list of patterns used to decide which command lines
  43. # should be saved on the history list.
  44. #
  45. # HISTSIZE = The number of commands to remember in the command history.  
  46. # The default value is 500.
  47. #
  48. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  49.  
  50. HISTSIZE=2048
  51. HISTFILESIZE=${HISTSIZE}
  52. HISTCONTROL=ignoredups
  53. HISTCONTROL=ignoreboth
  54. HISTCONTROL=erasedups
  55. HISTIGNORE="pwd:ls:ls -la:bash:clear:exit:du -sh:cp -av:mv -v:./configure:make:sudo make install:su -:su:sudo su:su - edps:history:screenfetch:tar -zxvf:tar -jxvf:tar -Jxvf:tar xf:unzip:"
  56. export PROMPT_COMMAND="history -a ; ${PROMPT_COMMAND:-:}"
  57.  
  58. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  59. # Make less more friendly for non-text input files, see lesspipe(1).
  60. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  61.  
  62. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  63.  
  64. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  65. # Set variable identifying the chroot you work in (used in the prompt below).
  66. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  67.  
  68. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  69.     debian_chroot=$(cat /etc/debian_chroot)
  70. fi
  71.  
  72. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  73. # Standard Bash Prompt.
  74. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  75.  
  76. #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  77.  
  78. case "$TERM" in
  79.     xterm-color) color_prompt=yes;;
  80. esac
  81.  
  82. force_color_prompt=yes
  83.  
  84. if [ -n "$force_color_prompt" ]; then
  85.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  86.     color_prompt=yes
  87.     else
  88.     color_prompt=yes
  89.     fi
  90. fi
  91.  
  92. PS1="\n\[\033[1;33m\]\342\224\214($(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;31m\]\u@\h'; fi)\[\033[1;33m\])\342\224\200(\$(if [[ \$? == 0 ]]; then echo \"\[\033[01;34m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi)\[\033[1;33m\])\342\224\200(\[\033[1;32m\]\t, \d\[\033[1;33m\])\[\033[1;33m\]\n\342\224\224\342\224\200(\[\033[1;34m\]\w\[\033[1;33m\])\342\224\200(\[\033[1;34m\]\$(ls -1 | wc -l | sed 's: ::g') files, \$(ls -lah | grep -m 1 total | sed 's/total //')b\[\033[1;33m\])\342\224\200> \[\033[0m\]"
  93.  
  94. FGNAMES=('▐▐▐' '▐▐▐' '▐▐▐' '▐▐▐' '▐▐▐' '▐▐▐' '▐▐▐' '▐▐▐')
  95. BGNAMES=('  ')
  96.  
  97. for b in $(seq 0 0); do
  98.     if [ "$b" -gt 0 ]; then
  99.       bg=$(($b+39))
  100.     fi
  101. echo
  102.     for f in $(seq 0 7); do
  103.       echo -en "\033[${bg}m\033[$(($f+30))m ${FGNAMES[$f]} "
  104.       echo -en "\033[${bg}m\033[1;$(($f+30))m ${FGNAMES[$f]} "
  105.     done
  106. echo
  107.   echo -e "\033[0m"  
  108. done
  109.  
  110. unset color_prompt force_color_prompt
  111.  
  112. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  113. # Xterm|rxvt|urxvt title.
  114. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  115.  
  116. case "$TERM" in
  117. xterm*|rxvt*)
  118.     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
  119.     ;;
  120. *)
  121.     ;;
  122. esac
  123.  
  124. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  125. # Grep options (color).
  126. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  127.  
  128. export GREP_OPTIONS='--color=auto'
  129.  
  130. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  131. # Editor de Texto padrão (nano).
  132. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  133.  
  134. export EDITOR=nano
  135. alias editor=nano
  136. alias vi=nano
  137.  
  138. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  139. # Enable programmable completion features (you don't need to enable this.
  140. # If it's already enabled in /etc/bash.bashrc and /etc/profile sources /etc/bash.bashrc).
  141. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  142.  
  143. if ! shopt -oq posix; then
  144.   if [ -f /usr/share/bash-completion/bash_completion ]; then
  145.     . /usr/share/bash-completion/bash_completion
  146.   elif [ -f /etc/bash_completion ]; then
  147.     . /etc/bash_completion
  148.   fi
  149. fi
  150.  
  151. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  152. # Alias definitions.
  153. # Put all your aliases into a separate file called ~/.bash_aliases.
  154. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  155.  
  156. if [ -f ~/.bash_aliases ]; then
  157.     . ~/.bash_aliases
  158. fi
  159.  
  160. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  161. # Functions definitions.
  162. # Put all your additions into a separate file called ~/.bash_functions.
  163. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  164.  
  165. if [ -f ~/.bash_functions ]; then
  166.     . ~/.bash_functions
  167. fi
  168.  
  169. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  170. # Standard PS1.
  171. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  172.  
  173. if [ -f "$HOME/.bash_ps1" ] && [[ $- == *i* ]]; then
  174.     . "$HOME/.bash_ps1"
  175. fi
  176.  
  177. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  178. # Teclado abnt-2 e Ctrl+Alt+Backspace.
  179. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  180.  
  181. setxkbmap -model abnt2 -layout br -variant abnt2
  182. setxkbmap -option terminate:ctrl_alt_bksp
  183.  
  184. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  185. # PATH do usuário.
  186. #--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--#
  187.  
  188. export PATH="$PATH:$HOME/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement