~seirdy/dotfiles

c4120ec0339f94c174cfca14b857ff62d34ce3d9 — Rohan Kumar 16 days ago 0a9ba07 master
Add some scripts

- Wrapper for validator.nu
- fetch-mail script that does some preliminary sorting.
A Executables/shell-scripts/bin/fetch-mail => Executables/shell-scripts/bin/fetch-mail +4 -0
@@ 0,0 1,4 @@
#!/usr/bin/env dash
# just an alias to fetch mail, do some preliminary sorting, and open my inbox.
mbsync seirdy-default && m-move-some-lists && neomutt -f ~/mail/seirdy/Inbox
# vi:ft=sh

A Executables/shell-scripts/bin/vnu => Executables/shell-scripts/bin/vnu +6 -0
@@ 0,0 1,6 @@
#!/usr/bin/env dash
# A helpful comment

java -jar "$GHQ_ROOT/github.com/validator/validator/build/dist/vnu.jar" --stdout $@ | rg --passthru -F "file:$PWD/" --replace ''

# vi:ft=sh

A Executables/shell-scripts/mblaze/m-move-some-lists => Executables/shell-scripts/mblaze/m-move-some-lists +26 -0
@@ 0,0 1,26 @@
#!/usr/bin/env dash

# This script moves mailing list items and some automated messages to dedicated

set -e
mail_dir="$HOME/mail/seirdy"

find_matches() {
	mlist "$mail_dir/Inbox/cur" | "m-$1"
}

move() {
	matches="$(find_matches "$1")"
	num_matches="$(printf '%s' "$matches" | wc -l)"
	if [ "$num_matches" -gt 0 ]; then
		echo "moving $num_matches emails to $2"
		for match in $matches; do
			mv "$match" "$2/cur/"
		done
	fi
}

move srht-builds-lists "$mail_dir/lists/sr.ht/builds"
move chromium-lists "$mail_dir/lists/chromium"
move dmarc-reports "$mail_dir/dmarc-reports"
# vi:ft=sh