added themes, niri waybar updat, nvim plugins updates and additions
This commit is contained in:
35
scripts/scripts/abook.sh
Executable file
35
scripts/scripts/abook.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
# Automatically learn email addresses from sent/received mail
|
||||
|
||||
ABOOK_FILE="$HOME/.abook/addressbook"
|
||||
mkdir -p "$HOME/.abook"
|
||||
touch "$ABOOK_FILE"
|
||||
|
||||
# Extract all email addresses from notmuch database
|
||||
notmuch address --output=sender --output=recipients '*' |
|
||||
sort -u |
|
||||
while read -r email; do
|
||||
# Check if email is already in abook
|
||||
if ! grep -q "$email" "$ABOOK_FILE" 2>/dev/null; then
|
||||
# Extract name and email
|
||||
if [[ $email =~ ^(.+)\<(.+)\>$ ]]; then
|
||||
NAME="${BASH_REMATCH[1]}"
|
||||
EMAIL="${BASH_REMATCH[2]}"
|
||||
else
|
||||
NAME=""
|
||||
EMAIL="$email"
|
||||
fi
|
||||
|
||||
# Add to abook (skip if already exists)
|
||||
echo "[format]
|
||||
program=abook
|
||||
version=0.6.1
|
||||
|
||||
[0]
|
||||
name=$NAME
|
||||
email=$EMAIL
|
||||
" >>"$ABOOK_FILE"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Address book updated: $(grep -c '^\[' "$ABOOK_FILE") entries"
|
||||
25
scripts/scripts/fzf-address.sh
Executable file
25
scripts/scripts/fzf-address.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Fuzzy find email addresses with fzf
|
||||
|
||||
QUERY="$1"
|
||||
|
||||
# Get all addresses from notmuch
|
||||
ADDRESSES=$(notmuch address --output=sender --output=recipients \
|
||||
--deduplicate=address '*' | sort -u)
|
||||
|
||||
# If query is provided, pre-filter
|
||||
if [ -n "$QUERY" ]; then
|
||||
ADDRESSES=$(echo "$ADDRESSES" | grep -i "$QUERY")
|
||||
fi
|
||||
|
||||
# Use fzf for selection
|
||||
SELECTED=$(echo "$ADDRESSES" | fzf \
|
||||
--height=40% \
|
||||
--layout=reverse \
|
||||
--border \
|
||||
--prompt="Select recipient: " \
|
||||
--preview="" \
|
||||
--query="$QUERY")
|
||||
|
||||
# Output selected address
|
||||
echo "$SELECTED"
|
||||
0
scripts/scripts/mail
Normal file
0
scripts/scripts/mail
Normal file
Reference in New Issue
Block a user