views:

113

answers:

1

I am developing a small application for home use in Python. It is supposed to act as a slide show screensaver, but also as a primitive image manager. I have the slide show and image manager aspects covered (I am using Tkinter), but I haven't implemented the screensaver bit yet. So, starting the app from the command line works fine.

I am running Ubuntu and as I need the application to be able to accept keyboard input I do not think I can use the xscreensaver/gnome-screensaver framework as it captures everything and displays the login dialog instead. I'd love to be proven wrong here (and it would be nice to return to xscreensaver after so many years :) ).

The solution I have in mind is to use PyXSS to detect when the user is idle and manage the screensaver bit myself. But it would be ideal to find another, platform independent solution, since I'd like to share this program with some of my Windows-using friends.

On to my questions, then:

  1. Can I use xscreensaver in some way to start my program but avoid xscreensaver's keyboard handling?

  2. Are there platform-independent alternatives to PyXSS?

  3. How would I go about to achieve the same functionality in Windows?

+1  A: 

Ummm, well there's pyhack which allows you to use xscreensaver which is available for Mac and Linux. Not sure about the pyhack module, but xscreensaverhack allows you to capture keyboard and mouse events.

I heard that there might be a python library for Windows screensaver programming. Even if there isn't, you can always use the win32api that comes with the win32 python package. Tutorials on the Internet will tell you which api functions to call for screensavers. Not sure about using pyopengl or anything like that....

Jason
Thanks! Finally an answer :) Will look into pyhack!
Peter Jaric