added all scripts
This commit is contained in:
22
move-trash.sh
Executable file
22
move-trash.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Read the message file path from aerc
|
||||
while read -r filepath; do
|
||||
# Get the base mail directory
|
||||
maildir="$HOME/.local/share/mail"
|
||||
|
||||
# Extract the filename
|
||||
filename=$(basename "$filepath")
|
||||
|
||||
# Create Trash/cur if it doesn't exist
|
||||
mkdir -p "$maildir/Trash/cur"
|
||||
|
||||
# Move the file to Trash
|
||||
if [[ -f "$filepath" ]]; then
|
||||
mv "$filepath" "$maildir/Trash/cur/$filename"
|
||||
echo "Moved to Trash: $filename" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
# Re-index with notmuch
|
||||
notmuch new >/dev/null 2>&1
|
||||
Reference in New Issue
Block a user