From c9ec0cb4bd6a550dcf076095fee48531a4f68fd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?=
 <yps@yaroslavps.com>
Date: Sun, 28 Mar 2021 16:48:20 +0300
Subject: neomutt config

Well, it seems that I am back to using neomutt. Aerc still can't figure
pgp out.
---
 dotfiles/.local/bin/mutt-open | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100755 dotfiles/.local/bin/mutt-open

(limited to 'dotfiles/.local/bin/mutt-open')

diff --git a/dotfiles/.local/bin/mutt-open b/dotfiles/.local/bin/mutt-open
new file mode 100755
index 0000000..e8adbb9
--- /dev/null
+++ b/dotfiles/.local/bin/mutt-open
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Helps open a file with xdg-open from mutt in a external program without weird side effects.
+tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mail/files"
+file="$tempdir/$(basename "$1")"
+opener="setsid -f xdg-open"
+mkdir -p "$tempdir"
+cp -f "$1" "$file"
+$opener "$file" >/dev/null 2>&1
+find "${tempdir:?}" -mtime +1 -type f -delete
-- 
cgit v1.2.3