dotfiles/.local/bin/scripts/mailto-handler
2024-09-15 17:42:56 +03:00

14 lines
442 B
Bash
Executable file

#!/bin/sh -e
# Extract the email address from the mailto link
mailto_link="$1"
email_address="${mailto_link#mailto:}"
# Copy the extracted email address to the clipboard
echo -n "$email_address" | xclip -selection clipboard
# Optional: Notify the user
notify-send "Email address copied to clipboard" "$email_address"
# Optional: Log the copied email addresses for debugging
echo "Copied email address: $email_address" >> ~/mailto_log.txt