diff options
author | v1rgul <v1rgul.42@gmail.com> | 2016-01-18 07:11:05 +0300 |
---|---|---|
committer | v1rgul <v1rgul.42@gmail.com> | 2016-01-18 07:11:05 +0300 |
commit | 11d00ce71316153f7cf2dabf5a40b0f24064d9e8 (patch) | |
tree | 74d0efb289837e88dc5d33ce4325d83920af34c2 /powerlevel9k.zsh-theme | |
parent | a0c664b1743131888cd7f72e94135edaa79dad2b (diff) |
background_jobs: show number if verbose
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index c8879dbc..eba94629 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -290,9 +290,15 @@ prompt_aws() { } # Segment to indicate background jobs with an icon. +set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true prompt_background_jobs() { - if [[ $(jobs -l | wc -l) -gt 0 ]]; then - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "" 'BACKGROUND_JOBS_ICON' + local background_jobs_number=$(jobs -l | wc -l) + if [[ background_jobs_number -gt 0 ]]; then + local background_jobs_number_print="" + if [[ POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE ]] && [[ background_jobs_number -gt 1 ]]; then + background_jobs_number_print="$background_jobs_number" + fi + "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON' fi } |