diff options
author | LAN-TW <lantw44@gmail.com> | 2012-08-25 14:56:40 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2012-08-25 14:56:40 +0800 |
commit | beb600507a976e29445ecee1fe3e54bfcb100816 (patch) | |
tree | a1cc7c323b3e4ddd0d2f4d8d7bc24574c11efdf0 /bash_include | |
parent | 9ae3ef7be164c291e8b0f95a9e3f08bba7f92c7a (diff) | |
download | configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar.gz configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar.bz2 configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar.lz configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar.xz configfile-beb600507a976e29445ecee1fe3e54bfcb100816.tar.zst configfile-beb600507a976e29445ecee1fe3e54bfcb100816.zip |
bash_include: 加入透過 .bash_addps 強調正在使用的主機位置bash_include-20120825
Diffstat (limited to 'bash_include')
-rw-r--r-- | bash_include | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/bash_include b/bash_include index b353480..1cac71a 100644 --- a/bash_include +++ b/bash_include @@ -4,6 +4,10 @@ # # -- UTF-8 -- # +# 設定用外部檔案: +# (1) 若 .bash_title 存在且未設定自動修改視窗標題,則依照本檔案內定規則修改 +# (2) 若 .bash_addps 存在,則第一行的的內容會加到 colorprompting 變數,第二 +# 行的內容會加到 nocolorprompting 變數 #### if tty -s; then interactive_shell=1; fi if [[ "$-" == *i* ]] ; then interactive_shell=1; fi @@ -13,8 +17,8 @@ if [[ "$-" == *i* ]] ; then interactive_shell=1; fi # Internal Variables -colorprompting='\[\e[1;31m\]\!\[\e[m\] [\[\e[1;33m\]\u\[\e[m\]@\[\e[1;32m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]]\$ ' -nocolorprompting='\! [\u@\h \w]\$ ' +colorprompting='\[\e[1;31m\]\!\[\e[m\] [\[\e[1;33m\]\u\[\e[m\]@\[\e[1;32m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]]' +nocolorprompting='\! [\u@\h \w]' if [ "$SSH_CONNECTION" ] then @@ -22,6 +26,26 @@ then nocolorprompting="*$nocolorprompting" fi +if [ -f "$HOME/.bash_addps" ] +then + exec 3< "$HOME/.bash_addps" + read -u 3 -r oneline + colorprompting="$oneline $colorprompting" + read -u 3 -r oneline + nocolorprompting="$oneline $nocolorprompting" + exec 3<&- + unset oneline +fi + +if [ "$WINDOW" ] +then + colorprompting="$colorprompting<$WINDOW>" + nocolorprompting="$nocolorprompting<$WINDOW>" +fi + +colorprompting="${colorprompting}\$ " +nocolorprompting="${nocolorprompting}\$ " + historycountfile="$HOME/.bash_history.count" historybackupfile="$HOME/.bash_history.bak" bgrunfiledir="$HOME/tmp/bgrun-`whoami`" |