From 7db892408fce0643687c2aa5f8d7ce80a2dfd4b6 Mon Sep 17 00:00:00 2001 From: Parth Laxmikant Kolekar Date: Sun, 5 Nov 2017 14:33:23 +0900 Subject: [PATCH 1/4] Update powerlevel9k.zsh-theme Allow showing the number of jobs even if there is <= 1 job present. --- powerlevel9k.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index f33d5a9a..e8872d19 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -305,6 +305,7 @@ prompt_aws_eb_env() { # Segment to indicate background jobs with an icon. set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true +set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE false prompt_background_jobs() { local background_jobs_number=${$(jobs -l | wc -l)// /} local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'` @@ -313,7 +314,7 @@ prompt_background_jobs() { fi if [[ background_jobs_number -gt 0 ]]; then local background_jobs_number_print="" - if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && [[ "$background_jobs_number" -gt 1 ]]; then + if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && ([[ "$background_jobs_number" -gt 1 ]] || [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE" == "true" ]]); then background_jobs_number_print="$background_jobs_number" fi "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON' From 6243c2e72f6d67de69d456286f3dc1bfa915436e Mon Sep 17 00:00:00 2001 From: Parth Kolekar Date: Sun, 5 Nov 2017 14:43:10 +0900 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7c1974de..ad5d1382 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,7 @@ your `~/.zshrc`: | Variable | Default Value | Description | |----------|---------------|-------------| |`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE`|`true`|If there is more than one background job, this segment will show the number of jobs. Set this to `false` to turn this feature off.| +`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE`|`false`|Show the jobs count even if it is less than one and if this segment is being shown| ##### battery From 698697a710321c6dcf2b334eca04ffb395062c5d Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Fri, 10 Nov 2017 10:28:10 -0500 Subject: [PATCH 3/4] Minor README cleanup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad5d1382..d9353b40 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ your `~/.zshrc`: | Variable | Default Value | Description | |----------|---------------|-------------| |`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE`|`true`|If there is more than one background job, this segment will show the number of jobs. Set this to `false` to turn this feature off.| -`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE`|`false`|Show the jobs count even if it is less than one and if this segment is being shown| +`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS`|`false`|Always show the jobs count (even if it's zero).| ##### battery From 46fb03ed1982cfd3484d9309c66a086f29278557 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Fri, 10 Nov 2017 10:28:50 -0500 Subject: [PATCH 4/4] Updating variable name for always showing jobs count --- powerlevel9k.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index e8872d19..167e3379 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -305,7 +305,7 @@ prompt_aws_eb_env() { # Segment to indicate background jobs with an icon. set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true -set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE false +set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS false prompt_background_jobs() { local background_jobs_number=${$(jobs -l | wc -l)// /} local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'` @@ -314,7 +314,7 @@ prompt_background_jobs() { fi if [[ background_jobs_number -gt 0 ]]; then local background_jobs_number_print="" - if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && ([[ "$background_jobs_number" -gt 1 ]] || [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_EVEN_ONE" == "true" ]]); then + if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && ([[ "$background_jobs_number" -gt 1 ]] || [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS" == "true" ]]); then background_jobs_number_print="$background_jobs_number" fi "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON'