adde latex lsp and language
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
MBSYNC=$(pgrep mbsync)
|
||||
NOTMUCH=$(pgrep notmuch)
|
||||
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||
echo "Already running one instance of mbsync or notmuch. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
maildir="$HOME/.local/share/mail"
|
||||
|
||||
echo "Moving messages tagged as *deleted* to Trash"
|
||||
notmuch search --format=text0 --output=files tag:deleted | while IFS= read -r -d '' filepath; do
|
||||
# Skip if already in Trash
|
||||
case "$filepath" in
|
||||
*/Trash/*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
# Move to Trash if file exists
|
||||
if [ -f "$filepath" ]; then
|
||||
filename=$(basename "$filepath")
|
||||
mkdir -p "$maildir/Trash/cur"
|
||||
mv -v "$filepath" "$maildir/Trash/cur/$filename"
|
||||
fi
|
||||
done
|
||||
|
||||
mbsync -Va
|
||||
notmuch new
|
||||
PYTHONWARNINGS="ignore::UserWarning" afew --tag --new
|
||||
|
||||
# Auto-tag and cleanup
|
||||
notmuch tag +sent -- folder:Sent and not tag:sent
|
||||
notmuch tag +trash -- folder:Trash and not tag:trash
|
||||
notmuch tag -deleted -- folder:Trash
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
MBSYNC=$(pgrep mbsync)
|
||||
NOTMUCH=$(pgrep notmuch)
|
||||
|
||||
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||
echo "Already running one instance of mbsync or notmuch. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Deleting messages tagged as *deleted*"
|
||||
notmuch search --format=text0 --output=files tag:deleted | xargs -0 --no-run-if-empty rm -v
|
||||
|
||||
mbsync -Va
|
||||
notmuch new
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
read input
|
||||
|
||||
case "$input" in
|
||||
"liiph@proton.me")
|
||||
cat ~/.config/aerc/sigs/liph.txt
|
||||
;;
|
||||
"liiph@protonmail.com")
|
||||
cat ~/.config/aerc/sigs/liph.txt
|
||||
;;
|
||||
"liiph@pm.me")
|
||||
cat ~/.config/aerc/sigs/liph.txt
|
||||
;;
|
||||
"ph.waibel@proton.me")
|
||||
cat ~/.config/aerc/sigs/formal.txt
|
||||
;;
|
||||
"ph.waibel@pm.me")
|
||||
cat ~/.config/aerc/sigs/phil.txt
|
||||
;;
|
||||
*)
|
||||
# Default signature if no match
|
||||
cat ~/.config/aerc/sigs/default.txt
|
||||
;;
|
||||
esac
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sync mail from ProtonMail Bridge (suppress CLOSE error)
|
||||
echo "Syncing mail from ProtonMail..."
|
||||
mbsync -a 2>&1 | grep -v "CLOSE"
|
||||
|
||||
# Index new mail (this automatically runs post-new hook)
|
||||
echo "Indexing new messages..."
|
||||
notmuch new
|
||||
|
||||
# Move all deleted messages to Trash folder
|
||||
echo "Cleaning up deleted messages..."
|
||||
DELETED_COUNT=0
|
||||
notmuch search --output=files tag:deleted 2>/dev/null | while read filepath; do
|
||||
if [ -f "$filepath" ]; then
|
||||
TRASH_DIR="$HOME/.local/share/mail/Trash/cur"
|
||||
mkdir -p "$TRASH_DIR"
|
||||
|
||||
FILENAME=$(basename "$filepath")
|
||||
mv "$filepath" "$TRASH_DIR/$FILENAME"
|
||||
((DELETED_COUNT++))
|
||||
fi
|
||||
done
|
||||
|
||||
# Update notmuch after moving files
|
||||
if [ $DELETED_COUNT -gt 0 ]; then
|
||||
echo "Moved $DELETED_COUNT message(s) to Trash"
|
||||
notmuch new --no-hooks >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Sync moved messages back to ProtonMail
|
||||
echo "Syncing changes to ProtonMail..."
|
||||
mbsync -a 2>&1 | grep -v "CLOSE" >/dev/null
|
||||
|
||||
# Notify if new mail
|
||||
NEW=$(notmuch count tag:unread)
|
||||
if [ $NEW -gt 0 ]; then
|
||||
notify-send "📬 Mail" "$NEW unread message(s)"
|
||||
fi
|
||||
|
||||
echo "Sync complete: $(date)"
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Save the piped message to temp file
|
||||
TEMP_MSG=$(mktemp)
|
||||
cat > "$TEMP_MSG"
|
||||
|
||||
# Extract Message-ID more robustly
|
||||
MESSAGE_ID=$(grep -i "^Message-ID:" "$TEMP_MSG" | head -1 | sed 's/^[Mm]essage-[Ii][Dd]: *//; s/^<//; s/>$//' | tr -d '\r\n ')
|
||||
|
||||
# Cleanup temp file
|
||||
rm "$TEMP_MSG"
|
||||
|
||||
if [ -z "$MESSAGE_ID" ]; then
|
||||
notify-send "Error" "Could not find Message-ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get file path from notmuch
|
||||
FILEPATH=$(notmuch search --output=files "id:$MESSAGE_ID" 2>/dev/null | head -1)
|
||||
|
||||
if [ -z "$FILEPATH" ] || [ ! -f "$FILEPATH" ]; then
|
||||
# Try alternative search
|
||||
FILEPATH=$(notmuch search --output=files --exclude=false "*" 2>/dev/null | xargs grep -l "Message-ID.*$MESSAGE_ID" 2>/dev/null | head -1)
|
||||
fi
|
||||
|
||||
if [ -z "$FILEPATH" ] || [ ! -f "$FILEPATH" ]; then
|
||||
notify-send "Error" "File not found for Message-ID: $MESSAGE_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Move to Trash folder
|
||||
TRASH_DIR="$HOME/.local/share/mail/Trash/cur"
|
||||
mkdir -p "$TRASH_DIR"
|
||||
|
||||
FILENAME=$(basename "$FILEPATH")
|
||||
mv "$FILEPATH" "$TRASH_DIR/$FILENAME"
|
||||
|
||||
# Update notmuch database
|
||||
notmuch new --no-hooks >/dev/null 2>&1
|
||||
|
||||
# Tag as deleted
|
||||
notmuch tag +deleted +trash -inbox -unread -- "id:$MESSAGE_ID" >/dev/null 2>&1
|
||||
|
||||
# Trigger sync in background
|
||||
(sleep 2 && mbsync -a 2>&1 | grep -v CLOSE >/dev/null) &
|
||||
|
||||
notify-send "📧 Aerc" "Moved to Trash"
|
||||
Reference in New Issue
Block a user