incomplete.sh erweitert
This commit is contained in:
+19
-12
@@ -1,21 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Aufgaben ohne Kontext und/oder Schlagwort:"
|
||||
echo "Aufgaben mit unvollständigen Feldern:"
|
||||
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'
|
||||
CASE WHEN contexts IS NULL OR contexts = '[]' THEN '✗' ELSE '✓' END AS 'Kontext',
|
||||
CASE WHEN tags IS NULL OR tags = '[]' THEN '✗' ELSE '✓' END AS 'Schlagwörter',
|
||||
CASE WHEN priority IS NULL OR priority = '' THEN '✗' ELSE '✓' END AS 'Prio',
|
||||
CASE WHEN energyLevel IS NULL OR energyLevel = '' THEN '✗' ELSE '✓' END AS 'Energie',
|
||||
CASE WHEN timeEstimate IS NULL OR timeEstimate = '' THEN '✗' ELSE '✓' END AS 'Zeit'
|
||||
FROM tasks t
|
||||
WHERE deletedAt IS NULL
|
||||
AND ((contexts IS NULL OR contexts = '[]') OR (tags IS NULL OR tags = '[]'))
|
||||
AND ((contexts IS NULL OR contexts = '[]')
|
||||
OR (tags IS NULL OR tags = '[]')
|
||||
OR (priority IS NULL OR priority = '')
|
||||
OR (energyLevel IS NULL OR energyLevel = '')
|
||||
OR (timeEstimate IS NULL OR timeEstimate = ''))
|
||||
AND status != 'done'
|
||||
ORDER BY Grund, updatedAt DESC" \
|
||||
ORDER BY updatedAt DESC" \
|
||||
| awk 'NR <= 2 { print; next }
|
||||
$1 == "inbox" { print "\033[90m" $0 "\033[0m"; next }
|
||||
{ print }'
|
||||
{
|
||||
is_inbox = ($1 == "inbox")
|
||||
gsub(/✓/, "\033[32m&\033[0m")
|
||||
gsub(/✗/, "\033[31m&\033[0m")
|
||||
if (is_inbox) print "\033[90m" $0 "\033[0m"
|
||||
else print
|
||||
}'
|
||||
|
||||
Reference in New Issue
Block a user