| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 #--------------------------------------------- | 2 #--------------------------------------------- |
| 3 # xdg-screensaver | 3 # xdg-screensaver |
| 4 # | 4 # |
| 5 # Utility script to control screensaver. | 5 # Utility script to control screensaver. |
| 6 # | 6 # |
| 7 # Refer to the usage() function below for usage. | 7 # Refer to the usage() function below for usage. |
| 8 # | 8 # |
| 9 # Copyright 2006, Bryce Harrington <bryce@osdl.org> | 9 # Copyright 2006, Bryce Harrington <bryce@osdl.org> |
| 10 # | 10 # |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 385 |
| 386 #-------------------------------------- | 386 #-------------------------------------- |
| 387 # Checks for known desktop environments | 387 # Checks for known desktop environments |
| 388 # set variable DE to the desktop environments name, lowercase | 388 # set variable DE to the desktop environments name, lowercase |
| 389 | 389 |
| 390 detectDE() | 390 detectDE() |
| 391 { | 391 { |
| 392 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 | 392 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 |
| 393 unset GREP_OPTIONS | 393 unset GREP_OPTIONS |
| 394 | 394 |
| 395 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; | 395 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then |
| 396 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; | 396 case "${XDG_CURRENT_DESKTOP}" in |
| 397 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; | 397 GNOME) |
| 398 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul
l 2>&1; then DE=xfce; | 398 DE=gnome; |
| 399 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>
&1; then DE=xfce | 399 ;; |
| 400 KDE) |
| 401 DE=kde; |
| 402 ;; |
| 403 LXDE) |
| 404 DE=lxde; |
| 405 ;; |
| 406 XFCE) |
| 407 DE=xfce |
| 408 esac |
| 409 fi |
| 410 |
| 411 if [ x"$DE" = x"" ]; then |
| 412 # classic fallbacks |
| 413 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; |
| 414 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; |
| 415 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; |
| 416 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n
ull 2>&1; then DE=xfce; |
| 417 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null
2>&1; then DE=xfce |
| 418 fi |
| 400 fi | 419 fi |
| 401 | 420 |
| 402 if [ x"$DE" = x"" ]; then | 421 if [ x"$DE" = x"" ]; then |
| 403 # fallback to checking $DESKTOP_SESSION | 422 # fallback to checking $DESKTOP_SESSION |
| 404 case "$DESKTOP_SESSION" in | 423 case "$DESKTOP_SESSION" in |
| 405 gnome) | 424 gnome) |
| 406 DE=gnome; | 425 DE=gnome; |
| 407 ;; | 426 ;; |
| 408 LXDE) | 427 LXDE) |
| 409 DE=lxde; | 428 DE=lxde; |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 if [ "$action" = "suspend" ] ; then | 1058 if [ "$action" = "suspend" ] ; then |
| 1040 # Start tracking $window_id and resume the screensaver once it disappears | 1059 # Start tracking $window_id and resume the screensaver once it disappears |
| 1041 ( track_window ) 2> /dev/null > /dev/null & | 1060 ( track_window ) 2> /dev/null > /dev/null & |
| 1042 fi | 1061 fi |
| 1043 | 1062 |
| 1044 if [ $result -eq 0 ]; then | 1063 if [ $result -eq 0 ]; then |
| 1045 exit_success | 1064 exit_success |
| 1046 else | 1065 else |
| 1047 exit_failure_operation_failed | 1066 exit_failure_operation_failed |
| 1048 fi | 1067 fi |
| OLD | NEW |