about summary refs log tree commit diff stats
path: root/bash/acmetodo-inprogress
diff options
context:
space:
mode:
Diffstat (limited to 'bash/acmetodo-inprogress')
-rwxr-xr-xbash/acmetodo-inprogress19
1 files changed, 19 insertions, 0 deletions
diff --git a/bash/acmetodo-inprogress b/bash/acmetodo-inprogress
new file mode 100755
index 0000000..d5ea505
--- /dev/null
+++ b/bash/acmetodo-inprogress
@@ -0,0 +1,19 @@
+#!/bin/sh
+# acmetodo-inprogress: Filters the todo list to show only 'in progress' items.
+
+PLAN9=${PLAN9:-"/usr/local/plan9"}
+TODO_FILE="$PLAN9/lib/todo"
+ACME_BIN="$PLAN9/bin/acme"
+
+MAIN_TODO_WINID=$($ACME_BIN -w | grep "^$TODO_FILE" | cut -d' ' -f1 | head -n 1)
+
+if [ -z "$MAIN_TODO_WINID" ]; then
+    echo "Error: Main acmetodo window not found." >/dev/stderr
+    exit 1
+fi
+
+filtered_content=$(grep '^[>] ' "$TODO_FILE")
+
+echo 'data' | $ACME_BIN -a "$MAIN_TODO_WINID"
+echo "$filtered_content" | $ACME_BIN -a "$MAIN_TODO_WINID"
+echo 'clean' | $ACME_BIN -a "$MAIN_TODO_WINID"
\ No newline at end of file