commit 52a2754971bc1e93252088c6556c210540b8c122 Author: Tim Peters Date: Tue Jul 14 16:26:41 2026 +0200 Initial commit: incomplete.sh and recent.sh scripts diff --git a/incomplete.sh b/incomplete.sh new file mode 100755 index 0000000..856b47d --- /dev/null +++ b/incomplete.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +echo "Aufgaben ohne Kontext und/oder Schlagwort:" +sqlite3 -column -header ~/.local/share/mindwtr/mindwtr.db \ + "SELECT status AS 'Status', + substr(title, 1, 50) AS 'Aufgabe', + CASE + WHEN (contexts IS NULL OR contexts = '[]') AND (tags IS NULL OR tags = '[]') THEN 'kein Kontext, kein Schlagwort' + WHEN (contexts IS NULL OR contexts = '[]') THEN 'nur Schlagwort' + WHEN (tags IS NULL OR tags = '[]') THEN 'nur Kontext' + END AS 'Grund', + (SELECT GROUP_CONCAT(value, ', ') FROM (SELECT value FROM json_each(t.contexts) ORDER BY value)) AS 'Kontext', + (SELECT GROUP_CONCAT(value, ', ') FROM (SELECT value FROM json_each(t.tags) ORDER BY value)) AS 'Schlagwörter' + FROM tasks t + WHERE deletedAt IS NULL + AND ((contexts IS NULL OR contexts = '[]') OR (tags IS NULL OR tags = '[]')) + AND status != 'done' + ORDER BY Grund, updatedAt DESC" \ + | awk 'NR <= 2 { print; next } + $1 == "inbox" { print "\033[90m" $0 "\033[0m"; next } + { print }' diff --git a/recent.sh b/recent.sh new file mode 100755 index 0000000..2182170 --- /dev/null +++ b/recent.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Letzte Änderungen (neueste zuerst):" +sqlite3 -column -header ~/.local/share/mindwtr/mindwtr.db \ + "SELECT row_number() OVER (ORDER BY updatedAt DESC) AS 'Pos.', + status AS 'Status', + (SELECT GROUP_CONCAT(value, ', ') FROM (SELECT value FROM json_each(t.contexts) ORDER BY value)) AS 'Kontext', + (SELECT GROUP_CONCAT(value, ', ') FROM (SELECT value FROM json_each(t.tags) ORDER BY value)) AS 'Schlagwörter', + substr(title, 1, 35) AS 'Aufgabe' + FROM tasks t + WHERE deletedAt IS NULL + ORDER BY updatedAt DESC + LIMIT 20;"