.bashrc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. #set -o vi
  5. #URL with an explanation of .bashrc, .bash_profile, etc.
  6. #(rationale of my modularization):
  7. #https://www.baeldung.com/linux/bashrc-vs-bash-profile-vs-profile
  8. # If running interactively, then:
  9. if [ "$PS1" ]; then
  10. # don't put duplicate lines in the history. See bash(1) for more options
  11. # export HISTCONTROL=ignoredups
  12. # check the window size after each command and, if necessary,
  13. # update the values of LINES and COLUMNS.
  14. #shopt -s checkwinsize
  15. # enable color support of ls and also add handy aliases
  16. if [ "$TERM" != "dumb" ]; then
  17. eval `dircolors -b`
  18. alias ls='ls --color=auto'
  19. alias dir='ls --color=auto --format=vertical'
  20. alias vdir='ls --color=auto --format=long'
  21. fi
  22. # some more aliases
  23. source ~/.aliases
  24. #replace nbsp by spaces
  25. bind $'"\u00a0":" "'
  26. # set a fancy prompt
  27. #PS1='\u@\h:\w\$ '
  28. #bleu \033[01;34m\]
  29. #rouge \033[01;31m\]
  30. #jaune \033[02;33m\]
  31. #vert \033[02;32m\]
  32. # ------------------------------------------------------------------- #
  33. # http://gentoo-wiki.com/TIP_Prompt_Magic #
  34. # http://www-128.ibm.com/developerworks/linux/library/l-tip-prompt/ #
  35. # ------------------------------------------------------------------- #
  36. CRESET="\[\e[0;0m\]"
  37. CRESET_BOLD="\[\e[0;1m\]"
  38. BLUE="\[\e[0;34m\]"
  39. LBLUE="\[\e[1;34m\]"
  40. RED="\[\e[0;31m\]"
  41. RED_BOLD="\[\e[1;31m\]"
  42. LRED="\[\e[1;31m\]"
  43. MAGENTA="\[\e[0;35m\]"
  44. LMAGENTA="\[\e[1;35m\]"
  45. CYAN="\[\e[0;36m\]"
  46. LCYAN="\[\e[1;36m\]"
  47. GREEN="\[\e[0;32m\]"
  48. LGREEN="\[\e[1;32m\]"
  49. YELLOW="\[\e[0;33m\]"
  50. YELLOW_BOLD="\[\e[1;33m\]"
  51. ORANGE="\[\e[0;33m\]"
  52. GREY="\[\e[0;37m\]"
  53. #prompt de couleur :' \033[01;34m\]........\033[00m\]'
  54. #CHARGE=`~/batteryCharge.sh`
  55. #old#PS1='\033[01;31m\]\u\033[00m\]\033[02;33m\]@\033[00m\]\t>\W$ '
  56. #. /home/jcb/gitbashprompt
  57. #test remplacement par gitbashprompt
  58. PS1="${RED_BOLD}\u${CRESET}${YELLOW}@${CYAN}\h${CRESET}${YELLOW}#${CRESET}\t>\W${GREEN}\$${CRESET}"
  59. # If this is an xterm set the title to user@host:dir
  60. case $TERM in
  61. xterm*)
  62. PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  63. ;;
  64. *)
  65. ;;
  66. esac
  67. # enable programmable completion features (you don't need to enable
  68. # this, if it's already enabled in /etc/bash.bashrc).
  69. if [ -f /etc/bash_completion ]; then
  70. . /etc/bash_completion
  71. fi
  72. fi
  73. #???
  74. #echo -ne "\x1b[1 q"
  75. #printf %b '\e]12;red\a'