From ac48b0fa468c47ff5ac878191f2de37a9b76a49e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 23 May 2018 08:11:58 -0300 Subject: De-uglify a bit todo and status outputs --- todo | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'todo') diff --git a/todo b/todo index 19eeb24..a774528 100755 --- a/todo +++ b/todo @@ -40,21 +40,26 @@ function todo_list { # User's Taskwarrior if which task &> /dev/null; then - echo "taskwarrior:" - echo "" - task list 2> /dev/null - echo "" + if [ "`task status:pending count`" != "0" ]; then + echo "taskwarrior:" + #echo "" + task list 2> /dev/null + echo "" + fi fi + # Taskwarrior data from projects + SILENT=true tasks +$status list + echo "" + # User's Timewarrior if which timew &> /dev/null; then - timew | grep -v "^There is no active time tracking." - echo "" + if ! timew | grep -q "^There is no active time tracking."; then + timew + echo "" + fi fi - # Timewarrior data from projects - SILENT=true tasks +$status list - todo_find | while read todo; do if [ "$todo" != "$NAME" ]; then if [ ! -z "$status" ] && ! grep -q "\($status\)" $todo; then -- cgit v1.2.3