]> gitweb.fluxo.info Git - scripts.git/commitdiff
De-uglify a bit todo and status outputs
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 23 May 2018 11:11:58 +0000 (08:11 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 23 May 2018 11:11:58 +0000 (08:11 -0300)
status
todo

diff --git a/status b/status
index 052169b2cfed483816ef06c75cad15e558c371ad..3ac97d8cdf75834a216dfcee1334c09c2f15f49c 100755 (executable)
--- a/status
+++ b/status
@@ -72,7 +72,7 @@ function status_run {
 
     # Check your reminders
     if which remind &> /dev/null && [ -e "$HOME/.reminders" ]; then
-      remind ~/.reminders | grep -v '^No reminders.$'
+      remind ~/.reminders | grep -v '^No reminders.$'# | tr '[:upper:]' '[:lower:]'
     fi
 
     # Update your mrconfig and check all registered repositories
@@ -101,6 +101,11 @@ function status_run {
 
     # Check if are dangling downloaded files
     if [ -e "$HOME/load" ] && [ ! -z "`ls -1 ~/load/`" ]; then
+      # Print a newline if needed depending of the output of the previous commands
+      if [ ! -z "`postponed`" ] || [ ! -z "`unread-emails`" ]; then
+        echo ""
+      fi
+
       echo "Dangling files at ~/load:"
       echo ""
       ls -lh ~/load/
diff --git a/todo b/todo
index 19eeb241fd570874ed70d146ded12212b77c7697..a7745283e784bbdba7b5eca5661f2d35513bd218 100755 (executable)
--- 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