incomplete.sh erweitert
This commit is contained in:
+19
-12
@@ -1,21 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Aufgaben ohne Kontext und/oder Schlagwort:"
|
echo "Aufgaben mit unvollständigen Feldern:"
|
||||||
sqlite3 -column -header ~/.local/share/mindwtr/mindwtr.db \
|
sqlite3 -column -header ~/.local/share/mindwtr/mindwtr.db \
|
||||||
"SELECT status AS 'Status',
|
"SELECT status AS 'Status',
|
||||||
substr(title, 1, 50) AS 'Aufgabe',
|
substr(title, 1, 50) AS 'Aufgabe',
|
||||||
CASE
|
CASE WHEN contexts IS NULL OR contexts = '[]' THEN '✗' ELSE '✓' END AS 'Kontext',
|
||||||
WHEN (contexts IS NULL OR contexts = '[]') AND (tags IS NULL OR tags = '[]') THEN 'kein Kontext, kein Schlagwort'
|
CASE WHEN tags IS NULL OR tags = '[]' THEN '✗' ELSE '✓' END AS 'Schlagwörter',
|
||||||
WHEN (contexts IS NULL OR contexts = '[]') THEN 'nur Schlagwort'
|
CASE WHEN priority IS NULL OR priority = '' THEN '✗' ELSE '✓' END AS 'Prio',
|
||||||
WHEN (tags IS NULL OR tags = '[]') THEN 'nur Kontext'
|
CASE WHEN energyLevel IS NULL OR energyLevel = '' THEN '✗' ELSE '✓' END AS 'Energie',
|
||||||
END AS 'Grund',
|
CASE WHEN timeEstimate IS NULL OR timeEstimate = '' THEN '✗' ELSE '✓' END AS 'Zeit'
|
||||||
(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
|
FROM tasks t
|
||||||
WHERE deletedAt IS NULL
|
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'
|
AND status != 'done'
|
||||||
ORDER BY Grund, updatedAt DESC" \
|
ORDER BY updatedAt DESC" \
|
||||||
| awk 'NR <= 2 { print; next }
|
| 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