[PyKDE] idle time detection

Torsten Marek shlomme at gmx.net
Thu Nov 9 21:20:39 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Pakulat schrieb:
> On 09.11.06 21:50:51, Torsten Marek wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Matt Newell schrieb:
>>> On Thursday 09 November 2006 11:48, Andreas Pakulat wrote:
>>>> On 09.11.06 19:51:11, Sebastian Kügler wrote:
>>>>> Can anyone think of some clean way for a PyKDE application to detect idle
>>>>> time?
>>>>>
>>>>> For the Kubuntu powermanager applet, we're currently missing that
>>>>> feature. The usecase would be kicking in a suspend / hibernate / dimming
>>>>> display after N seconds of no mouse or keyboard activity.
>>>> You have to hook into X11 then, I think.
>>> You need to use the XScreenSaver extension.  Attached is a c++ class used by 
>>> older psi that i use in one of my projects.  I'm not sure but you can 
>>> probably achieve the same thing with pure python.
>> just a heads up,  you might want to look at ctypes if you do stuff like that, no
>> need to write a C extension yourself. Remember, ctypes is stdlib in 2.5.
> 
> Well, I can see a X11 interface module here on my Debian machine:
> python-xlib, so I guess the same is true for kubuntu. Which means
> Sebastian could rewrite this small class in plain Python.

Hi,

yes, I'm aware of python-xlib. Apart from that, ctypes is as plain as calling C
functions directly from Python gets, and (which was my main point) is in the stdlib.

best,

Torsten

- --
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFU5unfMVFHqJEyFgRAny0AKCYNXfCUlZR0aZowOoBFl00JBPEBQCeMAlV
r3I3sMpWUCzPZYY7YcwwBVw=
=Yh+3
-----END PGP SIGNATURE-----




More information about the PyQt mailing list