Home
| Calendar
| Mail Lists
| List Archives
| Desktop SIG
| Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU |
On Mon, May 17, 2010 at 7:51 PM, Bill Bogstad <bogstad-e+AXbWqSrlAAvxtiuMwx3w at public.gmane.org> wrote: >... > > http://coderrr.wordpress.com/2008/04/20/getting-idle-time-in-unix/ I decided to flesh out the example in that blog post. Attached is a simple C program which takes two arguments as follows: xidle minutes command If the default X display becomes idle for more minutes then specified the "command" will be executed. Polling is every 10 seconds. If "command" doesn't shutdown the system, polling will continue and "command" will be executed every 10 seconds until the X display goes non-idle. To shutdown, I would make "command" point to a shell script that calls "sudo shutdown" and make sure that the user can run shutdown via sudo with prompting. (Haven't actually tried that. I didn't want to shutdown my machine.) Enjoy, Bill Bogstad
BLU is a member of BostonUserGroups | |
We also thank MIT for the use of their facilities. |