Update mail config (mbsync, msmtp, neomutt)
This commit is contained in:
598
mail.org
598
mail.org
@@ -30,7 +30,7 @@ IMAPAccount gmail
|
|||||||
Host imap.gmail.com
|
Host imap.gmail.com
|
||||||
User dehaeze.thomas@gmail.com
|
User dehaeze.thomas@gmail.com
|
||||||
PassCmd "pass email/dehaeze.thomas@gmail.com"
|
PassCmd "pass email/dehaeze.thomas@gmail.com"
|
||||||
SSLType IMAPS
|
TLSType IMAPS
|
||||||
AuthMechs LOGIN
|
AuthMechs LOGIN
|
||||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -97,7 +97,7 @@ IMAPAccount esrf
|
|||||||
Host imaps.esrf.fr
|
Host imaps.esrf.fr
|
||||||
User dehaeze
|
User dehaeze
|
||||||
PassCmd "pass email/thomas.dehaeze@esrf.fr"
|
PassCmd "pass email/thomas.dehaeze@esrf.fr"
|
||||||
SSLType IMAPS
|
TLSType IMAPS
|
||||||
AuthMechs LOGIN
|
AuthMechs LOGIN
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ bind index,pager @ compose-to-sender
|
|||||||
|
|
||||||
# Marl All message as read
|
# Marl All message as read
|
||||||
macro index \Cr \
|
macro index \Cr \
|
||||||
"<tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
|
"<tag-pattern>~O<enter><tag-prefix><clear-flag>O<untag-pattern>.<enter><tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
|
||||||
"mark all new as read"
|
"mark all new as read"
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -658,42 +658,48 @@ bind compose R rename-attachment
|
|||||||
bind compose a attach-file
|
bind compose a attach-file
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Open another instance of neomutt in readonly mode while composing
|
Open another instance of Neomutt in read-only mode while composing
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
macro compose M "<shell-escape>$TERMINAL -e \"neomutt -R\"<enter>"
|
# macro compose M "<shell-escape>$TERMINAL -e \"neomutt -R\"<enter>"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Attach multiple files using ranger
|
Attach multiple files using yazi
|
||||||
#+begin_src conf
|
#+begin_src conf
|
||||||
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
|
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/yazipick<enter><enter-command>source /tmp/yazipick<enter><shell-escape>bash $HOME/.config/neomutt/bin/yazipick clean<enter>" "Attach with Yazi"
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Attach file by drooping from GUI
|
**** Attach with yazi
|
||||||
#+begin_src conf
|
|
||||||
macro compose B "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick dragon<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
**** Attach with Ranger Script
|
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:header-args: :tangle ~/.config/neomutt/bin/rangerpick
|
:header-args: :tangle ~/.config/neomutt/bin/yazipick
|
||||||
:header-args+: :comments both :mkdirp yes
|
:header-args+: :comments both :mkdirp yes
|
||||||
:header-args+: :shebang "#!/usr/bin/env bash"
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
:END:
|
:END:
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
tmpfile=/tmp/rangerpick
|
# Define temporary file path
|
||||||
|
tmpfile="/tmp/yazipick"
|
||||||
|
|
||||||
|
# Check if a parameter is passed to the script
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>"$0"<enter>"}' $tmpfile)" > $tmpfile
|
# Select files using yazi and save them to tmpfile
|
||||||
elif [ $1 == "dragon" ]; then
|
yazi --chooser-file "$tmpfile"
|
||||||
dragon-drop --target --print-path --keep > $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>"$0"<enter>"}' $tmpfile)" > $tmpfile
|
|
||||||
elif [ $1 == "clean" ]; then
|
# Only proceed if files were actually selected
|
||||||
ls $tmpfile
|
if [ -s "$tmpfile" ]; then
|
||||||
|
awk 'BEGIN {printf "push "} {printf "<attach-file>\"%s\"<enter>", $0} END {print ""}' "$tmpfile" > "$tmpfile.tmp" &&
|
||||||
|
mv "$tmpfile.tmp" "$tmpfile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$1" == "clean" ]; then
|
||||||
|
# Clean up the temporary file if "clean" is passed as argument
|
||||||
|
rm -f "$tmpfile"
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Send HTML mails using Markdown
|
**** Send HTML mails using Org mode
|
||||||
Write html emails using markdown
|
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
# macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n"
|
macro compose Y "<first-entry>\
|
||||||
|
<pipe-entry>$HOME/.config/neomutt/bin/convert-multipart.sh<enter>\
|
||||||
|
<enter-command>source /tmp/neomutt-commands<enter>"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Browser
|
*** Browser
|
||||||
@@ -747,9 +753,6 @@ macro index,pager gf "<change-folder-readonly>$HOME/.local/share/mails/search<en
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Link to Orgmode
|
*** Link to Orgmode
|
||||||
https://www.donarmstrong.com/posts/org_mode_mutt_capture/
|
|
||||||
https://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/
|
|
||||||
|
|
||||||
#+begin_src conf
|
#+begin_src conf
|
||||||
macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.py\n"
|
macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.py\n"
|
||||||
#+end_src
|
#+end_src
|
||||||
@@ -761,29 +764,92 @@ macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.
|
|||||||
:header-args+: :shebang "#!/usr/bin/env python3"
|
:header-args+: :shebang "#!/usr/bin/env python3"
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
https://orgmode.org/manual/The-capture-protocol.html#The-capture-protocol
|
|
||||||
|
|
||||||
#+begin_src python
|
#+begin_src python
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import email
|
import email
|
||||||
from email import policy
|
from email import policy
|
||||||
import subprocess
|
import platform
|
||||||
import urllib.parse
|
import subprocess # Keep for potential fallback or notification
|
||||||
|
import pyperclip # Use pyperclip for clipboard
|
||||||
|
|
||||||
|
def notify_user(title, message):
|
||||||
|
"""Attempt to send a desktop notification (optional)."""
|
||||||
|
system = platform.system()
|
||||||
|
try:
|
||||||
|
if system == 'Linux':
|
||||||
|
subprocess.Popen(['notify-send', '--urgency=low', '--icon=mail-message-new', title, message])
|
||||||
|
elif system == 'Darwin': # macOS
|
||||||
|
# Requires 'terminal-notifier' (brew install terminal-notifier)
|
||||||
|
# Or use osascript
|
||||||
|
subprocess.Popen([
|
||||||
|
'osascript', '-e',
|
||||||
|
f'display notification "{message}" with title "{title}"'
|
||||||
|
])
|
||||||
|
# Add Windows notification if needed
|
||||||
|
except FileNotFoundError:
|
||||||
|
# notify-send or osascript not found, ignore
|
||||||
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Notification failed: {e}", file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
|
# --- Main Script ---
|
||||||
|
|
||||||
# Parse the email from standard input
|
# Parse the email from standard input
|
||||||
message_bytes = sys.stdin.buffer.read()
|
try:
|
||||||
message = email.message_from_bytes(message_bytes, policy=policy.default)
|
message_bytes = sys.stdin.buffer.read()
|
||||||
|
# Use policy.default for robust parsing of modern emails
|
||||||
|
message = email.message_from_bytes(message_bytes, policy=policy.default)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error parsing email: {e}", file=sys.stderr)
|
||||||
|
notify_user("Mutt Org Link Error", f"Failed to parse email: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Grab the relevant message headers
|
# Grab the relevant message headers, handling potential missing headers
|
||||||
message_id = urllib.parse.quote(message['message-id'][1:-1])
|
raw_message_id = message.get('message-id')
|
||||||
subject = message['subject']
|
subject = message.get('subject', '(No Subject)') # Use default if subject is missing
|
||||||
message_to = message['to']
|
|
||||||
|
|
||||||
# Ask emacsclient to save a link to the message
|
# Clean the Message-ID (remove <>)
|
||||||
subprocess.Popen([
|
if raw_message_id:
|
||||||
'emacsclient',
|
message_id = raw_message_id.strip('<>')
|
||||||
f'org-protocol://capture?template=pm&url={message_id}&title={subject}&body={message_to}'
|
else:
|
||||||
])
|
message_id = None
|
||||||
|
|
||||||
|
# Check if we got the essential Message-ID
|
||||||
|
if not message_id:
|
||||||
|
error_msg = "Could not find Message-ID header in the email."
|
||||||
|
print(error_msg, file=sys.stderr)
|
||||||
|
notify_user("Mutt Org Link Error", error_msg)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Construct the Org mode link
|
||||||
|
# Format: [[message:message_id][subject]]
|
||||||
|
# No URL encoding needed for the message_id here
|
||||||
|
org_link = f"[[message:{message_id}][{subject}]]"
|
||||||
|
|
||||||
|
# Copy the link to the clipboard using pyperclip
|
||||||
|
try:
|
||||||
|
pyperclip.copy(org_link)
|
||||||
|
success_msg = f"Org link copied:\n{org_link}"
|
||||||
|
print(success_msg, file=sys.stderr) # Print to stderr for logs/debug
|
||||||
|
notify_user("Mutt Org Link Copied", f"Subject: {subject}") # Send desktop notification
|
||||||
|
# Optional: Add a terminal bell sound
|
||||||
|
# print('\a', file=sys.stderr)
|
||||||
|
sys.exit(0) # Success
|
||||||
|
except Exception as e:
|
||||||
|
# Provide specific error feedback if pyperclip fails (e.g., missing backend)
|
||||||
|
error_msg = f"Error copying to clipboard: {e}"
|
||||||
|
print(error_msg, file=sys.stderr)
|
||||||
|
if "clipboard command not found" in str(e).lower() or \
|
||||||
|
isinstance(e, pyperclip.PyperclipException):
|
||||||
|
print("\nPlease ensure a clipboard utility is installed:", file=sys.stderr)
|
||||||
|
print("- Linux: install 'xclip' or 'xsel'", file=sys.stderr)
|
||||||
|
print("- macOS: should work out-of-the-box (pbcopy)", file=sys.stderr)
|
||||||
|
print("- Windows: should work out-of-the-box (clip)", file=sys.stderr)
|
||||||
|
notify_user("Mutt Org Link Error", "Failed to copy link to clipboard.")
|
||||||
|
sys.exit(1) # Failure
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Colors
|
** Colors
|
||||||
@@ -1130,7 +1196,7 @@ A script =openfile.sh= is used to open files with the default application using
|
|||||||
First, tag the files you want to send using =t=, then =;= to apply the action on
|
First, tag the files you want to send using =t=, then =;= to apply the action on
|
||||||
all tagged files and finally =<enter>= to add them all.
|
all tagged files and finally =<enter>= to add them all.
|
||||||
|
|
||||||
Of ranger can be used with the =A= keybinding.
|
Or yazi can be used with the =A= keybinding.
|
||||||
|
|
||||||
*** Forgotten Attachment
|
*** Forgotten Attachment
|
||||||
#+begin_src conf
|
#+begin_src conf
|
||||||
@@ -1170,9 +1236,9 @@ mu find --clearlinks --format=links --linksdir=$HOME/.local/share/mails/search "
|
|||||||
#+begin_src bash :tangle ~/.config/neomutt/bin/send_mail.sh
|
#+begin_src bash :tangle ~/.config/neomutt/bin/send_mail.sh
|
||||||
msmtp -a $1 ${@:2} && \
|
msmtp -a $1 ${@:2} && \
|
||||||
if [ $TMUX ]; then
|
if [ $TMUX ]; then
|
||||||
tmux split -v -l 1 mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && tmux select-pane -U
|
tmux split -v -l 1 "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && mu index" && tmux select-pane -U
|
||||||
else
|
else
|
||||||
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent
|
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && mu index
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -1188,12 +1254,313 @@ fi
|
|||||||
*** Sync ESRF Mail Script
|
*** Sync ESRF Mail Script
|
||||||
#+begin_src bash :tangle ~/.config/neomutt/bin/get_new_esrf_mail.sh
|
#+begin_src bash :tangle ~/.config/neomutt/bin/get_new_esrf_mail.sh
|
||||||
if [ $TMUX ]; then
|
if [ $TMUX ]; then
|
||||||
tmux split -v -l 1 mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && tmux select-pane -U
|
tmux split -v -l 1 "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && mu index" && tmux select-pane -U
|
||||||
else
|
else
|
||||||
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf
|
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && mu index
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Email written with Org-Mode
|
||||||
|
#+begin_src bash :tangle ~/.config/neomutt/bin/convert-multipart.sh
|
||||||
|
commandsFile="/tmp/neomutt-commands"
|
||||||
|
orgFile="/tmp/neomutt-org"
|
||||||
|
htmlFile="/tmp/neomutt.html"
|
||||||
|
debugFile="/tmp/neomutt-debug.txt"
|
||||||
|
: > "$debugFile" # clear previous content
|
||||||
|
|
||||||
|
# Save original
|
||||||
|
cat - > "${orgFile}.orig"
|
||||||
|
cp "${orgFile}.orig" "$orgFile"
|
||||||
|
|
||||||
|
# Reset commands
|
||||||
|
echo -n "push " > "$commandsFile"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Replace signature for HTML only
|
||||||
|
# -----------------------------
|
||||||
|
awk '
|
||||||
|
/^-- *$/ {
|
||||||
|
in_sig = 1
|
||||||
|
sig = "--"
|
||||||
|
next
|
||||||
|
}
|
||||||
|
in_sig {
|
||||||
|
if (/^[[:space:]]*$/) {
|
||||||
|
print "#+begin_export html"
|
||||||
|
gsub(/\n/, "<br>", sig)
|
||||||
|
print "<p style=\"margin-top:1.2em; font-size:90%; color:#444; line-height:1.3;\">" sig "</p>"
|
||||||
|
print "#+end_export"
|
||||||
|
print
|
||||||
|
in_sig = 0
|
||||||
|
} else {
|
||||||
|
sig = sig "<br>" $0
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}
|
||||||
|
{print}
|
||||||
|
' "$orgFile" > "$orgFile.tmp" && mv "$orgFile.tmp" "$orgFile"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Convert Org to HTML
|
||||||
|
# -----------------------------
|
||||||
|
pandoc -f org -t html5 --standalone --wrap=none --template ~/.local/share/pandoc/email.html \
|
||||||
|
"$orgFile" > "$htmlFile"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Helper: extract local images from HTML
|
||||||
|
# -----------------------------
|
||||||
|
grep -oP '<img src="file://\K[^"]+' "$htmlFile" | while read -r file; do
|
||||||
|
sed -i "s#<img src=\"file://$file\"#<img src=\"cid:$(md5sum "$file" | cut -d ' ' -f 1 )\"#g" "$htmlFile"
|
||||||
|
echo "Replaced $file by cid:$(md5sum "$file" | cut -d ' ' -f 1 ) in HTML" >> "$debugFile"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Attach the html file
|
||||||
|
echo -n "<attach-file>\"$htmlFile\"<enter>" >> "$commandsFile"
|
||||||
|
|
||||||
|
# Set it as inline
|
||||||
|
echo -n "<toggle-disposition>" >> "$commandsFile"
|
||||||
|
|
||||||
|
# Tell neomutt to delete it after sending
|
||||||
|
echo -n "<toggle-unlink>" >> "$commandsFile"
|
||||||
|
|
||||||
|
# Select both the html and org files
|
||||||
|
echo -n "<tag-entry><previous-entry><tag-entry>" >> "$commandsFile"
|
||||||
|
|
||||||
|
# Group the selected messages as alternatives
|
||||||
|
echo -n "<group-alternatives>" >> "$commandsFile"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
grep -oP '\[\[file:\K[^\]]+' "${orgFile}.orig" \
|
||||||
|
| grep -Ev '^(https?://|cid:)' \
|
||||||
|
| while read -r file; do
|
||||||
|
if [[ -f "$file" ]]; then
|
||||||
|
id="$(md5sum "$file" | cut -d ' ' -f 1 )"
|
||||||
|
echo -n "<attach-file>\"$file\"<enter>" >> "$commandsFile"
|
||||||
|
echo -n "<toggle-disposition>" >> "$commandsFile"
|
||||||
|
echo -n "<edit-content-id><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace>$id<enter>" >> "$commandsFile"
|
||||||
|
echo -n "<tag-entry>" >> "$commandsFile"
|
||||||
|
echo "Attached $file" >> "$debugFile"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
grep -oP '\[\[file:\K[^\]]+' "$orgFile" | grep '^cid:' >/dev/null
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo -n "<first-entry><tag-entry><group-related>" >> "$commandsFile"
|
||||||
|
echo "Grouped related images" >> "$debugFile"
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src html :tangle ~/.local/share/pandoc/email.html :shebang "" :comments no
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
|
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Base reset for email clients */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
body,table,td,div,p {
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
font-family: Georgia, "Times New Roman", serif;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.4;
|
||||||
|
color:#111;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border:0;
|
||||||
|
outline:none;
|
||||||
|
text-decoration:none;
|
||||||
|
max-width:100%;
|
||||||
|
height:auto;
|
||||||
|
-ms-interpolation-mode:bicubic; /* Outlook */
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Layout container */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
width:100%;
|
||||||
|
background:#ffffff;
|
||||||
|
padding:20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width:760px;
|
||||||
|
margin:0 auto;
|
||||||
|
padding:20px;
|
||||||
|
background:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Typography */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
h1,h2,h3,h4,h5,h6 {
|
||||||
|
margin:20px 0 10px;
|
||||||
|
font-family: "Roboto","Helvetica Neue","Segoe UI",Arial,sans-serif;
|
||||||
|
color:#222;
|
||||||
|
line-height:1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 { font-size: 22px; }
|
||||||
|
h2 { font-size: 19px; }
|
||||||
|
h3 { font-size: 16px; }
|
||||||
|
h4 { font-size: 15px; }
|
||||||
|
h5 { font-size: 14px; }
|
||||||
|
h6 { font-size: 13px; }
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin:12px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,ol {
|
||||||
|
margin:10px 0 10px 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li { margin:4px 0; }
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Code blocks & inline code */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
pre, code {
|
||||||
|
font-family: Menlo, Consolas, "Courier New", monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background:#f5f5f5;
|
||||||
|
padding:10px;
|
||||||
|
border-radius:4px;
|
||||||
|
white-space:pre-wrap;
|
||||||
|
margin:15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p > code {
|
||||||
|
background:#f5f5f5;
|
||||||
|
padding:2px 4px;
|
||||||
|
border-radius:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Blockquotes */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left:4px solid #ccc;
|
||||||
|
padding-left:10px;
|
||||||
|
margin-left:5px;
|
||||||
|
margin-right:0;
|
||||||
|
font-style:italic;
|
||||||
|
color:#555;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Tables */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 15px 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
table th, table td {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 8px 12px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
table th {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table tr:nth-child(even) {
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
table caption {
|
||||||
|
caption-side: bottom;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #555;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------ */
|
||||||
|
/* Mobile styles */
|
||||||
|
/* ------------------------------ */
|
||||||
|
|
||||||
|
@media only screen and (max-width: 620px) {
|
||||||
|
body,table,td,p { font-size:14px !important; }
|
||||||
|
h1 { font-size:20px !important; }
|
||||||
|
.container { padding:15px !important; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 620px) {
|
||||||
|
table, thead, tbody, th, td, tr {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
th {
|
||||||
|
text-align: right;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
text-align: left;
|
||||||
|
padding-left: 10px;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
$if(highlighting-css)$
|
||||||
|
<style type="text/css">
|
||||||
|
$highlighting-css$
|
||||||
|
</style>
|
||||||
|
$endif$
|
||||||
|
|
||||||
|
$for(header-includes)$
|
||||||
|
$header-includes$
|
||||||
|
$endfor$
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
$if(title)$
|
||||||
|
<h1>$title$</h1>
|
||||||
|
$endif$
|
||||||
|
|
||||||
|
$body$
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Openfile Scripts
|
*** Openfile Scripts
|
||||||
#+begin_src bash :tangle ~/.config/neomutt/bin/openfile.sh
|
#+begin_src bash :tangle ~/.config/neomutt/bin/openfile.sh
|
||||||
base=$(basename "$1")
|
base=$(basename "$1")
|
||||||
@@ -1230,7 +1597,7 @@ Generic
|
|||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
text/plain; nvim %s
|
text/plain; nvim %s
|
||||||
video/*; setsid mpv --quiet %s &
|
video/*; setsid mpv --quiet %s &
|
||||||
image/*; sxiv -a -b %s &
|
image/*; nsxiv -a -b %s &
|
||||||
application/pdf; zathura %s &
|
application/pdf; zathura %s &
|
||||||
audio/*; /usr/bin/xdg-open %s; copiousoutput
|
audio/*; /usr/bin/xdg-open %s; copiousoutput
|
||||||
text/html; export DISPLAY=:0 && setsid qutebrowser %s > /dev/null 2>&1 &; nametemplate=%s.html
|
text/html; export DISPLAY=:0 && setsid qutebrowser %s > /dev/null 2>&1 &; nametemplate=%s.html
|
||||||
@@ -1243,73 +1610,78 @@ text/calendar; ics-add %s; copiousoutput;
|
|||||||
application/ics; ics-add %s; copiousoutput;
|
application/ics; ics-add %s; copiousoutput;
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
For calendar output (outlook), a personal =ics-add= script is used.
|
||||||
|
#+BEGIN_SRC conf
|
||||||
|
application/ms-tnef; winmail-add %s; copiousoutput;
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
Libreoffice
|
Libreoffice
|
||||||
#+begin_src conf
|
#+begin_src conf
|
||||||
application/docx; libreoffice %s --nologo &; copiousoutput;
|
application/docx; onlyoffice-desktopeditors %s &; copiousoutput;
|
||||||
application/doc; libreoffice --nologo %s &; copiousoutput;
|
application/doc; onlyoffice-desktopeditors %s &; copiousoutput;
|
||||||
|
|
||||||
application/vnd.oasis.opendocument.database; libreoffice --nologo --base '%s'; copiousoutput
|
application/vnd.oasis.opendocument.database; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.chart; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.oasis.opendocument.chart; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.oasis.opendocument.spreadsheet; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.spreadsheet-template; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.oasis.opendocument.spreadsheet-template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.graphics; libreoffice --nologo --draw '%s'; copiousoutput
|
application/vnd.oasis.opendocument.graphics; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.graphics-template; libreoffice --nologo --draw '%s'; copiousoutput
|
application/vnd.oasis.opendocument.graphics-template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.presentation; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.oasis.opendocument.presentation; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.presentation-template; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.oasis.opendocument.presentation-template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.formula; libreoffice --nologo --math '%s'; copiousoutput
|
application/vnd.oasis.opendocument.formula; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.text; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.oasis.opendocument.text; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.text-master; libreoffice --nologo -global '%s'; copiousoutput
|
application/vnd.oasis.opendocument.text-master; onlyoffice-desktopeditors -global '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.text-template; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.oasis.opendocument.text-template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.oasis.opendocument.text-web; libreoffice --nologo -web '%s'; copiousoutput
|
application/vnd.oasis.opendocument.text-web; onlyoffice-desktopeditors -web '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.base; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.sun.xml.base; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.calc; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.sun.xml.calc; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.calc.template; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.sun.xml.calc.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.draw; libreoffice --nologo --draw '%s'; copiousoutput
|
application/vnd.sun.xml.draw; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.draw.template; libreoffice --nologo --draw '%s'; copiousoutput
|
application/vnd.sun.xml.draw.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.calc; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.stardivision.calc; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.chart; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.stardivision.chart; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.draw; libreoffice --nologo --draw '%s'; copiousoutput
|
application/vnd.stardivision.draw; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.impress; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.stardivision.impress; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.math; libreoffice --nologo --math '%s'; copiousoutput
|
application/vnd.stardivision.math; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.writer-global; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.stardivision.writer-global; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.stardivision.writer; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.stardivision.writer; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.impress; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.sun.xml.impress; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.impress.template; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.sun.xml.impress.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.math; libreoffice --nologo --math '%s'; copiousoutput
|
application/vnd.sun.xml.math; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.writer; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.sun.xml.writer; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.writer.global; libreoffice --nologo -global '%s'; copiousoutput
|
application/vnd.sun.xml.writer.global; onlyoffice-desktopeditors -global '%s'; copiousoutput
|
||||||
application/vnd.sun.xml.writer.template; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.sun.xml.writer.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
text/csv; libreoffice --nologo --calc '%s'; copiousoutput
|
text/csv; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
text/spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
|
text/spreadsheet; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/x-quattropro; libreoffice --nologo --calc '%s'; copiousoutput
|
application/x-quattropro; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/x-dbf; libreoffice --nologo --calc '%s'; copiousoutput
|
application/x-dbf; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-excel.sheet.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.ms-excel.sheet.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-excel.template.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.ms-excel.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.template; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.spreadsheetml.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.lotus-1-2-3; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.lotus-1-2-3; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-excel; libreoffice --nologo --calc '%s'; copiousoutput
|
application/vnd.ms-excel; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/msexcel; libreoffice --nologo --calc '%s'; copiousoutput
|
application/msexcel; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/x-dbase; libreoffice --nologo --calc '%s'; copiousoutput
|
application/x-dbase; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
text/x-csv; libreoffice --nologo --calc '%s'; copiousoutput
|
text/x-csv; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-powerpoint.presentation.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.ms-powerpoint.presentation.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-powerpoint.slideshow.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.ms-powerpoint.slideshow.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-powerpoint.template.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.ms-powerpoint.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.presentation; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.presentationml.presentation; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.slideshow; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.presentationml.slideshow; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.template; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.presentationml.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-powerpoint; libreoffice --nologo --impress '%s'; copiousoutput
|
application/vnd.ms-powerpoint; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/mspowerpoint; libreoffice --nologo --impress '%s'; copiousoutput
|
application/mspowerpoint; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
text/mathml; libreoffice --nologo --math '%s'; copiousoutput
|
text/mathml; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/rtf; libreoffice --nologo --writer '%s'; copiousoutput
|
application/rtf; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/x-t602; libreoffice --nologo --writer '%s'; copiousoutput
|
application/x-t602; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.wordperfect; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-word.document.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.ms-word.document.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-word.template.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.ms-word.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.wordprocessingml.document; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.template; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.openxmlformats-officedocument.wordprocessingml.template; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/vnd.ms-works; libreoffice --nologo --writer '%s'; copiousoutput
|
application/vnd.ms-works; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/msword; libreoffice --nologo --writer '%s'; copiousoutput
|
application/msword; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
|
application/wordperfect; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
text/rtf; libreoffice --nologo --writer '%s'; copiousoutput
|
text/rtf; onlyoffice-desktopeditors '%s'; copiousoutput
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
Reference in New Issue
Block a user