Kvaks

bashrc-test

Aug 30th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1.  
  2. #define colors
  3. red="\[\033[0;38;5;1m\]"
  4. green="\[\033[0;38;5;2m\]"
  5. nocolor='\e[0m'
  6.  
  7. #promptcolor=$green
  8.  
  9. function pre_prompt {
  10.  
  11. if (echo $PWD |grep -q $HOME);then
  12.     promptcolor=$green
  13.     #echo "Home" #debug
  14. else
  15.     promptcolor=$red
  16.     #echo "Away" #debug
  17. fi
  18.  
  19. }
  20.  
  21. PROMPT_COMMAND=pre_prompt
  22.  
  23. PS1="$promptcolor( $debugtxt ) $nocolor$ "
Advertisement
Add Comment
Please, Sign In to add comment