| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 DEBUG 3 "KDE has $client configured as email client which isn't inst
alled" | 99 DEBUG 3 "KDE has $client configured as email client which isn't inst
alled" |
| 100 if which gnome-open > /dev/null 2> /dev/null && which evolution > /d
ev/null 2> /dev/null; then | 100 if which gnome-open > /dev/null 2> /dev/null && which evolution > /d
ev/null 2> /dev/null; then |
| 101 DEBUG 3 "Try gnome-open instead" | 101 DEBUG 3 "Try gnome-open instead" |
| 102 open_gnome "$1" | 102 open_gnome "$1" |
| 103 fi | 103 fi |
| 104 fi | 104 fi |
| 105 fi | 105 fi |
| 106 DEBUG 1 "Running kmailservice \"$1\"" | 106 DEBUG 1 "Running kmailservice \"$1\"" |
| 107 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then | 107 if [ x"$KDE_SESSION_VERSION" = x"4" ]; then |
| 108 KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null` | 108 KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null` |
| 109 $KMAILSERVICE "$1" |
| 109 else | 110 else |
| 110 KMAILSERVICE=`which kmailservice 2>/dev/null` | 111 KMAILSERVICE=`which kmailservice 2>/dev/null` |
| 112 # KDE3 uses locale's encoding when decoding the URI, so set it to UTF-8 |
| 113 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" |
| 111 fi | 114 fi |
| 112 # KDE uses locale's encoding when decoding the URI, so set it to UTF-8 | |
| 113 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" | |
| 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() | 123 open_gnome3() |
| 124 { | 124 { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 fi | 364 fi |
| 365 | 365 |
| 366 detectDE | 366 detectDE |
| 367 | 367 |
| 368 if [ x"$DE" = x"" ]; then | 368 if [ x"$DE" = x"" ]; then |
| 369 DE=generic | 369 DE=generic |
| 370 fi | 370 fi |
| 371 | 371 |
| 372 # if BROWSER variable is not set, check some well known browsers instead | 372 # if BROWSER variable is not set, check some well known browsers instead |
| 373 if [ x"$BROWSER" = x"" ]; then | 373 if [ x"$BROWSER" = x"" ]; then |
| 374 BROWSER=links2:links:lynx:w3m | 374 BROWSER=links2:elinks:links:lynx:w3m |
| 375 if [ -n "$DISPLAY" ]; then | 375 if [ -n "$DISPLAY" ]; then |
| 376 BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrom
e:$BROWSER | 376 BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chrom
ium-browser:google-chrome:$BROWSER |
| 377 fi | 377 fi |
| 378 fi | 378 fi |
| 379 | 379 |
| 380 case "$DE" in | 380 case "$DE" in |
| 381 kde) | 381 kde) |
| 382 open_kde "${mailto}" | 382 open_kde "${mailto}" |
| 383 ;; | 383 ;; |
| 384 | 384 |
| 385 gnome) | 385 gnome) |
| 386 open_gnome "${mailto}" | 386 open_gnome "${mailto}" |
| 387 ;; | 387 ;; |
| 388 | 388 |
| 389 gnome3) | 389 gnome3) |
| 390 open_gnome3 "${mailto}" | 390 open_gnome3 "${mailto}" |
| 391 ;; | 391 ;; |
| 392 | 392 |
| 393 xfce) | 393 xfce) |
| 394 open_xfce "${mailto}" | 394 open_xfce "${mailto}" |
| 395 ;; | 395 ;; |
| 396 | 396 |
| 397 generic|lxde) | 397 generic|lxde) |
| 398 open_generic "${mailto}" | 398 open_generic "${mailto}" |
| 399 ;; | 399 ;; |
| 400 | 400 |
| 401 *) | 401 *) |
| 402 exit_failure_operation_impossible "no method available for opening '${mailto
}'" | 402 exit_failure_operation_impossible "no method available for opening '${mailto
}'" |
| 403 ;; | 403 ;; |
| 404 esac | 404 esac |
| OLD | NEW |