aboutsummaryrefslogtreecommitdiffstats
path: root/astroid/hooks
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2018-11-04 22:56:53 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2018-11-04 22:56:53 +0100
commitc5e40bfd2f24b26fb0ac8f6a60c3b3a810cc8f9b (patch)
tree1bff0726bf2645fd125153fe12a195043bc0d01b /astroid/hooks
parentd2e0a1f0fec8ad03a083b20ad010fd13d781d1e8 (diff)
downloaddotfiles-c5e40bfd2f24b26fb0ac8f6a60c3b3a810cc8f9b.tar.xz
astroid: Add configs
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'astroid/hooks')
-rwxr-xr-xastroid/hooks/toggle-email-learn-spam11
-rwxr-xr-xastroid/hooks/toggle-thread-learn-spam11
2 files changed, 22 insertions, 0 deletions
diff --git a/astroid/hooks/toggle-email-learn-spam b/astroid/hooks/toggle-email-learn-spam
new file mode 100755
index 0000000..ae8d9d9
--- /dev/null
+++ b/astroid/hooks/toggle-email-learn-spam
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+#
+# $1 Message ID to toggle tag on
+
+if [[ "$(notmuch search id:$1 and tag:learn-spam)" ]]; then
+ printf "unsetting tag learn-spam from message %s\n" "$1"
+ notmuch tag -learn-spam +inbox id:"$1"
+else
+ printf "setting tag learn-spam from message %s\n" "$1"
+ notmuch tag +learn-spam -inbox id:"$1"
+fi
diff --git a/astroid/hooks/toggle-thread-learn-spam b/astroid/hooks/toggle-thread-learn-spam
new file mode 100755
index 0000000..d40708a
--- /dev/null
+++ b/astroid/hooks/toggle-thread-learn-spam
@@ -0,0 +1,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