Sunday, January 13, 2008

Allow your Mac to sleep after a DVD has finished playing.

I find it easiest for me to go to sleep while watching something on TV or a DVD. If I'm watching TV, I have a very conveniently located "Sleep Timer" button where I can specify how much time I want the TV to remain on before automatically turning off. I find this great for so many reasons. This saves my Samsung 23" HDTV from possibly getting image burn-in (if say it was left on an annoying, non-animated, or slightly animated DVD menu). This also saves my TV from the possibility of it overheating (and yes flat panels tend to get VERY hot over extended uses). And lastly, plain-and-simple, this is a very energy-saving-friendly feature.

Over break, I've been living back at my Mom's house and have been without my beloved TV. Unfortunately, Apple has created Mac OS X so that the Mac DOES NOT sleep at any time that a DVD is playing. Now this make sense for quite a bit of reasons, it'd be rather annoying to have to switch the power settings whenever you wanted to watch a DVD, or use something like Caffeine. However, it appears that, by default, Mac OS X's DVD Player goes back to the looping DVD Menu (as does most Standalone DVD players) after the episode(s) or movie is over. Since this means that DVD player is still technically "running," OS X does not put the display nor computer to sleep at all.

For obvious reasons, this can both be annoying, and could possibly cause image burn-in, so I searched for a solution! First I wanted to investigate HOW Mac OS X does it's Autmoated Tasks.

Possible solution #1: A "cron" is a time-based scheduling service for Unix based computers. I first heard of crons back in October when many Mac sites released a Mac OS X Trojan Warning. I then planned on learning how to correctly schedule one of these cron jobs to tell my Mac to Quit the DVD Player at a certain time of my choosing. Soon after doing a little more googling I found this little app that had a funny name (CronniX), but after a quick look at the comments, I found out that Apple actually recommends the use of "launchd," saying that it supersedes previous commands such as cron. This led me to possible solution #2.

Possible solution #2: ANOTHER comment found on that Lifehacker post was one that directed me to an app called "Lingon," that simply gives you a GUI to help you create these "launchd's." Anxious and excited, I quickly downloaded this and ran it. I was a little scared and overwhelmed since this app showed you the tons and tons of system related launchd's that had been previously set. I was scared that I was going to mess something up, and thought this was a little bit overkill just to do something as simple as closing DVD Player at a specified time. However I'll definitely keep this app in mind, when the day comes that I DO want to mess around with some more powerful automated tasks.

Possible solution #3: A little more googling around led me to a way of scheduling an automated task by using iCal, creating an event, and then setting an alarm for that event. You can then set the alarm to do one of multiple things; prompt you a message, message with sound, email, open a file, or run a script. I was pretty excited about this! This would be much easier to configure quickly, and it wouldn't be dealing with such important core files, just to schedule DVD player to turn off. So I created a quick little Automator Workflow App (save as... Application) that simply "Stopped the DVD Player." Tested it out, and it worked perfectly! This was great and I was excited to finally have closure on this problem that had long annoyed me!

Possible solution #4: While ranting on to my friend Dave about how ridiculous I thought it was that I had to go to all this work just to get my Mac to sleep after watching a DVD he sent me a URL to an app he found in about 2 seconds. iSleep was EXACTLY what I needed. It was simple a Mac Sleep Timer and Alarm clock. The app allows you to fall asleep listening to music in iTunes, or watching a DVD, and then after a certain amount of time, will sleep your Mac. I was all excited, and was so close to downloading until I noticed one thing... it said that iSleep was shareware, and that you are allowed to try it for 30-days, and then if you like it, you can register it for about $9 USD. This isn't a bad price, but I absolutely despise shareware. It reminds me of those crappy trials often found on Windows. Whether or not iSleep FORCES you to register or if it pulls a "WinRAR" and just pops up an annoying "Register Me!" window that can simply be exited out of, I wasn't sure. However, the fact that iSleep was shareware was a huge turn off for me.

Possible solution #5: I had about had it, I googled one last time, in hopes that I'd find something new. Sure enough I did. In this thread, posted just a few days ago, someone asked this exact question that has been bugging me for quite some time. I read the responses and discovered the easiest solution yet. A million kudos goes out to "Jory," who states that Tiger (or later) contains a Sleep Timer (Command + T) that allows you to; Quit DVD Player, Sleep, Shut Down, or Log Out at either a specified time, OR (and this is the best part yet) at the end of the current title. Tested it out, and sure enough, works perfectly!

Sometime's it's funny how you'll go to such great depths to find an app or a way to do something, when Apple has already thought it out and included it in their Operating System.

1 comment:

SKD1337 said...

Thanks for this, been bugging me for a while!