From 39b5d0b042d3f82ab375e0af4b09db8ba0486024 Mon Sep 17 00:00:00 2001 From: goromlagche Date: Wed, 12 Aug 2015 00:20:50 +0530 Subject: [PATCH 1/3] adding time to bobby --- themes/base.theme.bash | 6 ++++++ themes/bobby/bobby.theme.bash | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 989e7cbc..853505e9 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -13,6 +13,8 @@ SCM_THEME_TAG_PREFIX='tag:' SCM_THEME_COMMIT_PREFIX='commit:' SCM_THEME_REMOTE_PREFIX='' +CLOCK_CHAR='☆' + SCM_GIT_SHOW_DETAILS=${SCM_GIT_SHOW_DETAILS:=true} SCM_GIT='git' @@ -291,6 +293,10 @@ function prompt_char { scm_char } +function clock_char { + echo -e "$CLOCK_CHAR" +} + if [ ! -e $BASH_IT/plugins/enabled/battery.plugin.bash ]; then # if user has installed battery plugin, skip this... function battery_charge (){ diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index 308b412b..eab8a0ec 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -14,7 +14,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " + PS1="\n${bold_cyan}\T ${red}$(clock_char) ${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " } PROMPT_COMMAND=prompt_command; From e525ea1fbea7eff3d1a42ebe8e507f46b09d459c Mon Sep 17 00:00:00 2001 From: goromlagche Date: Wed, 12 Aug 2015 22:59:18 +0530 Subject: [PATCH 2/3] clock_check added, datetime added instaed of clock, also battery_percentage added --- themes/base.theme.bash | 24 ++++++++++++++++++++---- themes/bobby/bobby.theme.bash | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 853505e9..283dd1d3 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -14,6 +14,8 @@ SCM_THEME_COMMIT_PREFIX='commit:' SCM_THEME_REMOTE_PREFIX='' CLOCK_CHAR='☆' +CLOCK_CHECK=${CLOCK_CHECK:=true} +BATTER_PERCENTAGE_CHECK=${BATTER_PERCENTAGE_CHECK:=true} SCM_GIT_SHOW_DETAILS=${SCM_GIT_SHOW_DETAILS:=true} @@ -294,14 +296,28 @@ function prompt_char { } function clock_char { - echo -e "$CLOCK_CHAR" + if [[ "${CLOCK_CHECK}" = true ]]; then + DATE_STRING=$(date +"%Y-%m-%d %H:%M:%S") + echo -e "${bold_cyan}$DATE_STRING ${red}$CLOCK_CHAR" + fi +} + +function battery_char { + if [[ "${BATTER_PERCENTAGE_CHECK}" = true ]]; then + echo -e "${bold_red}$(battery_percentage)%" + fi } if [ ! -e $BASH_IT/plugins/enabled/battery.plugin.bash ]; then -# if user has installed battery plugin, skip this... + # if user has installed battery plugin, skip this... function battery_charge (){ - # no op - echo -n + # no op + echo -n + } + + function battery_char (){ + # no op + echo -n } fi diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index eab8a0ec..e0011759 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -14,7 +14,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="\n${bold_cyan}\T ${red}$(clock_char) ${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " + PS1="\n$(battery_char) $(clock_char) ${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " } PROMPT_COMMAND=prompt_command; From f7877a1ef8e8be45167b34fb2b5b8c1056c254c4 Mon Sep 17 00:00:00 2001 From: goromlagche Date: Thu, 27 Aug 2015 19:00:18 +0530 Subject: [PATCH 3/3] prefixing THEME to BATTERY_CHECK and CLOCK_CHECK --- themes/base.theme.bash | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 283dd1d3..c199146d 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -14,8 +14,8 @@ SCM_THEME_COMMIT_PREFIX='commit:' SCM_THEME_REMOTE_PREFIX='' CLOCK_CHAR='☆' -CLOCK_CHECK=${CLOCK_CHECK:=true} -BATTER_PERCENTAGE_CHECK=${BATTER_PERCENTAGE_CHECK:=true} +THEME_CLOCK_CHECK=${THEME_CLOCK_CHECK:=true} +THEME_BATTERY_PERCENTAGE_CHECK=${THEME_BATTERY_PERCENTAGE_CHECK:=true} SCM_GIT_SHOW_DETAILS=${SCM_GIT_SHOW_DETAILS:=true} @@ -296,14 +296,14 @@ function prompt_char { } function clock_char { - if [[ "${CLOCK_CHECK}" = true ]]; then + if [[ "${THEME_CLOCK_CHECK}" = true ]]; then DATE_STRING=$(date +"%Y-%m-%d %H:%M:%S") echo -e "${bold_cyan}$DATE_STRING ${red}$CLOCK_CHAR" fi } function battery_char { - if [[ "${BATTER_PERCENTAGE_CHECK}" = true ]]; then + if [[ "${THEME_BATTERY_PERCENTAGE_CHECK}" = true ]]; then echo -e "${bold_red}$(battery_percentage)%" fi } @@ -320,4 +320,3 @@ if [ ! -e $BASH_IT/plugins/enabled/battery.plugin.bash ]; then echo -n } fi -