From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1GaHDG-00087o-6V for garchives@archives.gentoo.org; Wed, 18 Oct 2006 19:36:26 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.6) with SMTP id k9IJXQEc005185; Wed, 18 Oct 2006 19:33:26 GMT Received: from Mail.Math.Princeton.EDU (mail.math.Princeton.EDU [128.112.18.14]) by robin.gentoo.org (8.13.8/8.13.6) with ESMTP id k9IJU9hr000832 for ; Wed, 18 Oct 2006 19:30:09 GMT Received: from math.Princeton.EDU (math.Princeton.EDU [128.112.18.16]) by Mail.Math.Princeton.EDU (8.12.11.20060308/8.12.11) with ESMTP id k9IJU8LM000709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 18 Oct 2006 15:30:08 -0400 Received: from math.Princeton.EDU (localhost.localdomain [127.0.0.1]) by math.Princeton.EDU (8.13.1/8.13.1) with ESMTP id k9IJU8jB017208 for ; Wed, 18 Oct 2006 15:30:08 -0400 Received: (from wwong@localhost) by math.Princeton.EDU (8.13.1/8.13.1/Submit) id k9IJU8CS017205 for gentoo-user@lists.gentoo.org; Wed, 18 Oct 2006 15:30:08 -0400 X-Authentication-Warning: math.Princeton.EDU: wwong set sender to wwong@princeton.edu using -f Date: Wed, 18 Oct 2006 15:30:08 -0400 From: Willie Wong To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Run script when X is idle for some time? Message-ID: <20061018193008.GB15031@math.princeton.edu> References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Archives-Salt: ec067723-282a-40fc-a146-315bcaf49dbb X-Archives-Hash: 4163a005cf9b3a504354653d9fc64dd8 On Thu, Oct 19, 2006 at 02:32:35AM +0800, Qiangning Hong wrote: > I'd like to run a script after X is idle for some time (e.g. 5 > minute), just like what gaim do (it set my status to "away" if I > haven't touch anything for some time). How can I do? FYI, I have > some Shell/C/Python programming skill. I might be wrong, but I think Gaim uses the xscreensaver extension from libXScrnSaver. There is a PyXSS module which can extract information about Xscreensaver including idle time. If the idle time that you have is the same as your xscreensaver blanking time, then you can just use the 'xscreensaver-command -watch' command (look at man xscreensaver-command for more info). I use it with festival to have my computer greet me in the morning when I unlock the screen. W -- Willie W. Wong wwong@math.princeton.edu 408 Fine Hall, Department of Mathematics, Princeton University, Princeton A mathematician's reputation rests on the number of bad proofs he has given. -- gentoo-user@gentoo.org mailing list