class XScreenSaverInfo(ctypes.Structure):
    _fields_ = [('window', ctypes.c_long), ('state', ctypes.c_int), ('kind',
        ctypes.c_int), ('til_or_since', ctypes.c_ulong), ('idle', ctypes.
        c_ulong), ('eventMask', ctypes.c_ulong)]


class IdleXScreenSaver(object):

    def __init__(self):
        self.xss = self._get_library('Xss')
self.gdk = self._get_library('gdk-x11-2.0')
How can I determine the display idle time from Python in Windows, Linux, and MacOS?