| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 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 2006, Kevin Krammer <kevin.krammer@gmx.at> | 10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 [ -z $client ] && client="kmail" | 386 [ -z $client ] && client="kmail" |
| 387 if ! which $client > /dev/null 2> /dev/null; then | 387 if ! which $client > /dev/null 2> /dev/null; then |
| 388 DEBUG 3 "KDE has $client configured as email client which isn't inst
alled" | 388 DEBUG 3 "KDE has $client configured as email client which isn't inst
alled" |
| 389 if which gnome-open > /dev/null 2> /dev/null && which evolution > /d
ev/null 2> /dev/null; then | 389 if which gnome-open > /dev/null 2> /dev/null && which evolution > /d
ev/null 2> /dev/null; then |
| 390 DEBUG 3 "Try gnome-open instead" | 390 DEBUG 3 "Try gnome-open instead" |
| 391 open_gnome "$1" | 391 open_gnome "$1" |
| 392 fi | 392 fi |
| 393 fi | 393 fi |
| 394 fi | 394 fi |
| 395 DEBUG 1 "Running kmailservice \"$1\"" | 395 DEBUG 1 "Running kmailservice \"$1\"" |
| 396 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then |
| 397 KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null` |
| 398 else |
| 399 KMAILSERVICE=`which kmailservice 2>/dev/null` |
| 400 fi |
| 396 # KDE uses locale's encoding when decoding the URI, so set it to UTF-8 | 401 # KDE uses locale's encoding when decoding the URI, so set it to UTF-8 |
| 397 LC_ALL=C.UTF-8 kmailservice "$1" | 402 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" |
| 398 kfmclient_fix_exit_code $? | 403 kfmclient_fix_exit_code $? |
| 399 | 404 |
| 400 if [ $? -eq 0 ]; then | 405 if [ $? -eq 0 ]; then |
| 401 exit_success | 406 exit_success |
| 402 else | 407 else |
| 403 exit_failure_operation_failed | 408 exit_failure_operation_failed |
| 404 fi | 409 fi |
| 405 } | 410 } |
| 406 | 411 |
| 407 open_gnome() | 412 open_gnome() |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 ;; | 637 ;; |
| 633 | 638 |
| 634 generic) | 639 generic) |
| 635 open_generic "${mailto}" | 640 open_generic "${mailto}" |
| 636 ;; | 641 ;; |
| 637 | 642 |
| 638 *) | 643 *) |
| 639 exit_failure_operation_impossible "no method available for opening '${mailto
}'" | 644 exit_failure_operation_impossible "no method available for opening '${mailto
}'" |
| 640 ;; | 645 ;; |
| 641 esac | 646 esac |
| OLD | NEW |