OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-settings | 3 # xdg-settings |
4 # | 4 # |
5 # Utility script to get various settings from the desktop environment. | 5 # Utility script to get various settings from the desktop environment. |
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, Google Inc. | 9 # Copyright 2009, Google Inc. |
10 # | 10 # |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 #-------------------------------------- | 366 #-------------------------------------- |
367 # Checks for known desktop environments | 367 # Checks for known desktop environments |
368 # set variable DE to the desktop environments name, lowercase | 368 # set variable DE to the desktop environments name, lowercase |
369 | 369 |
370 detectDE() | 370 detectDE() |
371 { | 371 { |
372 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 | 372 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 |
373 unset GREP_OPTIONS | 373 unset GREP_OPTIONS |
374 | 374 |
375 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; | 375 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then |
376 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; | 376 case "${XDG_CURRENT_DESKTOP}" in |
377 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; | 377 GNOME) |
378 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul
l 2>&1; then DE=xfce; | 378 DE=gnome; |
379 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>
&1; then DE=xfce | 379 ;; |
| 380 KDE) |
| 381 DE=kde; |
| 382 ;; |
| 383 LXDE) |
| 384 DE=lxde; |
| 385 ;; |
| 386 XFCE) |
| 387 DE=xfce |
| 388 esac |
| 389 fi |
| 390 |
| 391 if [ x"$DE" = x"" ]; then |
| 392 # classic fallbacks |
| 393 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; |
| 394 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; |
| 395 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; |
| 396 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n
ull 2>&1; then DE=xfce; |
| 397 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null
2>&1; then DE=xfce |
| 398 fi |
380 fi | 399 fi |
381 | 400 |
382 if [ x"$DE" = x"" ]; then | 401 if [ x"$DE" = x"" ]; then |
383 # fallback to checking $DESKTOP_SESSION | 402 # fallback to checking $DESKTOP_SESSION |
384 case "$DESKTOP_SESSION" in | 403 case "$DESKTOP_SESSION" in |
385 gnome) | 404 gnome) |
386 DE=gnome; | 405 DE=gnome; |
387 ;; | 406 ;; |
388 LXDE) | 407 LXDE) |
389 DE=lxde; | 408 DE=lxde; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 ;; | 975 ;; |
957 | 976 |
958 generic) | 977 generic) |
959 dispatch_generic "$@" | 978 dispatch_generic "$@" |
960 ;; | 979 ;; |
961 | 980 |
962 *) | 981 *) |
963 exit_failure_operation_impossible "unknown desktop environment" | 982 exit_failure_operation_impossible "unknown desktop environment" |
964 ;; | 983 ;; |
965 esac | 984 esac |
OLD | NEW |