]> git.friedersdorff.com Git - max/dotfiles.git/commitdiff
feat: Use mutt for mailto links
authorMaximilian Friedersdorff <max@friedersdorff.com>
Mon, 11 Feb 2019 12:29:09 +0000 (12:29 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Mon, 11 Feb 2019 12:29:09 +0000 (12:29 +0000)
X/.Xresources
mail/.local/bin/muttmailto [new file with mode: 0755]
mail/.local/share/applications/mutt-mailto.desktop [new file with mode: 0644]

index baab6f2d17e4fc5dec4d29d31c7e01b1b327d004..dd3ea58cf09073459d651bdd82e45dab777182a5 100644 (file)
@@ -65,5 +65,5 @@ XTerm*allowSendEvents: true
 
 
 URxvt.perl-ext-common: matcher
-URxvt.url-launcher: qutebrowser
+URxvt.url-launcher: xdg-open
 URxvt.matcher.button: 1
diff --git a/mail/.local/bin/muttmailto b/mail/.local/bin/muttmailto
new file mode 100755 (executable)
index 0000000..3a142b8
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# NoSuck.org
+# Mutt Mailto Handler for XDG Environment
+# From https://github.com/NoSuck/MuttMailto
+
+if [[ "$1" == mailto:* ]] ; then
+       sStart="${1%%\?*}"
+       sEnd="&${1##*\?}"
+       # The whitelist.
+       sValidAttributes=( "Subject" )
+       for sAttribute in "${sValidAttributes[@]}" ; do
+               sHit="$( echo "$sEnd" | sed "s/^.*&$sAttribute=\([^&]*\).*/$sAttribute=\1/" )"
+               if [[ "$sEndNew" ]] ; then
+                       sEndNew="$sEndNew&$sHit"
+               else
+                       sEndNew="?$sHit"
+               fi
+       done
+fi
+sNewMailto="$sStart$sEndNew"
+# Modify as necessary.
+i3-sensible-terminal -e /bin/sh -c "mutt -F ~/.mutt/mutt.uk.ac.aber.maf54_online ${sNewMailto:+ \"$sNewMailto\"}" &
diff --git a/mail/.local/share/applications/mutt-mailto.desktop b/mail/.local/share/applications/mutt-mailto.desktop
new file mode 100644 (file)
index 0000000..b4e8304
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=Mutt Mailto Handler
+GenericName=MUA
+Comment=Supposedly sucks less.
+Exec=/home/max/.local/bin/muttmailto
+Terminal=true
+MimeType=x-scheme-handler/mailto
+NoDisplay=true