From 50070fe6c7291a148c8d03e15c9b6a72cde3ca13 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sat, 16 Feb 2019 12:34:35 +0530 Subject: [PATCH] Add path, newline plugins --- plugins/newline.sh | 15 +++++++++++++++ plugins/path.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 plugins/newline.sh create mode 100644 plugins/path.sh diff --git a/plugins/newline.sh b/plugins/newline.sh new file mode 100644 index 0000000..1245940 --- /dev/null +++ b/plugins/newline.sh @@ -0,0 +1,15 @@ +function wish_newline_start() { + return 0 +} + +function wish_newline_end() { + return 1 +} + +function wish_newline_set_colors() { + return +} + +function wish_newline_main() { + PS1="$PS1\n" +} diff --git a/plugins/path.sh b/plugins/path.sh new file mode 100644 index 0000000..af0c558 --- /dev/null +++ b/plugins/path.sh @@ -0,0 +1,26 @@ +function wish_path_start() { + return 0 +} + +function wish_path_end() { + return 0 +} + +function wish_path_set_colors() { + WISH_PATH_FG=${WISH_PATH_FG:-$WISH_DEFAULT_FG} + WISH_PATH_BG=${WISH_PATH_BG:-$WISH_DEFAULT_BG} +} + +function wish_path_main() { + if [[ $fg -eq -1 ]]; then + local fg="\[\033[0;5;0m\]" + else + local fg="\[\033[38;5;${WISH_PATH_FG}m\]" + fi + if [[ $bg -eq -1 ]]; then + local bg="\[\033[0;5;0m\]" + else + local bg="\[\033[48;5;${WISH_PATH_BG}m\]" + fi + PS1="$PS1$fg${bg} \w " +}