use full word "display" for variable in all places
[ozzloy@gmail.com/oble] / TODO
diff --git a/TODO b/TODO
index 6dae6432bd9d736d79ebc9e2d82fc42f933a47ed..30890d889c2eda3cf161d05fd0c40650782ef7a7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,42 +1,51 @@
+(track this down:
+dginn% ./oble -c ~/Downloads/haarcascade_frontalface_alt.xml
+Corrupt JPEG data: 160038 extraneous bytes before marker 0x69
+ERROR: frame is null...)
 FOR SCREENSAVER:
-* use [Un]Inhibit together as a SimulateUserActivity workalike
-       * disablegss.py from http://ubuntuforums.org/showthread.php?t=284804
-       * this method doesn't work either.  tried in gss-poke.py
-* xdg-screensaver suspend / resume to SimulateUserActivity
-       * http://tronche.com/gui/x/xlib-tutorial/2nd-program-anatomy.html
-       * http://portland.freedesktop.org/xdg-utils-1.0beta3/xdg-screensaver.html
-* SimulateUserActivity
-       * does it work on other people's machines?
-               * find if other people have their gnome-screensaver run even if they set
-               screensaver timeout to 1 minute and run:
-               for ((i = 0; i < 999; i++)); do
-                       sleep 50;
-                       gnome-screensaver-command --poke;
-               done;
+* gnome-screensaver-command --poke
        * find irc channel to ask if my understanding is correct
        * file bug
        * track down bug
                * compile gnome-screensaver
-* cli opt parse
-       * quiet mode
-               * no display window
-               * no text printed to terminal
-* fire up the face detector only just before going to inactive mode.
-       * that way the camera isn't running all the time
-       * maybe start 10 seconds before going inactive, then run until activity
-* be more aggressive with turning off the screen.  dim the screen as soon as
-it's not being looked at.  turn it off soon thereafter.
-       * could be enough to save battery.  would need to power the camera sometimes,
-       but would save on backlight.  need to test.
-* don't prevent sleep when face is detected, but user isn't actually looking at
-screen.
-       * requires pose estimation.
-       * also requires estimating the direction of the eye.
-
-OTHER IDEAS:
-* authenticating a user based on face recognition (as opposed to face
-detection)
-       * much more difficult to do reliably
-       * use object tracking and emotion estimation to require a set of facial
-       expressions as authentication.
-               * awesome for people who find typing hard, eg: no hands
+
+http://coderrr.wordpress.com/2008/04/20/getting-idle-time-in-unix/#comment-1927
+in c:
+#include <X11/extensions/scrnsaver.h>
+
+main() {
+  XScreenSaverInfo *info = XScreenSaverAllocInfo();
+  Display *display = XOpenDisplay(0);
+
+  XScreenSaverQueryInfo(display, DefaultRootWindow(display), info);
+  printf("%u ms\n", info->idle);
+}
+in ruby inline:
+require 'inline'
+
+class XScreenSaver
+  class << self
+    inline do |builder|
+      builder.add_link_flags '-lXss'
+      builder.include '<X11/extensions/scrnsaver.h>'
+      builder.c %{
+        double idle_time() {
+          static Display *display;
+          XScreenSaverInfo *info = XScreenSaverAllocInfo();
+
+          if (!display)  display = XOpenDisplay(0);
+          if (!display)  return -1;
+
+          XScreenSaverQueryInfo(display, DefaultRootWindow(display), info);
+
+          return info->idle / 1000.0;
+        }
+      }
+    end
+  end
+end
+
+if __FILE__ == $0
+  loop { puts XScreenSaver.idle_time; sleep 0.2 }
+end
+