diff options
author | johannst <stoelp@eit.uni-kl.de> | 2018-04-04 17:29:18 +0900 |
---|---|---|
committer | johannst <stoelp@eit.uni-kl.de> | 2018-04-04 17:29:18 +0900 |
commit | f07e889cbd2de415dad2c3921350b00d451c37cb (patch) | |
tree | ebed26e83a43a453b2be89c5864b2f4e56bab44d | |
parent | 9bb1012e7b758bd09e13e340a63a3f05af91b1af (diff) | |
download | dotfiles-f07e889cbd2de415dad2c3921350b00d451c37cb.tar.gz dotfiles-f07e889cbd2de415dad2c3921350b00d451c37cb.zip |
added colored printer in bashrc
-rw-r--r-- | bashrc | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -113,7 +113,7 @@ function pwd_formater() { export PS1="\[${BCol_BrightRed}\]::\[${BCol_MediumGray}\]\u\[${BCol_BrightRed}\]::\[${BCol_LightGray}\]\H\[${BCol_BrightRed}\]:\[${BCol_DarkGray}\]$(tty) \[${BCol_LightGray}\] - \[${BCol_DarkBlue}\]\w\n\ \[${BCol_NoColor}\][\$(ret=\$?; if [[ \$ret == 0 ]]; then echo \"\[${BCol_BrightGreen}\]\$ret\"; else echo \"\[${BCol_BrightRed}\]\$ret\"; fi)\[${BCol_NoColor}\]] \$> " -export PROMPT_COMMAND="echo -e ''" +#$export PROMPT_COMMAND="echo -e ''" #}}} #{{{ ls colors @@ -121,3 +121,23 @@ export PROMPT_COMMAND="echo -e ''" export LS_COLORS='di=94:ln=96:or=96;41:so=0:pi=0:ex=01;92:bd=0;42:cd=0;42:su=0:sg=0:tw=30;44:ow=30;44' #}}} +#{{{ colored printers + + function info() { + local msg=$1 + echo -e "${BCol_BrightGreen}[INFO]: ${msg}${BCol_NoColor}" + } + + function warn () { + local msg=$1 + echo -e "${BCol_YellowOrange}[WARN]: ${msg}${BCol_NoColor}" + } + + function err() { + local msg=$1 + local exit=${2:-exit} + echo -e "${BCol_BrightRed}[ERR]: ${msg}${BCol_NoColor}" + [[ "$exit" == "exit" ]] && exit 1 || return 0 + } + + #}}} |