diff --git a/plugins/dummy.sh b/plugins/dummy.sh new file mode 100644 index 0000000..eee0c93 --- /dev/null +++ b/plugins/dummy.sh @@ -0,0 +1,26 @@ +function wish_dummy_start() { + return 0 +} + +function wish_dummy_end() { + return 0 +} + +function wish_dummy_set_colors() { + WISH_DUMMY_FG=${WISH_DUMMY_FG:-$WISH_DEFAULT_FG} + WISH_DUMMY_BG=${WISH_DUMMY_BG:-$WISH_DEFAULT_BG} +} + +function wish_dummy_main() { + if [[ $fg -eq -1 ]]; then + local fg="\[\033[0;5;0m\]" + else + local fg="\[\033[38;5;${WISH_DUMMY_FG}m\]" + fi + if [[ $bg -eq -1 ]]; then + local bg="\[\033[0;5;0m\]" + else + local bg="\[\033[48;5;${WISH_DUMMY_BG}m\]" + fi + PS1="$PS1$bg${fg}dummy" +} diff --git a/themes/plain.sh b/themes/plain.sh new file mode 100644 index 0000000..bb4fac1 --- /dev/null +++ b/themes/plain.sh @@ -0,0 +1,2 @@ +WISH_DEFAULT_BG=-1 +WISH_DEFAULT_FG=-1 diff --git a/wish.sh b/wish.sh index b83eb71..a3c6fb8 100644 --- a/wish.sh +++ b/wish.sh @@ -18,6 +18,11 @@ function wish_init() { done [[ $? -ne 0 ]] && echo "Theme $WISH_THEME not found." >&2 + + # Call plugins to set colors + for i in ${WISH_PLUGINS[@]}; do + eval wish_$(echo $i)_set_colors $prev + done }