Add custom_text, exit_code_smiley plugins

This commit is contained in:
Ceda EI 2019-02-17 13:00:52 +05:30
parent 25e5c14130
commit 713da785c4
2 changed files with 40 additions and 0 deletions

18
plugins/custom_text.sh Normal file
View File

@ -0,0 +1,18 @@
function wish_custom_text_start() {
return 0
}
function wish_custom_text_end() {
return 0
}
function wish_custom_text_set_colors() {
WISH_CUSTOM_TEXT_FG=${WISH_CUSTOM_TEXT_FG:-$WISH_DEFAULT_FG}
WISH_CUSTOM_TEXT_BG=${WISH_CUSTOM_TEXT_BG:-$WISH_DEFAULT_BG}
local default_text='To set custom text here, add WISH_CUSTOM_TEXT="your text" in ~/.bashrc'
WISH_CUSTOM_TEXT=${WISH_CUSTOM_TEXT:-$default_text}
}
function wish_custom_text_main() {
wish_append $WISH_CUSTOM_TEXT_BG $WISH_CUSTOM_TEXT_FG "$WISH_CUSTOM_TEXT"
}

View File

@ -0,0 +1,22 @@
function wish_exit_code_smiley_start() {
return 0
}
function wish_exit_code_smiley_end() {
return 0
}
function wish_exit_code_smiley_set_colors() {
WISH_EXIT_CODE_SMILEY_FG=${WISH_EXIT_CODE_SMILEY_FG:-$WISH_DEFAULT_FG}
WISH_EXIT_CODE_SMILEY_BG=${WISH_EXIT_CODE_SMILEY_BG:-$WISH_DEFAULT_BG}
WISH_EXIT_CODE_SMILEY_PASS=${WISH_EXIT_CODE_SMILEY_PASS:- :) }
WISH_EXIT_CODE_SMILEY_FAIL=${WISH_EXIT_CODE_SMILEY_FAIL:- :( }
}
function wish_exit_code_smiley_main() {
if [[ $1 == 0 ]]; then
wish_append $WISH_EXIT_CODE_SMILEY_BG $WISH_EXIT_CODE_SMILEY_FG "$WISH_EXIT_CODE_SMILEY_PASS"
else
wish_append $WISH_EXIT_CODE_SMILEY_BG $WISH_EXIT_CODE_SMILEY_FG "$WISH_EXIT_CODE_SMILEY_FAIL"
fi
}