From a2623f77cc77fa26317d7bc6887a215b708db3f4 Mon Sep 17 00:00:00 2001
From: g-w1 <58830309+g-w1@users.noreply.github.com>
Date: Sun, 19 Jul 2020 17:58:53 -0400
Subject: Add audio playback with mailcap and mpv (#499)

Allow audio to also be listened to from an email. Did not include setsid because then there would be no way to pause.
---
 share/mailcap | 1 +
 1 file changed, 1 insertion(+)

(limited to 'share/mailcap')

diff --git a/share/mailcap b/share/mailcap
index 5bd2471..b355f32 100644
--- a/share/mailcap
+++ b/share/mailcap
@@ -3,6 +3,7 @@ text/html; openfile %s ; nametemplate=%s.html
 text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
 image/*; openfile %s ;
 video/*; setsid mpv --quiet %s &; copiousoutput
+audio/*; mpv %s ;
 application/pdf; openfile %s ;
 application/pgp-encrypted; gpg -d '%s'; copiousoutput;
 application/pgp-keys; gpg --import '%s'; copiousoutput;
-- 
cgit v1.2.3


From 2cb6dfb574834d3d17980d7c41473daa745d76cc Mon Sep 17 00:00:00 2001
From: cshjsc <47149574+cshjsc@users.noreply.github.com>
Date: Tue, 2 Nov 2021 19:34:59 +0100
Subject: Fix html links splitting

avoid line splitting.
the width option is set to 80 by default, increasing it will avoid breaking long links in two different lines
---
 share/mailcap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'share/mailcap')

diff --git a/share/mailcap b/share/mailcap
index b355f32..a49145f 100644
--- a/share/mailcap
+++ b/share/mailcap
@@ -1,6 +1,6 @@
 text/plain; $EDITOR %s ;
 text/html; openfile %s ; nametemplate=%s.html
-text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
+text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump -width=1024 %s; nametemplate=%s.html; copiousoutput;
 image/*; openfile %s ;
 video/*; setsid mpv --quiet %s &; copiousoutput
 audio/*; mpv %s ;
-- 
cgit v1.2.3


From 480fc82f9b7f222c5fdf5da43e22a1518899aa8f Mon Sep 17 00:00:00 2001
From: Luke Smith <luke@lukesmith.xyz>
Date: Fri, 29 Apr 2022 14:49:11 -0400
Subject: openfile moved to lib, not for sole running

---
 Makefile      | 10 +++++++---
 share/mailcap |  6 +++---
 2 files changed, 10 insertions(+), 6 deletions(-)

(limited to 'share/mailcap')

diff --git a/Makefile b/Makefile
index 03e2df1..569cd35 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,10 @@ endif
 
 install:
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/mutt-wizard
 	cp -f bin/mw bin/mailsync bin/openfile $(DESTDIR)$(PREFIX)/bin/
-	chmod 755 $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/bin/openfile
+	cp -f bin/openfile $(DESTDIR)$(PREFIX)/lib/mutt-wizard
+	chmod 755 $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile
 	mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard
 	chmod 755 $(DESTDIR)$(PREFIX)/share/mutt-wizard
 	cp -f share/mailcap share/domains.csv share/mutt-wizard.muttrc share/switch.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard
@@ -26,11 +28,13 @@ install:
 		rm -f $(DESTDIR)$(PREFIX)/bin/mwba; \
 		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(MANPREFIX)/man1/mw.1; \
 		rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1ba; \
+		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap; \
+		rm -f $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcapba; \
 	fi
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/bin/openfile
-	rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard
+	rm -f $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile
+	rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard  $(DESTDIR)$(PREFIX)/lib/mutt-wizard
 	rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1
 
 .PHONY: install uninstall
diff --git a/share/mailcap b/share/mailcap
index a49145f..0829b3b 100644
--- a/share/mailcap
+++ b/share/mailcap
@@ -1,9 +1,9 @@
 text/plain; $EDITOR %s ;
-text/html; openfile %s ; nametemplate=%s.html
+text/html; /usr/local/lib/mutt-wizard/openfile %s ; nametemplate=%s.html
 text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump -width=1024 %s; nametemplate=%s.html; copiousoutput;
-image/*; openfile %s ;
+image/*; /usr/local/lib/mutt-wizard/openfile %s ;
 video/*; setsid mpv --quiet %s &; copiousoutput
 audio/*; mpv %s ;
-application/pdf; openfile %s ;
+application/pdf; /usr/local/lib/mutt-wizard/openfile %s ;
 application/pgp-encrypted; gpg -d '%s'; copiousoutput;
 application/pgp-keys; gpg --import '%s'; copiousoutput;
-- 
cgit v1.2.3