Wednesday, August 22, 2007

Potential Mac Screen Properties Life-Saver

I managed to freak out the display settings for my screen that was set as the primary display (TV via the S-Video out adapter, because I was using Front Row, and didn't want to use mirror mode) on my notebook this morning by magically switching it to PAL and hitting OK while moving the notebook. [This particular maneuver requires a unique mix of uncanny bad luck coupled with a distinct lack of caffeination, and is neither likely to occur nor recommended.] Well, being an resident of the USA, said TV's S-Video input needed an NTSC signal, and so things were not exactly happy. Because of the way OS X puts the properties page for a given screen on that screen (which is normally nice) and because it also lacks a hot-key for moving a window, I was fairly hosed for a while.

Plugging back in my DVI monitor didn't help (separate settings were maintained on a per-device basis), and I simply couldn't find the darn settings anywhere in the Library or elsewhere... I got lucky, though, that monitor happened to have an S-Video input, and managed to sync with the 50Hz signal. That change in luck allowed me to reset the mode in which the TV adapter was running successfully. But, what would I do if I ever hosed something in an manner that was not so easily recoverable?

Enter cscreen, the hard-to-find (because the author abandoned it and his site) utility that allows modification of OS X display settings from the command line. I finally found it on the ScriptBuilders site, and am pleased to report that it works as designed -- allowing screen properties to be properly transmogrified from the command line. This even works from an SSH session, so now no amount of sleep and caffeine deprivation mixed with poor thumb placement can ever cause near-tragic screen gobbledy-gookage ever again...

Oh, yeah, this also makes it easy to switch which screen is the primary, and to rig up some scripts to switch among settings that I may want to use from time to time. Now, I still kinda want to find where these settings actually live, but that's a project for another time.