updated scripts
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the current message's notmuch ID from aerc's environment
|
||||
# We'll use notmuch to find and move the file
|
||||
|
||||
maildir="$HOME/.local/share/mail"
|
||||
|
||||
# Find files for messages in current thread that aren't already in Trash
|
||||
notmuch search --output=files thread:{} 2>/dev/null | while read filepath; do
|
||||
# Skip if already in Trash
|
||||
if [[ "$filepath" == *"/Trash/"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ -f "$filepath" ]]; then
|
||||
filename=$(basename "$filepath")
|
||||
mkdir -p "$maildir/Trash/cur"
|
||||
mv "$filepath" "$maildir/Trash/cur/$filename"
|
||||
fi
|
||||
done
|
||||
|
||||
# Re-index
|
||||
notmuch new >/dev/null 2>&1
|
||||
Reference in New Issue
Block a user