Author: Jonathan Marsden Description: update for LXDE * scripts/xdg-email: - Added open_lxde shell function, used when LXDE detected. - Added run_sylpheed function, used to call sylpheed (LP: 779156). Bug-Ubuntu: https://launchpad.net/bugs/779156 Last-Update: 2016-01-20 --- a/scripts/xdg-email.in +++ b/scripts/xdg-email.in @@ -82,6 +82,17 @@ run_thunderbird() fi } +run_sylpheed() +{ + DEBUG 1 "Running $1 --compose \"$2\"" + "$1" --compose "$2" + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_kde() { if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then @@ -213,6 +224,39 @@ open_envvar() exit_failure_operation_failed } +open_lxde() +{ + DEBUG 3 "Running open_lxde \"$1\"" + + local client + local desktop + desktop=`xdg-mime query default "x-scheme-handler/mailto"` + client=`desktop_file_to_binary "$desktop"` + + # If no xdg-mime default was set, + # and if we are running Lubuntu, fallback to sylpheed + if [ -z "$desktop" -a "$DESKTOP_SESSION" = "Lubuntu" ]; then + client=`desktop_file_to_binary "sylpheed.desktop"` + fi + + echo $client | grep thunderbird > /dev/null 2>&1 + if [ $? -eq 0 ] ; then + run_thunderbird "$client" "$1" + fi + + echo $client | grep sylpheed > /dev/null 2>&1 + if [ $? -eq 0 ] ; then + DEBUG 3 "Running run_sylpheed \"$client\" \"$1\"" + run_sylpheed "$client" "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { local client @@ -469,6 +513,10 @@ case "$DE" in open_xfce "${mailto}" ;; + lxde) + open_lxde "${mailto}" + ;; + generic) open_generic "${mailto}" ;;