检查屏幕保护程序激活使用Mac bash脚本命令 [英] Check if Screensaver is Active using Mac Bash Script Command
本文介绍了检查屏幕保护程序激活使用Mac bash脚本命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现,可以在命令行中执行OS X的行为,如许多有用的Bash的命令:
I've found many useful Bash commands that can execute OS X behaviors from the command line such as:
抓屏-x -C $ FILENAME
有没有这样,可以检查激活屏幕保护程序的命令?
Is there such a command that can check if the screen saver is active?
推荐答案
我使用这样的:
ps ax|grep [S]creenSaverEngine > /dev/null
if [ "$?" != "0" ] ; then
# screen saver is not active
else
# screen saver is active
fi
这篇关于检查屏幕保护程序激活使用Mac bash脚本命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文