OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-icon-resource | 3 # xdg-icon-resource |
4 # | 4 # |
5 # Utility script to install icons on a Linux desktop. | 5 # Utility script to install icons on a Linux desktop. |
6 # | 6 # |
7 # Refer to the usage() function below for usage. | 7 # Refer to the usage() function below for usage. |
8 # | 8 # |
9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> | 9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> | 10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 #-------------------------------------- | 451 #-------------------------------------- |
452 # Checks for known desktop environments | 452 # Checks for known desktop environments |
453 # set variable DE to the desktop environments name, lowercase | 453 # set variable DE to the desktop environments name, lowercase |
454 | 454 |
455 detectDE() | 455 detectDE() |
456 { | 456 { |
457 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 | 457 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 |
458 unset GREP_OPTIONS | 458 unset GREP_OPTIONS |
459 | 459 |
460 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; | 460 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then |
461 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; | 461 case "${XDG_CURRENT_DESKTOP}" in |
462 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; | 462 GNOME) |
463 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul
l 2>&1; then DE=xfce; | 463 DE=gnome; |
464 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>
&1; then DE=xfce | 464 ;; |
| 465 KDE) |
| 466 DE=kde; |
| 467 ;; |
| 468 LXDE) |
| 469 DE=lxde; |
| 470 ;; |
| 471 XFCE) |
| 472 DE=xfce |
| 473 esac |
| 474 fi |
| 475 |
| 476 if [ x"$DE" = x"" ]; then |
| 477 # classic fallbacks |
| 478 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; |
| 479 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; |
| 480 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; |
| 481 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n
ull 2>&1; then DE=xfce; |
| 482 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null
2>&1; then DE=xfce |
| 483 fi |
465 fi | 484 fi |
466 | 485 |
467 if [ x"$DE" = x"" ]; then | 486 if [ x"$DE" = x"" ]; then |
468 # fallback to checking $DESKTOP_SESSION | 487 # fallback to checking $DESKTOP_SESSION |
469 case "$DESKTOP_SESSION" in | 488 case "$DESKTOP_SESSION" in |
470 gnome) | 489 gnome) |
471 DE=gnome; | 490 DE=gnome; |
472 ;; | 491 ;; |
473 LXDE) | 492 LXDE) |
474 DE=lxde; | 493 DE=lxde; |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 if [ x"$update" = x"yes" ] ; then | 943 if [ x"$update" = x"yes" ] ; then |
925 update_icon_database "$xdg_base_dir" | 944 update_icon_database "$xdg_base_dir" |
926 if [ -n "$dot_icon_dir" ] ; then | 945 if [ -n "$dot_icon_dir" ] ; then |
927 if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then | 946 if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then |
928 update_icon_database $dot_base_dir | 947 update_icon_database $dot_base_dir |
929 fi | 948 fi |
930 fi | 949 fi |
931 fi | 950 fi |
932 | 951 |
933 exit_success | 952 exit_success |
OLD | NEW |