OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-desktop-menu | 3 # xdg-desktop-menu |
4 # | 4 # |
5 # Utility script to install menu items on a Linux desktop. | 5 # Utility script to install menu items on a Linux desktop. |
6 # Refer to the usage() function below for usage. | 6 # Refer to the usage() function below for usage. |
7 # | 7 # |
8 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> | 8 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
9 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> | 9 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> |
10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> | 10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 | 654 |
655 #-------------------------------------- | 655 #-------------------------------------- |
656 # Checks for known desktop environments | 656 # Checks for known desktop environments |
657 # set variable DE to the desktop environments name, lowercase | 657 # set variable DE to the desktop environments name, lowercase |
658 | 658 |
659 detectDE() | 659 detectDE() |
660 { | 660 { |
661 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 | 661 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 |
662 unset GREP_OPTIONS | 662 unset GREP_OPTIONS |
663 | 663 |
664 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; | 664 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then |
665 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; | 665 case "${XDG_CURRENT_DESKTOP}" in |
666 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; | 666 GNOME) |
667 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul
l 2>&1; then DE=xfce; | 667 DE=gnome; |
668 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>
&1; then DE=xfce | 668 ;; |
| 669 KDE) |
| 670 DE=kde; |
| 671 ;; |
| 672 LXDE) |
| 673 DE=lxde; |
| 674 ;; |
| 675 XFCE) |
| 676 DE=xfce |
| 677 esac |
| 678 fi |
| 679 |
| 680 if [ x"$DE" = x"" ]; then |
| 681 # classic fallbacks |
| 682 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; |
| 683 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; |
| 684 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; |
| 685 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n
ull 2>&1; then DE=xfce; |
| 686 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null
2>&1; then DE=xfce |
| 687 fi |
669 fi | 688 fi |
670 | 689 |
671 if [ x"$DE" = x"" ]; then | 690 if [ x"$DE" = x"" ]; then |
672 # fallback to checking $DESKTOP_SESSION | 691 # fallback to checking $DESKTOP_SESSION |
673 case "$DESKTOP_SESSION" in | 692 case "$DESKTOP_SESSION" in |
674 gnome) | 693 gnome) |
675 DE=gnome; | 694 DE=gnome; |
676 ;; | 695 ;; |
677 LXDE) | 696 LXDE) |
678 DE=lxde; | 697 DE=lxde; |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 | 1326 |
1308 ;; | 1327 ;; |
1309 esac | 1328 esac |
1310 done | 1329 done |
1311 | 1330 |
1312 if [ x"$update" = x"yes" ] ; then | 1331 if [ x"$update" = x"yes" ] ; then |
1313 update_desktop_database | 1332 update_desktop_database |
1314 fi | 1333 fi |
1315 | 1334 |
1316 exit_success | 1335 exit_success |
OLD | NEW |