Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. ############################################
  2.  
  3. # Modified from emilis bash prompt script
  4.  
  5. # from https://github.com/emilis/emilis-config/blob/master/.bash_ps1
  6.  
  7. #
  8.  
  9. # Modified for Mac OS X by
  10.  
  11. # @corndogcomputer
  12.  
  13. ###########################################
  14. # Fill with minuses
  15.  
  16. # (this is recalculated every time the prompt is shown in function prompt_command):
  17.  
  18. fill="--- "
  19.  
  20.  
  21. reset_style='\[\033[00m\]'
  22.  
  23. status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
  24.  
  25. prompt_style=$reset_style
  26.  
  27. command_style=$reset_style'\[\033[1;29m\]' # bold black
  28.  
  29. # Prompt variable:
  30.  
  31.  
  32. PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\w\$'"$command_style "
  33.  
  34.  
  35. # Reset color for command output
  36.  
  37. # (this one is invoked every time before a command is executed):
  38.  
  39. trap 'echo -ne "\033[00m"' DEBUG
  40.  
  41.  
  42. function prompt_command {
  43.  
  44.  
  45. # create a $fill of all screen width minus the time string and a space:
  46.  
  47. let fillsize=${COLUMNS}-9
  48.  
  49. fill=""
  50.  
  51. while [ "$fillsize" -gt "0" ]
  52.  
  53. do
  54.  
  55. fill="-${fill}" # fill with underscores to work on
  56.  
  57. let fillsize=${fillsize}-1
  58.  
  59. done
  60.  
  61.  
  62. # If this is an xterm set the title to user@host:dir
  63.  
  64. case "$TERM" in
  65.  
  66. xterm*|rxvt*)
  67.  
  68. bname=`basename "${PWD/$HOME/~}"`
  69.  
  70. echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
  71.  
  72. ;;
  73.  
  74. *)
  75.  
  76. ;;
  77.  
  78. esac
  79.  
  80.  
  81. }
  82.  
  83. PROMPT_COMMAND=prompt_command
  84.  
  85.