lastellar.blogg.se

Mac sleep command parms
Mac sleep command parms








-inactivefor:xx - application will become active after xx minutes.-activefor:xx - application will become inactive after xx minutes.-exitafter:xx - application will terminate after xx minutes.-startoff - application starts disabled.Must be the first text on the commandline xx - where xx is a number which sets the number of seconds between simulated keypresses.There are some command line switches you can use to alter this behaviour: Double-clicking it again refills the pot, and will keep your machine awake.īy default the app starts enabled, and works every 59 seconds. Double-clicking the icon empties the coffee pot (that's what the icon is) and temporarily disables the program. The icon is shown above - it's the leftmost one in the task tray, and this is all you see. It works by simulating a keypress once every 59 seconds, so your machine thinks you're still working at the keyboard, so won't lock the screen or activate the screensaver. If you have problems with your PC locking or going to sleep, caffeine will keep it awake. See Technical Q&A QA1134: Programmatically causing restart, shutdown and/or logout.Īccording to man shutdown, shutdown -h now and shutdown -r now send processes a TERM signal followed by a KILL signal.Īccording to the Daemons and Services Programming Guide, when you tell loginwindow to log out, processes that support sudden termination are sent a KILL signal, and processes that don't support sudden termination are terminated in different ways: Cocoa applications receive the applicationShouldTerminate: delegate method, foreground applications receive the kAEQuitApplication Apple event, background applications receive the kAEQuitApplication Apple event followed by a KILL signal, and daemons receive a TERM signal followed by a KILL signal after a few seconds.Caffeine Prevent your computer from going to sleep loginwindow is sent the same Apple events as above when you log out, restart, shut down, or put the the Mac to sleep normally. The four letter codes for the Apple events are listed in AERegistry.h.Īll System Events commands above send Apple events to the loginwindow process. Put displays to sleep (10.9 and later): pmset displaysleepnow Go to sleep (AppleScript): osascript -e 'tell app "System Events" to sleep'

mac sleep command parms

Log out after showing a confirmation dialog: osascript -e 'tell app "System Events" to log out' Log out without showing a confirmation dialog: osascript -e 'tell app "System Events" to «event aevtrlgo»' Restart after showing a confirmation dialog: osascript -e 'tell app "loginwindow" to «event aevtrrst»' Restart without showing a confirmation dialog: osascript -e 'tell app "System Events" to restart' Shut down after showing a confirmation dialog: osascript -e 'tell app "loginwindow" to «event aevtrsdn»'

mac sleep command parms mac sleep command parms

Shut down without showing a confirmation dialog: osascript -e 'tell app "System Events" to shut down'










Mac sleep command parms