Posted By

willcodeforfood on 12/16/07


Tagged

bashrc


Versions (?)

bashrc profile


 / Published in: Other
 

URL: http://bbs.archlinux.org/viewtopic.php?t=21556

http://bbs.archlinux.org/viewtopic.php?t=21556

  1. #!/bin/sh
  2.  
  3.  
  4. ### ALIASES
  5.  
  6. alias ls="ls --color"
  7. alias ll="ls --color -lh"
  8. alias la="ls --color -a"
  9. alias pacs="pacsearch"
  10. alias vim="vim -y"
  11. alias nano="nano -w"
  12.  
  13.  
  14.  
  15.  
  16.  
  17. ### NICE COLOR BASH PROMPT
  18.  
  19. function bash_prompt
  20.  
  21. {
  22. local WHITE="[33[1;37m]"
  23. local default="[33[0;39m]"
  24. local BRIGHTGREEN="[33[1;32m]"
  25. local GREEN="[33[0;32m]"
  26. local CYAN="[33[0;36m]"
  27. local GRAY="[33[0;37m]"
  28. local RED="[33[0;31m]"
  29.  
  30. if [ `id -u` != "0" ]; then
  31. PS1="${GREEN}u${CYAN}@${GREEN}h ${CYAN}w${WHITE} ${default}$ "
  32. else
  33. PS1="${RED}u${CYAN}@${GREEN}h ${CYAN}w${WHITE} ${default}$ "
  34. fi
  35. }
  36.  
  37. bash_prompt
  38.  
  39.  
  40.  
  41.  
  42.  
  43. ### COLORIZE PACMAN (PACS)
  44.  
  45. pacsearch () {
  46. echo -e "$(pacman -Ss $@ | sed
  47. -e 's#current/.*#\033[1;31m&\033[0;37m#g'
  48. -e 's#extra/.*#\033[0;32m&\033[0;37m#g'
  49. -e 's#community/.*#\033[1;35m&\033[0;37m#g'
  50. -e 's#^.*/.* [0-9].*#\033[0;36m&\033[0;37m#g' )"
  51. }

Report this snippet  

You need to login to post a comment.