dot

packages and services management
Log | Files | Refs | README

commit 844828b0af44b74c97094f147ac735297cb74c67
parent 79ce311dc4f8862d3f758b81fc411e58cd120ba9
Author: josuah <mail@josuah.net>
Date:   Wed,  5 Oct 2016 23:42:11 -0400

Better tmux status segment spacing handling

Diffstat:
Mshell/.profile | 1+
Mtmux/.config/tmux/status | 10++++++----
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/shell/.profile b/shell/.profile @@ -231,6 +231,7 @@ color() } + # STARTUP 2016-10-05 #------------------------------------------------------------------------------- diff --git a/tmux/.config/tmux/status b/tmux/.config/tmux/status @@ -15,7 +15,7 @@ help='USAGE: ~/.tmux/status segmentname1 segmentname2 ...' PWD="$(tmux display -p '#{pane_current_path}')" BACKGROUND=black -SEPARATOR="${SEPARATOR- }" +SEPARATOR="${SEPARATOR- }" # FUNCTIONS 2016-10-05 @@ -58,14 +58,13 @@ segment_git() cd "$PWD" if git rev-parse &> /dev/null then - git='±' branch="$(git branch | sed -n 's/^\* // p')" status="$(git status --porcelain | wc -l)" [ "$status" -gt 0 ] && color=red || color=green fi - printf '%s\n' "$color" "$git" "$branch ${status#0}" + printf '%s\n' "$color" "$branch" "${status#0}" } segment_clock() @@ -93,8 +92,11 @@ do then printf '#[bg=%s,fg=%s] %s #[default]' \ "$BACKGROUND" "$color" "$text" fi + + if [ "$label$text" -a $# -gt 1 ] + then printf '%s' "$SEPARATOR" + fi } shift - [ $# -gt 0 ] && printf '%s' "$SEPARATOR" done