commit 50fd3e2cf7907039fc2ab5a3c5e028bb9579d9de Author: Per Olofsson Date: Sat Sep 19 11:54:23 2015 +0200 Add $MAILER support to xdg-email. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=6615 Bug-Debian: http://bugs.debian.org/574131 diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in index a45832f..9bbbab6 100644 --- a/scripts/xdg-email.in +++ b/scripts/xdg-email.in @@ -188,6 +188,23 @@ open_xfce() fi } +open_envvar() +{ + local OLDIFS="$IFS" + IFS=: + for i in $MAILER; do + IFS="$OLDIFS" + + eval "$i" '"$1"' + + if [ $? -eq 0 ]; then + exit_success + fi + done + + exit_failure_operation_failed +} + open_generic() { local client @@ -401,6 +418,10 @@ if [ x"$DE" = x"" ]; then DE=generic fi +if [ x"$MAILER" != x"" ]; then + DE=envvar +fi + # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then BROWSER=links2:elinks:links:lynx:w3m @@ -410,6 +431,10 @@ if [ x"$BROWSER" = x"" ]; then fi case "$DE" in + envvar) + open_envvar "${mailto}" + ;; + kde) open_kde "${mailto}" ;;