mirror of
https://github.com/HerrCraziDev/dotfiles.git
synced 2026-04-20 14:34:21 +02:00
made segment params optional and better prefix status
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.swp
|
||||||
@@ -51,7 +51,7 @@ set -g mouse on
|
|||||||
|
|
||||||
set -g status-bg colour235
|
set -g status-bg colour235
|
||||||
set -g status-fg colour255
|
set -g status-fg colour255
|
||||||
set -g status-left '#(sh ~/.tmux/health-indicator.sh #{client_prefix})#S #(~/.tmux/segment.sh end 31 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 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-length 80
|
set -g status-left-length 80
|
||||||
set -g status-right-length 120
|
set -g status-right-length 120
|
||||||
set -g status-justify centre
|
set -g status-justify centre
|
||||||
|
|||||||
@@ -1,23 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cnormal1='colour24'
|
cnormal='colour255'
|
||||||
cnormal2='colour255'
|
|
||||||
cprefix='colour238'
|
cprefix='colour238'
|
||||||
|
|
||||||
bnormal='colour24'
|
bnormal='colour24'
|
||||||
bprefix='colour208'
|
bprefix='colour172'
|
||||||
normal='●'
|
normal='●'
|
||||||
prefix='▲'
|
prefix='▲'
|
||||||
|
|
||||||
if [ $1 -eq 1 ]; then
|
if [ $1 -eq 1 ]; then
|
||||||
printf "#[fg=$cprefix,bg=$bprefix] $prefix "
|
fore=$cnormal
|
||||||
|
back=$bnormal
|
||||||
|
sym=$normal
|
||||||
|
text="#S"
|
||||||
else
|
else
|
||||||
|
fore=$cprefix
|
||||||
|
back=$bprefix
|
||||||
|
sym=$prefix
|
||||||
|
text="#[bold]⌥#[unbold]"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $(($(date +%s) % 2)) -eq 0 ]; then
|
if [ $(($(date +%s) % 2)) -eq 0 ]; then
|
||||||
printf "#[fg=$cnormal1,bg=$bnormal] $normal "
|
printf "#[fg=$back,bg=$back] $sym #[fg=$fore]$text "
|
||||||
else
|
else
|
||||||
printf "#[fg=$cnormal2,bg=$bnormal] $normal "
|
printf "#[fg=$fore,bg=$back] $sym #[fg=$fore]$text "
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#printf "#[fg=white,bg=red] $(date +%N) $@"
|
#printf "#[fg=white,bg=red] $(date +%N) $@"
|
||||||
printf "#[fg=white]"
|
printf "#[fg=white]"
|
||||||
|
|||||||
@@ -1,26 +1,48 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$1" ] ; then
|
||||||
|
printf "#[fg=white,bg=red]\ue0b2"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
side=$1
|
||||||
|
|
||||||
case $1 in
|
if [ -n "$3" ] && [[ $3 =~ ^[0-9]+$ ]] ; then
|
||||||
|
# $3 was provided and is a number
|
||||||
|
from=$2
|
||||||
|
to=$3
|
||||||
|
shape=$4
|
||||||
|
echo "1"
|
||||||
|
elif [ -z "$3" ] ; then
|
||||||
|
# $3 was null
|
||||||
|
to=$2
|
||||||
|
echo "2"
|
||||||
|
else
|
||||||
|
# $3 was provided but not a number (assumed shape)
|
||||||
|
to=$2
|
||||||
|
shape=$3
|
||||||
|
echo "3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $side in
|
||||||
start)
|
start)
|
||||||
case $4 in
|
case $shape in
|
||||||
round)
|
round)
|
||||||
separator="\ue0b6";;
|
separator="\ue0b6";;
|
||||||
|
|
||||||
sharp | *)
|
sharp | *)
|
||||||
separator="\ue0b2";;
|
separator="\ue0b2";;
|
||||||
esac
|
esac
|
||||||
echo -e "#[fg=colour$3,bg=colour$2]$separator#[fg=white,bg=colour$3]";;
|
echo -e "#[fg=colour$to,bg=colour$from]$separator#[fg=white,bg=colour$to]";;
|
||||||
|
|
||||||
end)
|
end)
|
||||||
case $4 in
|
case $shape in
|
||||||
round)
|
round)
|
||||||
separator="\ue0b4";;
|
separator="\ue0b4";;
|
||||||
|
|
||||||
sharp | *)
|
sharp | *)
|
||||||
separator="\ue0b0";;
|
separator="\ue0b0";;
|
||||||
esac
|
esac
|
||||||
echo -e "#[fg=colour$2,bg=colour$3]$separator#[fg=white]";;
|
echo -e "#[fg=colour$from,bg=colour$to]$separator#[fg=white]";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user