From 6eb35644e6c6009c88454c7ca7cfbecdd856b037 Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Mon, 9 Jul 2018 21:53:27 +0000 Subject: [PATCH 1/2] Add powerline initialization plugin Initializes powerline per the official powerline documentation: https://powerline.readthedocs.io/en/master/usage/shell-prompts.html#bash-prompt --- plugins/available/powerline.plugin.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/available/powerline.plugin.bash diff --git a/plugins/available/powerline.plugin.bash b/plugins/available/powerline.plugin.bash new file mode 100644 index 00000000..8e148f1e --- /dev/null +++ b/plugins/available/powerline.plugin.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +cite about-plugin +about-plugin 'enables powerline daemon' + +command -v powerline-daemon &>/dev/null || return +powerline-daemon -q +POWERLINE_BASH_CONTINUATION=1 +POWERLINE_BASH_SELECT=1 +bashPowerlineInit=$(python -c \ + "import os; \ + import powerline;\ + print(os.path.join(os.path.dirname(\ + powerline.__file__),\ + 'bindings', \ + 'bash', \ + 'powerline.sh'))") +[ -e $bashPowerlineInit ] || return +. $bashPowerlineInit From 1a81ca8b8dd3ce086eb5e3daf95ba813fc37b1a4 Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Mon, 9 Jul 2018 22:14:17 +0000 Subject: [PATCH 2/2] Don't redefine powerline theme functions In the case where a powerline theme is enabled in bash-it, it seems prudent to avoid touching any of these functions. --- plugins/available/powerline.plugin.bash | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/available/powerline.plugin.bash b/plugins/available/powerline.plugin.bash index 8e148f1e..0388aa37 100644 --- a/plugins/available/powerline.plugin.bash +++ b/plugins/available/powerline.plugin.bash @@ -5,6 +5,13 @@ about-plugin 'enables powerline daemon' command -v powerline-daemon &>/dev/null || return powerline-daemon -q + +#the following should not be executed if bashit powerline themes in use +case "$BASH_IT_THEME" in + *powerline*) + return + ;; +esac POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 bashPowerlineInit=$(python -c \