I was also looking for a bash method to test if user has locked the station.
This topic here shows that we can test if screen saver is active or not with bash: Check if Screensaver is Active using Mac Bash Script Command
I found this but this is also for screensaver: How can I detect if the screen is locked or screensaver is active from the Terminal in OS X 10.6?
Anyway to use bash to test if station is locked or not?
Thanks