Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Separated special caharacters functions for prompt. And cleaned bashrc.

  • Loading branch information...
commit 3d8dcd2c25dc20947424df3c60510e5ce027fda8 1 parent 93020c0
kyamaguchi authored

Showing 2 changed files with 27 additions and 25 deletions. Show diff stats Hide diff stats

  1. +7 25 .bashrc
  2. +20 0 .special_characters
32 .bashrc
@@ -11,34 +11,16 @@ export COPYFILE_DISABLE=true
11 11 if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
12 12
13 13 ## Terminal
14   -function spchar {
15   - # chars=("ॐ" "†" "※" "⁂" "℗" "⇨" "∞" "∭" "∴" "⌛" "⌨" "◎" "☀" "☁" "☂" "☃" "☄" "★" "☑" "☒" "☕" "☘" "☛" "☞" "☠" "☪" "☯" "☹" "☺" "♕" "♖" "♗" "♘" "♞" "♠" "♣" "♥" "♦" "♨" "♩" "♪" "♫" "♭" "♯" "♻" "⚀" "⚁" "⚂" "⚃" "⚄" "⚅" "⚐" "⚒" "⚓" "⚔" "⚛" "⚠" "⚡" "✂" "✆" "✈" "✌" "✍" "✏" "✓" "✖" "✗" "✞" "✡" "✪" "✯" "✹" "❀" "❄" "❖" "➔" "➜" "➠" "➢" "➥" "➲" "➾" "")
16   - chars=("¡" "¿" "ॐ" "†" "※" "⁂" "⁋" "℗" "⇨" "∞" "∭" "∴" "⌛" "⌨" "⍟" "⎋" "◎" "☀" "☁" "☂" "☃" "☄" "★" "☑" "☒" "☕" "☘" "☛" "☞" "☠" "☪" "☫" "☬" "☯" "☸" "☹" "☺" "♕" "♖" "♗" "♘" "♞" "♠" "♣" "♥" "♦" "♨" "♩" "♪" "♫" "♭" "♯" "♻" "⚀" "⚁" "⚂" "⚃" "⚄" "⚅" "⚐" "⚒" "⚓" "⚔" "⚕" "⚚" "⚛" "⚠" "⚡" "✂" "✆" "✈" "✌" "✍" "✏" "✓" "✖" "✗" "✞" "✡" "✪" "✯" "✹" "❀" "❄" "❖" "➔" "➜" "➠" "➢" "➥" "➲" "➾" "")
17   - RANDOM=$$$(date +%s)
18   - echo ${chars[$RANDOM % ${#chars[@]}]}
19   -}
20   -# function spchar2 { chars=("☠" "☺" "☀" "☁" "☂" "☃"); RANDOM=$$$(date +%s); echo ${chars[$RANDOM % ${#chars[@]}]}; }
21   -
  14 +if [ -f $HOME/.special_characters ]; then
  15 + source $HOME/.special_characters
  16 +else
  17 + function spchar {
  18 + echo "$"
  19 + }
  20 +fi
22 21 export PS1='\[\e[0;44;93m\]\W\[\e[0m\] \[\e[1;35m\]`date +'%H:%M'` \[\e[1;31m\]`spchar` \[\e[0m\]'
23   -# export PS1='\[\e[0;44;93m\]\W\[\e[0m\] \[\e[1;35m\]`date +'%H:%M'` \[\e[1;31m\] \[\e[0m\]'
24 22 # export PS1="\W \u\$ "
25 23 export PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007" ; echo -n $GEM_HOME | sed -e "s/.*\///" | tr -d "\012" ; git branch --no-color 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(\1)/" | tr -d "\012" ; echo'
26   -#export PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007";history -a ; history -n ; echo -n $GEM_HOME | sed -e "s/.*\///" | tr -d "\012" ; git branch --no-color 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(\1)/" | tr -d "\012" ; echo'
27   -#export PROMPT_COMMAND='echo -n $GEM_HOME | sed -e "s/.*\///" | tr -d "\012" ; git branch --no-color 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(\1)/" | tr -d "\012" ; echo'
28   -#export PROMPT_COMMAND='echo $GEM_HOME'
29   -# export PROMPT_COMMAND='ruby -v;echo $GEM_HOME'
30   -# export PROMPT_COMMAND='ruby -v'
31   -
32   -#case $TERM in
33   -# xterm*)
34   -# # PS1="\[\033]0;\u@\h: \w\007\]bash\\$ "
35   -# # PS1="\[\033[1;37m\]\[\033[41m\][\$(date +%H:%M:%S)][\u@\h \W]# \[\033[0m\]"
36   -# PS1="\W \u\$ "
37   -# ;;
38   -# *)
39   -# PS1="\W \u\$ "
40   -# ;;
41   -#esac
42 24
43 25 # colored grep
44 26 export GREP_OPTIONS='--color=auto'
20 .special_characters
... ... @@ -0,0 +1,20 @@
  1 +if [[ $OSTYPE == darwin* ]] ; then
  2 + mac_version=`system_profiler SPSoftwareDataType | grep "System Version" | awk '{print $6}' | sed "s:.[[:digit:]]*.$::g"`
  3 + if [[ "$mac_version" == '10.7' ]] ; then
  4 + function spchar {
  5 + chars=("¡" "¿" "ॐ" "†" "※" "⁂" "⁋" "℗" "⇨" "∞" "∭" "∴" "⌛" "⌨" "⍟" "⎋" "◎" "☀" "☁" "☂" "☃" "☄" "★" "☑" "☒" "☕" "☘" "☛" "☞" "☠" "☪" "☫" "☬" "☯" "☸" "☹" "☺" "♕" "♖" "♗" "♘" "♞" "♠" "♣" "♥" "♦" "♨" "♩" "♪" "♫" "♭" "♯" "♻" "⚀" "⚁" "⚂" "⚃" "⚄" "⚅" "⚐" "⚒" "⚓" "⚔" "⚕" "⚚" "⚛" "⚠" "⚡" "✂" "✆" "✈" "✌" "✍" "✏" "✓" "✖" "✗" "✞" "✡" "✪" "✯" "✹" "❀" "❄" "❖" "➔" "➜" "➠" "➢" "➥" "➲" "➾" "" "🌋" "🌏" "🌛" "🌠" "🍍" "🍏" "🍕" "🍗" "🍫" "🎠" "🎤" "🎳" "🎴" "🎼" "👓" "💯" "💳" "🔖" "😄")
  6 + RANDOM=$$$(date +%s)
  7 + echo ${chars[$RANDOM % ${#chars[@]}]}
  8 + }
  9 + else
  10 + function spchar {
  11 + chars=("ॐ" "†" "※" "⁂" "℗" "⇨" "∞" "∭" "∴" "⌛" "⌨" "◎" "☀" "☁" "☂" "☃" "☄" "★" "☑" "☒" "☕" "☘" "☛" "☞" "☠" "☪" "☯" "☹" "☺" "♕" "♖" "♗" "♘" "♞" "♠" "♣" "♥" "♦" "♨" "♩" "♪" "♫" "♭" "♯" "♻" "⚀" "⚁" "⚂" "⚃" "⚄" "⚅" "⚐" "⚒" "⚓" "⚔" "⚛" "⚠" "⚡" "✂" "✆" "✈" "✌" "✍" "✏" "✓" "✖" "✗" "✞" "✡" "✪" "✯" "✹" "❀" "❄" "❖" "➔" "➜" "➠" "➢" "➥" "➲" "➾" "")
  12 + RANDOM=$$$(date +%s)
  13 + echo ${chars[$RANDOM % ${#chars[@]}]}
  14 + }
  15 + fi
  16 +else
  17 + function spchar {
  18 + echo "$"
  19 + }
  20 +fi

0 comments on commit 3d8dcd2

Please sign in to comment.
Something went wrong with that request. Please try again.