| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 #--------------------------------------------- | 2 #--------------------------------------------- |
| 3 # xdg-email | 3 # xdg-email |
| 4 # | 4 # |
| 5 # Utility script to open the users favorite email program, using the | 5 # Utility script to open the users favorite email program, using the |
| 6 # RFC 2368 mailto: URI spec | 6 # RFC 2368 mailto: URI spec |
| 7 # | 7 # |
| 8 # Refer to the usage() function below for usage. | 8 # Refer to the usage() function below for usage. |
| 9 # | 9 # |
| 10 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> | 10 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" | 113 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" |
| 114 kfmclient_fix_exit_code $? | 114 kfmclient_fix_exit_code $? |
| 115 | 115 |
| 116 if [ $? -eq 0 ]; then | 116 if [ $? -eq 0 ]; then |
| 117 exit_success | 117 exit_success |
| 118 else | 118 else |
| 119 exit_failure_operation_failed | 119 exit_failure_operation_failed |
| 120 fi | 120 fi |
| 121 } | 121 } |
| 122 | 122 |
| 123 open_gnome3() |
| 124 { |
| 125 local client |
| 126 local desktop |
| 127 desktop=`xdg-mime query default "x-scheme-handler/mailto"` |
| 128 client=`desktop_file_to_binary "$browser"` |
| 129 echo $client | grep thunderbird > /dev/null 2>&1 |
| 130 if [ $? -eq 0 ] ; then |
| 131 run_thunderbird "$client" "$1" |
| 132 fi |
| 133 |
| 134 if gvfs-open --help 2>/dev/null 1>&2; then |
| 135 DEBUG 1 "Running gvfs-open \"$1\"" |
| 136 gvfs-open "$1" |
| 137 else |
| 138 DEBUG 1 "Running gnome-open \"$1\"" |
| 139 gnome-open "$1" |
| 140 fi |
| 141 |
| 142 if [ $? -eq 0 ]; then |
| 143 exit_success |
| 144 else |
| 145 exit_failure_operation_failed |
| 146 fi |
| 147 } |
| 148 |
| 123 open_gnome() | 149 open_gnome() |
| 124 { | 150 { |
| 125 local client | 151 local client |
| 126 client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -
d ' ' -f 1` || "" | 152 client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -
d ' ' -f 1` || "" |
| 127 echo $client | grep thunderbird > /dev/null 2>&1 | 153 echo $client | grep thunderbird > /dev/null 2>&1 |
| 128 if [ $? -eq 0 ] ; then | 154 if [ $? -eq 0 ] ; then |
| 129 run_thunderbird "$client" "$1" | 155 run_thunderbird "$client" "$1" |
| 130 fi | 156 fi |
| 131 | 157 |
| 132 if gvfs-open --help 2>/dev/null 1>&2; then | 158 if gvfs-open --help 2>/dev/null 1>&2; then |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 379 |
| 354 case "$DE" in | 380 case "$DE" in |
| 355 kde) | 381 kde) |
| 356 open_kde "${mailto}" | 382 open_kde "${mailto}" |
| 357 ;; | 383 ;; |
| 358 | 384 |
| 359 gnome) | 385 gnome) |
| 360 open_gnome "${mailto}" | 386 open_gnome "${mailto}" |
| 361 ;; | 387 ;; |
| 362 | 388 |
| 389 gnome3) |
| 390 open_gnome3 "${mailto}" |
| 391 ;; |
| 392 |
| 363 xfce) | 393 xfce) |
| 364 open_xfce "${mailto}" | 394 open_xfce "${mailto}" |
| 365 ;; | 395 ;; |
| 366 | 396 |
| 367 generic|lxde) | 397 generic|lxde) |
| 368 open_generic "${mailto}" | 398 open_generic "${mailto}" |
| 369 ;; | 399 ;; |
| 370 | 400 |
| 371 *) | 401 *) |
| 372 exit_failure_operation_impossible "no method available for opening '${mailto
}'" | 402 exit_failure_operation_impossible "no method available for opening '${mailto
}'" |
| 373 ;; | 403 ;; |
| 374 esac | 404 esac |
| OLD | NEW |