![]() ![]() ![]() You could use the above to trigger a script at the 4 minute idle time mark to alert them it will log out in one minute, for example. It can be used to execute a Unix command when the Mac or the display of the Mac goes to sleep mode or wakes up, after a given time without user interaction or when the user. Only thing is, it installs a System StartupItem to do its work, so you'll have to decide if you really want to use something like that.Īnother way to do it to get idle time with ioreg. SleepWatcher 2.2.1 (running with Mac OS X 10.5 and above, source code included) is a command line tool (daemon) for macOS that monitors sleep, wakeup and idleness of a Mac. It takes a little work to figure out how to use it, and you would need to package it and deploy to your Macs (but that's true for CocoaDialog as well) But it allows you to trigger a script on an idle time (that you can specify) or sleep/wake. To make something come up after, say, 4 minutes of idle time on the Mac, you might want to take a look at SleepWatcher- Ive just had the same problem with some Edifier speakers and I had to follow these steps: - install bluetoothconnector from Homebrew - run bluetoothconnector on terminal to get the speakers MAC address - run Automator, create a shell script with command bluetoothconnector -connect xx-xx-xx-xx-xx-xx and save it as. It only facilitates the mechanism to display a message to the user and get input it can act on. Id first look at launchctl list and then ps to see if SleepWatcher is running two instances. Your script then calls the program imagesnap. It supposedly runs your /etc/wakeup.rc script on computer wake. I've been playing with it since it was suggested here, but its not going to help you figure out the logic of how to get that message to pop up before the Mac is about to log out. Youve got a daemon called SleepWatcher 2.2 which is being kept alive by launchd.
0 Comments
Leave a Reply. |