Guest User

xdg-email.patch

a guest
Apr 20th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.73 KB | None | 0 0
  1. --- xdg-email
  2. +++ xdg-email
  3. @@ -394,6 +394,17 @@
  4.      return 0
  5.  }
  6.  
  7. +run_claws()
  8. +{
  9. +    claws-mail --compose "$1"
  10. +    if [ $? -eq 0 ]
  11. +    then
  12. +        exit_success
  13. +    else
  14. +        exit_failure_operation_failed
  15. +    fi
  16. +}
  17. +
  18.  run_thunderbird()
  19.  {
  20.      local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH
  21. @@ -523,25 +534,30 @@
  22.  
  23.  open_generic()
  24.  {
  25. -    IFS=":"
  26. -    for browser in $BROWSER; do
  27. -        if [ x"$browser" != x"" ]; then
  28. -
  29. -            browser_with_arg=`printf "$browser" "$1" 2>/dev/null`
  30. -            if [ $? -ne 0 ]; then browser_with_arg=$browser;
  31. -            fi
  32. -
  33. -            if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
  34. -            else $browser_with_arg;
  35. -            fi
  36. -
  37. -            if [ $? -eq 0 ]; then exit_success;
  38. -            fi
  39. -        fi
  40. -    done
  41. -
  42. -    exit_failure_operation_impossible "no method available for opening '$1'"
  43. -}
  44. +   if pgrep -fl claws-mail
  45. +   then
  46. +       run_claws $1
  47. +   else
  48. +       IFS=":"
  49. +       for browser in $BROWSER; do
  50. +           if [ x"$browser" != x"" ]; then
  51. +
  52. +               browser_with_arg=`printf "$browser" "$1" 2>/dev/null`
  53. +               if [ $? -ne 0 ]; then browser_with_arg=$browser;
  54. +               fi
  55. +
  56. +               if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
  57. +               else $browser_with_arg;
  58. +               fi
  59. +
  60. +               if [ $? -eq 0 ]; then exit_success;
  61. +               fi
  62. +           fi
  63. +       done
  64. +
  65. +       exit_failure_operation_impossible "no method available for opening '$1'"
  66. +   fi
  67. +   }
  68.  
  69.  url_encode()
  70.  {
  71. @@ -728,11 +744,7 @@
  72.      open_xfce "${mailto}"
  73.      ;;
  74.  
  75. -    lxde)
  76. -    open_generic "${mailto}"
  77. -    ;;
  78. -
  79.      *)
  80. -    exit_failure_operation_impossible "no method available for opening '${mailto}'"
  81. +    open_generic "${mailto}"
  82.      ;;
  83.  esac
Advertisement
Add Comment
Please, Sign In to add comment