Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: third_party/xdg-utils/scripts/xdg-screensaver.in

Issue 6737007: Update xdg-utils to the latest version available in git. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-screensaver ('k') | third_party/xdg-utils/scripts/xdg-settings » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/xdg-utils/scripts/xdg-screensaver.in
===================================================================
--- third_party/xdg-utils/scripts/xdg-screensaver.in (revision 79890)
+++ third_party/xdg-utils/scripts/xdg-screensaver.in (working copy)
@@ -100,6 +100,10 @@
xscreensaver)
screensaver_xscreensaver "$1"
;;
+
+ '')
+ screensaver_xserver "$1"
+ ;;
esac
if [ "$1" = "suspend" ] ; then
@@ -300,7 +304,7 @@
;;
*)
- echo "ERROR: Unknown command '$1'" >&2
+ echo "ERROR: Unknown command '$1'" >&2
return 1
;;
esac
@@ -343,18 +347,61 @@
elif [ x"$status" = "xfalse" ]; then
echo "disabled"
else
- echo "ERROR: kdesktop KScreensaverIface isEnabled returned '$status'" >&2
+ echo "ERROR: kdesktop KScreensaverIface isEnabled returned '$status'" >&2
return 1
fi
;;
*)
- echo "ERROR: Unknown command '$1'" >&2
+ echo "ERROR: Unknown command '$1'" >&2
return 1
;;
esac
}
+screensaver_xserver()
+{
+ case "$1" in
+ suspend)
+ xset s off > /dev/null
+ result=$?
+ ;;
+
+ resume)
+ xset s default > /dev/null
+ result=$?
+ ;;
+
+ activate)
+ xset s activate > /dev/null
+ result=$?
+ ;;
+
+ reset)
+ xset s reset > /dev/null
+ result=$?
+ ;;
+
+ status)
+ timeout=`xset q | sed '/^Screen Saver:/,/^[^ ]/ { s/.*timeout: *\([0-9]*\).*/\1/; t }; d'`
+ result=$?
+ if [ "$timeout" -gt 0 ]; then
+ echo "enabled"
+ elif [ "$timeout" -eq 0 ]; then
+ echo "disabled"
+ else
+ echo "ERROR: xset q did not report the screensaver timeout" >&2
+ return 1
+ fi
+ ;;
+
+ *)
+ echo "ERROR: Unknown command '$1'" >&2
+ return 1
+ ;;
+ esac
+}
+
screensaver_suspend_loop()
{
lockfile
@@ -430,7 +477,7 @@
;;
*)
- echo "ERROR: Unknown command '$1" >&2
+ echo "ERROR: Unknown command '$1" >&2
return 1
;;
esac
@@ -475,7 +522,7 @@
;;
*)
- echo "ERROR: Unknown command '$1" >&2
+ echo "ERROR: Unknown command '$1" >&2
return 1
;;
esac
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-screensaver ('k') | third_party/xdg-utils/scripts/xdg-settings » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698