Mac Usenet  

Go Back   Mac Usenet > Main Category > Mac Programmer
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


can I get notification of system becoming idle?

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-14-2005, 05:34 AM
Donald Hall
Guest
 
Posts: n/a
Default can I get notification of system becoming idle?

Does anyone know if there is a way to have a program be notified if the
system enters or leaves an idle state? I am aware of Carbon event loop
idle timers, but they only apply to the current program, not the system
as a whole. I am also aware of the idler.c program that would give me
the actual idle time if I asked for it - not what I want. I want to know
when the idle time exceeding some value triggers an idle state, and also
when it has be reset. (I am not sure if this is what the "busy state"
refers to.)

I have been going over the IOKit documentation, but am finding it very
terse and hard to penetrate.


Thanks for any pointers, tips, or sample code,

Don

--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.appsandmore.com
don at appsandmore dot com
"Schedule your scripts with Script Timer"
  #2  
Old 11-14-2005, 07:59 AM
Sherm Pendley
Guest
 
Posts: n/a
Default Re: can I get notification of system becoming idle?

Donald Hall <spamback@127.0.0.1> writes:

> Does anyone know if there is a way to have a program be notified if the
> system enters or leaves an idle state? I am aware of Carbon event loop
> idle timers, but they only apply to the current program, not the system
> as a whole. I am also aware of the idler.c program that would give me
> the actual idle time if I asked for it - not what I want. I want to know
> when the idle time exceeding some value triggers an idle state, and also
> when it has be reset. (I am not sure if this is what the "busy state"
> refers to.)
>
> I have been going over the IOKit documentation, but am finding it very
> terse and hard to penetrate.
>
>
> Thanks for any pointers, tips, or sample code,


You didn't mention if you're using Carbon, Cocoa, or something else. If
you're using Cocoa, you could watch for NSWorkspaceWillSleepNotification
and NSWorkspaceDidWakeNotification.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
  #3  
Old 11-15-2005, 05:25 AM
Donald Hall
Guest
 
Posts: n/a
Default Re: can I get notification of system becoming idle?

In article <m2d5l3zjtz.fsf@Sherm-Pendleys-Computer.local>,
Sherm Pendley <sherm@dot-app.org> wrote:

> Donald Hall <spamback@127.0.0.1> writes:
>
> > Does anyone know if there is a way to have a program be notified if the
> > system enters or leaves an idle state? I am aware of Carbon event loop
> > idle timers, but they only apply to the current program, not the system
> > as a whole. I am also aware of the idler.c program that would give me
> > the actual idle time if I asked for it - not what I want. I want to know
> > when the idle time exceeding some value triggers an idle state, and also
> > when it has be reset. (I am not sure if this is what the "busy state"
> > refers to.)
> >
> > I have been going over the IOKit documentation, but am finding it very
> > terse and hard to penetrate.
> >
> >
> > Thanks for any pointers, tips, or sample code,

>
> You didn't mention if you're using Carbon, Cocoa, or something else. If
> you're using Cocoa, you could watch for NSWorkspaceWillSleepNotification
> and NSWorkspaceDidWakeNotification.
>
> sherm--


Thanks for the reply, Sherm. I actually have sleep and wake covered -
it's idle that I was trying to do. It doesn't appear that there is any
publicly available way to be notified of the beginning or end of an idle
period. Obviously, there is a way, as something starts the screen saver
after the appropriate period of idleness.

Don

--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.appsandmore.com
don at appsandmore dot com
"Schedule your scripts with Script Timer"
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 12:13 PM.


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Search Engine Friendly URLs by vBSEO 2.0(RC6)