Does anyone know a way to request OS X to find out how much time is actually left before it enters system sleep or activates sleep mode (or even sleep mode), either through the command line or any other method (e.g. Ruby or Objective-C)?
I thought something like pmset through the command line might have suggested this information, but apparently it only shows and updates the current settings, and does not allow getting feedback from where in the current OS loop.
My requirement is that I currently have a Ruby script that I would like to run only when I am not using the machine, and a simple "whatcher script" would allow this, but what to look for 'I need a little help.
There seems to be a simple answer, but so far I have not found anything obvious. Any ideas?
source share