@@ -9,6 +9,7 @@ IFS=' ' read -r -a diff_symbol <<< $(get_tmux_option "@dracula-git-show-diff-sym
99IFS=' ' read -r -a no_repo_message <<< $( get_tmux_option " @dracula-git-no-repo-message" " " )
1010IFS=' ' read -r -a no_untracked_files <<< $( get_tmux_option " @dracula-git-no-untracked-files" " false" )
1111IFS=' ' read -r -a show_remote_status <<< $( get_tmux_option " @dracula-git-show-remote-status" " false" )
12+ show_repo_name=" $( get_tmux_option " @dracula-git-show-repo-name" " false" ) "
1213
1314# Get added, modified, updated and deleted files from git status
1415getChanges ()
@@ -129,36 +130,45 @@ getRemoteInfo()
129130 echo " $out "
130131}
131132
133+ getRepoName ()
134+ {
135+ if [ " $show_repo_name " = " true" ] && [ " $( checkForGitDir) " = " true" ]; then
136+ repo=" $( basename " $( git -C " $path " --no-optional-locks rev-parse --show-toplevel 2> /dev/null) " ) "
137+ echo " $repo | "
138+ fi
139+ }
140+
132141# return the final message for the status bar
133142getMessage ()
134143{
135144 if [ $( checkForGitDir) == " true" ]; then
136145 branch=" $( getBranch) "
146+ repo_name=" $( getRepoName) "
137147 output=" "
138148
139149 if [ $( checkForChanges) == " true" ]; then
140150
141151 changes=" $( getChanges) "
142152
143153 if [ " ${hide_status} " == " false" ]; then
144- if [ $( checkEmptySymbol $ diff_symbol) = = " true" ]; then
145- output=$( echo " ${changes} $branch " )
154+ if [ " $( checkEmptySymbol " ${ diff_symbol[0]} " ) " = " true" ]; then
155+ output=" $repo_name ${changes : + ${changes} } $branch "
146156 else
147- output=$( echo " $ diff_symbol ${changes} $branch " )
157+ output=" $repo_name ${ diff_symbol[0]} ${changes: + $changes } $branch "
148158 fi
149159 else
150- if [ $( checkEmptySymbol $ diff_symbol) = = " true" ]; then
151- output=$( echo " $branch " )
160+ if [ " $( checkEmptySymbol " ${ diff_symbol[0]} " ) " = " true" ]; then
161+ output=$( echo " $repo_name$ branch " )
152162 else
153- output=$( echo " $diff_symbol $branch " )
163+ output=$( echo " $repo_name$ diff_symbol $branch " )
154164 fi
155165 fi
156166
157167 else
158168 if [ $( checkEmptySymbol $current_symbol ) == " true" ]; then
159- output=$( echo " $branch " )
169+ output=$( echo " $repo_name$ branch " )
160170 else
161- output=$( echo " $ current_symbol $branch " )
171+ output=" $repo_name ${ current_symbol[0]} $branch "
162172 fi
163173 fi
164174
0 commit comments