aboutsummaryrefslogtreecommitdiffstats
path: root/astroid/hooks/toggle-thread-learn-spam
blob: d40708abf76d59f172f397ecdc1b147629b0c999 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
#
# $1 Thread ID to toggle tag on

if [[ "$(notmuch search thread:$1 and tag:learn-spam)" ]]; then
	printf "unsetting tag learn-spam from thread %s\n" "$1"
	notmuch tag -learn-spam +inbox thread:"$1"
else
	printf "setting tag learn-spam%s from thread %s\n" "$1"
	notmuch tag +learn-spam -inbox thread:"$1"
fi