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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 410 |
411 #-------------------------------------- | 411 #-------------------------------------- |
412 # Checks for known desktop environments | 412 # Checks for known desktop environments |
413 # set variable DE to the desktop environments name, lowercase | 413 # set variable DE to the desktop environments name, lowercase |
414 | 414 |
415 detectDE() | 415 detectDE() |
416 { | 416 { |
417 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 | 417 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 |
418 unset GREP_OPTIONS | 418 unset GREP_OPTIONS |
419 | 419 |
420 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; | 420 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then |
421 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; | 421 case "${XDG_CURRENT_DESKTOP}" in |
422 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/D
Bus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/nul
l 2>&1` ; then DE=gnome; | 422 GNOME) |
423 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul
l 2>&1; then DE=xfce; | 423 DE=gnome; |
424 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>
&1; then DE=xfce | 424 ;; |
| 425 KDE) |
| 426 DE=kde; |
| 427 ;; |
| 428 LXDE) |
| 429 DE=lxde; |
| 430 ;; |
| 431 XFCE) |
| 432 DE=xfce |
| 433 esac |
| 434 fi |
| 435 |
| 436 if [ x"$DE" = x"" ]; then |
| 437 # classic fallbacks |
| 438 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; |
| 439 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; |
| 440 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop
/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/n
ull 2>&1` ; then DE=gnome; |
| 441 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n
ull 2>&1; then DE=xfce; |
| 442 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null
2>&1; then DE=xfce |
| 443 fi |
425 fi | 444 fi |
426 | 445 |
427 if [ x"$DE" = x"" ]; then | 446 if [ x"$DE" = x"" ]; then |
428 # fallback to checking $DESKTOP_SESSION | 447 # fallback to checking $DESKTOP_SESSION |
429 case "$DESKTOP_SESSION" in | 448 case "$DESKTOP_SESSION" in |
430 gnome) | 449 gnome) |
431 DE=gnome; | 450 DE=gnome; |
432 ;; | 451 ;; |
433 LXDE) | 452 LXDE) |
434 DE=lxde; | 453 DE=lxde; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 ;; | 856 ;; |
838 | 857 |
839 generic|lxde) | 858 generic|lxde) |
840 open_generic "${mailto}" | 859 open_generic "${mailto}" |
841 ;; | 860 ;; |
842 | 861 |
843 *) | 862 *) |
844 exit_failure_operation_impossible "no method available for opening '${mailto
}'" | 863 exit_failure_operation_impossible "no method available for opening '${mailto
}'" |
845 ;; | 864 ;; |
846 esac | 865 esac |
OLD | NEW |