summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xetc/htmlopen.sh11
-rw-r--r--etc/mailcap4
-rwxr-xr-xetc/mailsync.sh4
-rwxr-xr-xetc/openfile.sh14
5 files changed, 19 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 2561992..b2cfbb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@ personal.muttrc
thunderbird/
autoconf/log
etc/mailsynclastrun
+etc/.mailsynclastrun
.dl
diff --git a/etc/htmlopen.sh b/etc/htmlopen.sh
deleted file mode 100755
index f6676e7..0000000
--- a/etc/htmlopen.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Helps open an HTML file from mutt in a GUI browser without weird side effects.
-
-file=$(mktemp -u --suffix=.html)
-
-rm -f "$file"
-
-cp "$1" "$file"
-
-setsid firefox "$file" >/dev/null 2>&1 &
diff --git a/etc/mailcap b/etc/mailcap
index 519c8a5..503a75a 100644
--- a/etc/mailcap
+++ b/etc/mailcap
@@ -1,7 +1,7 @@
text/plain; vim %s ;
-text/html; ~/.config/mutt/etc/htmlopen.sh %s ;
+text/html; ~/.config/mutt/etc/openfile.sh %s ;
text/html; w3m -I %{charset} -T text/html; copiousoutput;
image/*; ~/.config/mutt/etc/muttimage.sh %s ; copiousoutput
video/*; setsid mpv --quiet %s &; copiousoutput
-application/pdf; cp '%s' /tmp/doc.pdf && setsid zathura /tmp/doc.pdf &; copiousoutput;
+application/pdf; ~/.config/mutt/etc/openfile.sh %s ;
application/pgp-encrypted; gpg -d '%s'; copiousoutput;
diff --git a/etc/mailsync.sh b/etc/mailsync.sh
index 4d8f190..ced17f9 100755
--- a/etc/mailsync.sh
+++ b/etc/mailsync.sh
@@ -32,7 +32,7 @@ pkill -RTMIN+12 i3blocks
for account in $(ls ~/.mail)
do
#List unread messages newer than last mailsync and count them
- newcount=$(find ~/.mail/"$account"/INBOX/new/ -type f -newer ~/.config/mutt/etc/mailsynclastrun 2> /dev/null | wc -l)
+ newcount=$(find ~/.mail/"$account"/INBOX/new/ -type f -newer ~/.config/mutt/etc/.mailsynclastrun 2> /dev/null | wc -l)
if [ "$newcount" -gt "0" ]
then
notify "$account" "$newcount" &
@@ -41,4 +41,4 @@ done
notmuch new
#Create a touch file that indicates the time of the last run of mailsync
-touch ~/.config/mutt/etc/mailsynclastrun
+touch ~/.config/mutt/etc/.mailsynclastrun
diff --git a/etc/openfile.sh b/etc/openfile.sh
new file mode 100755
index 0000000..c866932
--- /dev/null
+++ b/etc/openfile.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Helps open a file with xdg-open from mutt in a external program without weird side effects.
+
+base=$(basename "$1")
+ext="${base##*.}"
+
+file=$(mktemp -u --suffix=".$ext")
+
+rm -f "$file"
+
+cp "$1" "$file"
+
+setsid xdg-open "$file" >/dev/null 2>&1 &