Randy Syring wrote:
> I use synergy to connect the keyboard and mouse on my desktop to my
> laptop.  However, I have found that synergy keeps my monitors from
> shutting off when it is running.  I often forget to turn synergy off
> at the end of the day, which means my monitors waste energy and bulb
> life. 
>
> I would like to write a script in Python that would check if the
> computer had been idle (i.e. no user input) for > 1 hour and if so,
> shut down synergy if it is running.  I would appreciate pointers in
> two areas:
>
>     * How would I check how long the computer had been idle
>     * How would I kill a process if I only know the name
>
> Brief references would be fine, I am happy to go digging.

Idle time detection in Windows is surprisingly tricky.  You can have a
message sent to you when the screensaver fires up, but Synergy might be
suppressing that as well.  You could change your power management setup
to suspend or hibernate after an hour or two of idle time.

The only sure-fire method that I'm aware of is to install mouse and
keyboard hooks and watch the activity yourself.  That cannot (today) be
done in Python.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to