frisco
October 14th, 2005, 13:36
I recently started using MacOS X on a regular basis, so i now have an OpenBSD desktop and a MacOS X desktop, using x2vnc to give me 3 heads.

Today my problem regards screensaver locking. I'd like to do 2 things on the Mac:

1- Set the screen saver timeout to 60 minutes during work hours, and 3 minutes all other times. I primarily use the OpenBSD desktop and don't like to have to type my password in each time i move to the Mac, but i also want my screen to lock after a short time when i leave. A command run from cron would suffice, but i don't know the proper command.

I've looked into defaults(1) but don't see the screensaver settings in there. Anyone have any pointers on other commands i should be looking at?


2- Turn the screensaver on via cli. This way i can set up xautolock (or xidle when i upgrade) on my OpenBSD desktop to xlock itself and then ssh over to the Mac and lock that one too.

I tried running ScreenSaverEngine and get this:

$ /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
2005-10-14 13:26:17.515 ScreenSaverEngine[12439] Can't register screen saver connection 'com.apple.ScreenSaverDaemon'
2005-10-14 13:26:17.894 ScreenSaverEngine[12439] Can't register screen saver connection 'com.apple.ScreenSaverDaemon'

The screen saver comes on but doesn't lock. I couldn't find a manpage for that command so i strings'd the binary and also tried running with -loginWindow, but this results in the same thing, no password prompt. I think i'm running it wrong - anyone know what i should be doing instead?

frisco
October 17th, 2005, 13:54
The correct command to lock the screen is:

open '/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app'


I set xautolock to ssh to the Mac and run that, then run xlock on the OpenBSD machine, so both workstations are locked at the same time.

Now i need to figure out how to unlock the screen via cli as well, so when i login to the OpenBSD workstation it can unlock the Mac. It's not as simple as killing the process on the mac.


I still don't know how to change the Mac's screensaver times via cli.