Fixed background color on prefix indicator segment

This commit is contained in:
2023-03-27 16:44:07 +02:00
parent 74f7e49a25
commit d745dcb48c
3 changed files with 22 additions and 11 deletions

View File

@@ -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

View File

@@ -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]"

View File

@@ -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