From cbf1edac22ee2a44d45203c7f47038a6410b5d2d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 28 Aug 2024 18:01:10 +0200 Subject: [PATCH] prompt todo: handle duplicates --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index f05b987..ce22276 100644 --- a/zshrc +++ b/zshrc @@ -102,8 +102,8 @@ exists thefuck && eval $(thefuck --alias) if [[ -e $HOME/.calendars ]]; then _prompt_todos() { - local todos=$(rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars | wc -l) - [[ $todos -gt 0 ]] && echo "Todos: $todos" + local todos=( ${(u)$( rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars ):t} ) + [[ $#todos -gt 0 ]] && echo "Todos: $#todos" } __chromaz_extra_left+=_prompt_todos fi