diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 40b2940..467f7d6 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -51,7 +51,7 @@ set -g mouse on set -g status-bg colour235 set -g status-fg colour255 -set -g status-left '#(sh ~/.tmux/health-indicator.sh #{client_prefix})#(~/.tmux/segment.sh end 24 29) ▣ #{session_windows} #{?session_many_attached,#(~/.tmux/subsegment.sh end) 🖥 #{session-attached},}#(~/.tmux/segment.sh end 29 71) #[fg=colour235]#H #(~/.tmux/segment.sh end 71 65) #[fg=colour235]#(whoami) #(~/.tmux/segment.sh end 65 235)' +set -g status-left '#(sh ~/.tmux/health-indicator.sh #{client_prefix})#(~/.tmux/segment.sh end 29) ▣ #{session_windows} #{?session_many_attached,#(~/.tmux/subsegment.sh end) 🖥 #{session-attached},}#(~/.tmux/segment.sh end 29 71) #[fg=colour235]#H #(~/.tmux/segment.sh end 71 65) #[fg=colour235]#(whoami) #(~/.tmux/segment.sh end 65 235)' set -g status-left-length 80 set -g status-right-length 120 set -g status-justify centre diff --git a/tmux/.tmux/health-indicator.sh b/tmux/.tmux/health-indicator.sh index 668f14f..e87c11c 100755 --- a/tmux/.tmux/health-indicator.sh +++ b/tmux/.tmux/health-indicator.sh @@ -9,23 +9,24 @@ normal='●' prefix='▲' if [ $1 -eq 1 ]; then - fore=$cnormal - back=$bnormal - sym=$normal - text="#S" -else fore=$cprefix back=$bprefix sym=$prefix text="#[bold]⌥#[unbold]" +else + fore=$cnormal + back=$bnormal + sym=$normal + text="#S" + fi if [ $(($(date +%s) % 2)) -eq 0 ]; then - printf "#[fg=$back,bg=$back] $sym #[fg=$fore]$text " + printf "#[fg=$fore,bg=$back] $sym #[fg=$fore]$text #[fg=$back]" else - printf "#[fg=$fore,bg=$back] $sym #[fg=$fore]$text " + printf "#[fg=$back,bg=$back] $sym #[fg=$fore]$text #[fg=$back]" fi #printf "#[fg=white,bg=red] $(date +%N) $@" -printf "#[fg=white]" +#printf "#[fg=white]" diff --git a/tmux/.tmux/segment.sh b/tmux/.tmux/segment.sh index 0080298..3a4f157 100755 --- a/tmux/.tmux/segment.sh +++ b/tmux/.tmux/segment.sh @@ -23,6 +23,16 @@ else echo "3" fi + +if [ -z "$from" ] ; then + before_start="#[fg=colour$to]" + before_end="#[bg=colour$to]" +else + before_start="#[fg=colour$to,bg=colour$from]" + before_end="#[fg=colour$from,bg=colour$to]" +fi + + case $side in start) case $shape in @@ -32,7 +42,7 @@ case $side in sharp | *) separator="\ue0b2";; esac - echo -e "#[fg=colour$to,bg=colour$from]$separator#[fg=white,bg=colour$to]";; + echo -e "$before_start$separator#[fg=white,bg=colour$to]";; end) case $shape in @@ -42,7 +52,7 @@ case $side in sharp | *) separator="\ue0b0";; esac - echo -e "#[fg=colour$from,bg=colour$to]$separator#[fg=white]";; + echo -e "$before_end$separator#[fg=white]";; esac