initial commit

This commit is contained in:
2017-04-13 12:28:53 +02:00
parent 49885fad8c
commit 6ceb857a9a
18 changed files with 1686 additions and 234 deletions

28
scripts/tag-thread.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
CURDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
CSV=$CURDIR/tag-list.csv
OUT=$CURDIR/tag-thread-rules.sh
> $OUT # reset
function notmuch_rule {
F_TAG=$1
F_FOL=$2
echo "notmuch tag +${F_TAG} -- thread:${F_FOL}/**"
}
while read line; do
TAG=$(echo $line | cut -d";" -f1)
FOL=$(echo $line | cut -d";" -f2)
NOTAG=$(echo $TAG | grep -o "," | wc -l)
NOTAG=$(expr $NOTAG + 1)
for ((i = 1; i <= $NOTAG; i++)); do
notmuch_rule $(echo $TAG | cut -d"," -f${i}) $FOL >> $OUT
done
done < "$CSV"