I've found many useful Bash commands that can execute OS X behaviors from the command line such as:
screencapture -x -C $FILENAME
Is there such a command that can check if the screen saver is active?
On your Mac, choose Apple menu > System Preferences, click Desktop & Screen Saver , then click Screen Saver. Click the “Show screen saver after” pop-up menu, then choose how long you want your Mac to wait before starting the screen saver when it's idle.
Mac OS X ShellsMac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.
These are located at "/System/Library/Screen Savers".
I am using this:
ps ax|grep [S]creenSaverEngine > /dev/null
if [ "$?" != "0" ] ; then
# screen saver is not active
else
# screen saver is active
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With