Initial commit: incomplete.sh and recent.sh scripts

This commit is contained in:
Tim
2026-07-14 16:26:41 +02:00
commit 52a2754971
2 changed files with 34 additions and 0 deletions
Executable
+21
View File
@@ -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 }'
Executable
+13
View File
@@ -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;"