From 079533b686e65f2b720ada61e813cd4423711b76 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sat, 12 Oct 2019 22:36:47 +0530 Subject: [PATCH] Add path_powerline --- plugins/path_powerline.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugins/path_powerline.sh diff --git a/plugins/path_powerline.sh b/plugins/path_powerline.sh new file mode 100644 index 0000000..0198577 --- /dev/null +++ b/plugins/path_powerline.sh @@ -0,0 +1,24 @@ +function wish_path_powerline_start() { + return 0 +} + +function wish_path_powerline_end() { + return 0 +} + +function wish_path_powerline_set_colors() { + WISH_PATH_POWERLINE_FG=${WISH_PATH_POWERLINE_FG:-$WISH_DEFAULT_FG} + WISH_PATH_POWERLINE_BG=${WISH_PATH_POWERLINE_BG:-$WISH_DEFAULT_BG} + WISH_PATH_POWERLINE_NO_WRITE_SUFFIX=${WISH_PATH_POWERLINE_NO_WRITE_SUFFIX:- } +} + +function wish_path_powerline_main() { + local path="${PWD/#$HOME/\~}" + local path="${path//\//  }" + if [[ -w $PWD ]]; then + local path=" $path " + else + local path=" $path$WISH_PATH_POWERLINE_NO_WRITE_SUFFIX " + fi + wish_append $WISH_PATH_POWERLINE_BG $WISH_PATH_POWERLINE_FG "$path" +}