diff --git a/scripts/cwd.sh b/scripts/cwd.sh index 5da448c8..186d6815 100755 --- a/scripts/cwd.sh +++ b/scripts/cwd.sh @@ -18,6 +18,14 @@ main() { # change '/home/user' to '~' cwd="${path/"$HOME"/'~'}" + # check if the user wants only the current directory + basename_enabled=$(tmux show-option -gqv @dracula-cwd-basename) + + if [ "$basename_enabled" == "true" ]; then + #Extract only the last part of path + cwd=$(basename "$cwd") + fi + echo "$cwd" }