Open GoogleCodeExporter opened 8 years ago
I'll look and see if there _is_ a Cocoa framework that does this. Do you have
an example of another app that does this sort of thing?
Original comment by gregnea...@mac.com
on 21 Jul 2010 at 8:39
Umm, you mean by using Cocoa or some other methods?
Not that I know at this moment, that applescript-hackish-thingy has worked for
me.
I am not sure what that old iHook could do, it probably does not hurt to look
at it's source:
http://ihook.cvs.sourceforge.net/viewvc/ihook/ihook/
Original comment by miq...@gmail.com
on 21 Jul 2010 at 8:49
No, any commerical or Apple-supplied app that does this. I'm wondering if this
is Apple-sanctioned behavior... If not, there's not likely to be a "native" way
to do it.
Again this could be handled in a preflight script...
-Greg
Original comment by gregnea...@mac.com
on 21 Jul 2010 at 8:58
This can be achieved by inserting plain-old-applescript in
/usr/local/munki/updatecheckhelper between sleep and managedsoftwareupdate
--auto -commands:
sleep $seconds
# send empty keystroke which wakes up the screen and disables screensaver
running over loginwindow
/usr/bin/osascript -e 'tell application "System Events"' -e 'key code "" using
control down' -e 'end tell'
/usr/local/munki/managedsoftwareupdate --auto
(This could also be inserted in managedsoftwareupdate to be run on every check
and install cycle but that is another story...and it could be managed by a
separate key in ManagedInstalls.plist...yet another to-do-later...)
Original comment by miq...@gmail.com
on 22 Aug 2010 at 10:08
To do this in Carbon, code:
#include <Carbon/Carbon.h>
main() {
while (1==1) {
UpdateSystemActivity(OverallAct);
sleep(30);
}
}
I think the code speaks for itself, so unless the machine goes to deep sleep
before 30 seconds has passed this will do the trick I think.
Compile as UB:
cc -arch ppc -o keypressppc keypress.c -framework Carbon
cc -arch i386 -o keypressi386 keypress.c -framework Carbon
lipo keypresspcc keypressi386 -create -o keypress
Original comment by analspr...@gmail.com
on 2 Feb 2011 at 9:25
Thank you very much si...@ifixit.no.
This works, it keeps sends screen lit when it is running.
As this "application" keeps running until it is terminated (while loop is true
forever) it needs to be killed after munki has run.
Otherwise it will keep system awake as it sends activity message to system
every 30 seconds.
-MiqViq
Original comment by miq...@gmail.com
on 3 Feb 2011 at 12:46
Yes, I needs to be killed... You could remove the loop and loop it from the
munki script too.
Original comment by analspr...@gmail.com
on 9 Feb 2011 at 9:46
Original issue reported on code.google.com by
miq...@gmail.com
on 21 Jul 2010 at 8:36