News for hackers. Stuff that matters.
Re:Show HN: Use your mac as an alarm clock without any speci... by PCheese on Sunday July 03, 2011 @04:09PM (#2724478)
It’s probably nicer to schedule this with iCal instead of crontab. Create a new iCal event, and add an alert for that event that runs your script. You can easily and visually configure the event to repeat only on weekdays, and the best part is that you can simply delete or modify single instances of the recurring event to deal with exceptions like holidays.
Re:Show HN: Use your mac as an alarm clock without any speci... by vishaldpatel on Sunday July 03, 2011 @08:54PM (#2724998)
Ah cool - I'll add the iCal version to the post as well, thanks! =).
Re:Show HN: Use your mac as an alarm clock without any speci... by d_r on Sunday July 03, 2011 @06:37PM (#2724789)
Shameless plug. I always have trouble waking up. Since the Mac App Store came out this year, I've been working on a simple alarm clock app called "Mornings" to do just this (play iTunes or custom MP3s). It actually uses AppleScript to tell iTunes what to play for the iTunes option, so it works with whatever is in your playlists. (The "con" to this is that iTunes automatically opens when the alarm clock plays -- unlike other, more fancy apps, that load the playlists from iTunes but roll their own playback behavior.) Or you can just add your own MP3s and the app won't open iTunes.

I haven't posted it on HN before, but I'd be absolutely grateful if anyone tried it out. As a developer I get some promo codes, so here are some codes (hit Featured, then Redeem to grab it. Or if none of them work, e-mail me and I'd be happy to give you one.)

  F7KTWHLM9H7P 
  3XKY3YEJX9EK
  K63HX7WE9X77
  3RX6ENHL34EE
  WY7X3LRMHKPJ
  JFXETAJH3XYP
  XJXNHTXFEF4P
Re:Show HN: Use your mac as an alarm clock without any speci... by Gring on Sunday July 03, 2011 @07:54PM (#2724913)
That's a really well designed app! Thanks, I took code #4.

A suggestion: turn up the volume when sounding an alarm. Currently an alarm might go off, but if the volume is set to 0, nothing will be heard.

Re:Show HN: Use your mac as an alarm clock without any speci... by d_r on Sunday July 03, 2011 @09:12PM (#2725034)
Thanks! That's a good point, I'm going to have to do that (and perhaps add an option to fade it in gradually.)
Re:Show HN: Use your mac as an alarm clock without any speci... by X-Istence on Sunday July 03, 2011 @06:43PM (#2724806)
Thanks, used the first code, will see how I like this compared to Awaken which I have used for a long time.
Re:Show HN: Use your mac as an alarm clock without any speci... by ComputerGuru on Sunday July 03, 2011 @06:55PM (#2724829)
I grabbed the second and will check it out. I was using Awaken until I got my iPhone last year.
Re:Show HN: Use your mac as an alarm clock without any speci... by qb on Sunday July 03, 2011 @08:00PM (#2724924)
Thanks, I used #3. Counting on it to wake me up tomorrow.
Re:Show HN: Use your mac as an alarm clock without any speci... by biturd on Sunday July 03, 2011 @03:21PM (#2724362)
AppleScript does not take into account the system volume level or mute status. That should be the first line of the script.
Re:Show HN: Use your mac as an alarm clock without any speci... by joshzayin on Sunday July 03, 2011 @04:00PM (#2724459)
For reference, to set the volume, one would use something like:

   set volume 10
Re:Show HN: Use your mac as an alarm clock without any speci... by vishaldpatel on Sunday July 03, 2011 @08:56PM (#2725005)
Thank you both. Will add that to the applescript on the blog post. Cheers.
Re:Show HN: Use your mac as an alarm clock without any speci... by a3_nm on Sunday July 03, 2011 @08:02PM (#2724926)
I've been using "sleep 28000; mplayer whatever.ogg" as an alarm clock (without any special app) for a few months now. Less polished, but it works. :-)
Re:Show HN: Use your mac as an alarm clock without any speci... by pygy_ on Sunday July 03, 2011 @03:44PM (#2724421)
Back in the days of Mac OS 9 (IIRC), it was possible to schedule the boot time of Macs, and have a script automatically play the CD present in the drive.

I don't remember the very details because I only used the (second hand) Mac for a few weeks, and the scheduler wasn't reliable (anymore?). But still, it was a cool trick.

Re:Show HN: Use your mac as an alarm clock without any speci... by joshzayin on Sunday July 03, 2011 @03:59PM (#2724456)
You can still set it to boot at a certain time with OS X, and if you set up auto-login and have that as a login item, it'll accomplish the same task.
Re:Show HN: Use your mac as an alarm clock without any speci... by pygy_ on Sunday July 03, 2011 @05:30PM (#2724655)
This is very cool. I looked for this when I bought my MBP, but I didn't find the option. A quick google trip and I found that you do it from the Energy Saver preference pane.

Thanks for the tip.

On a tengential note: Is it possible to turn on the screen backlight programmatically?

Since OS X 10.6.3, the backlight remains off when waking up from hibernation (this is documented in [1]). The proposed solution is to delete the related plist, which resets the hibernate mode to the default settings that are useless for me. My current solution is to close back the lid for a split second in order to trigger the hibernation process, then to fiddle with the arrow keys to abort it. I'd prefer something more elegant.

1. https://discussions.apple.com/thread/2384628?start=90&ts...

Re:Show HN: Use your mac as an alarm clock without any speci... by joshzayin on Sunday July 03, 2011 @06:20PM (#2724758)
I don't have that problem on my MBP with 10.6.8. How are your Energy Saver preferences set up? Trashing the plist and resetting it to how you like it might work--it's possible that the plist is corrupted.
Re:Show HN: Use your mac as an alarm clock without any speci... by pygy_ on Sunday July 03, 2011 @06:51PM (#2724822)
I'll try to reset the plist, then, thanks for your help.

                       Battery         Power Adapter 

    Computer sleep:    10 min          45 min
    Display sleep:     2 min           3 min
    Put HD to sleep:   Yes             Yes
    Wake up from LAN:  Yes             Yes
    Dim before sleep:  Yes             Yes
    Boot after power failure:          No
Re:Show HN: Use your mac as an alarm clock without any speci... by xfax on Sunday July 03, 2011 @02:59PM (#2724325)
come on, just 'man at' and use vlc and point to a mp3. been doing it since 2001.
Re:Show HN: Use your mac as an alarm clock without any speci... by jrockway on Sunday July 03, 2011 @03:12PM (#2724348)
This is what I do when I'm too lazy to find my phone and set an alarm. It's never failed me.

(Actually, I use mplayer, but same idea.)

Re:Show HN: Use your mac as an alarm clock without any speci... by benatkin on Sunday July 03, 2011 @08:29PM (#2724963)
This one works well for me, and it's free: http://www.robbiehanson.com/alarmclock/

The last version was released in 2007 but it still works great on Snow Leopard. I'm in no rush to replace working apps with Mac Store apps.

Re:Show HN: Use your mac as an alarm clock without any speci... by X-Istence on Sunday July 03, 2011 @06:38PM (#2724792)
I've got an old laptop running BSD, and for those days that I absolutely need to be awake at a certain time I tend to schedule, using at, for a cat /dev/random > /dev/snd. Never fails to wake me up :P
Re:Show HN: Use your mac as an alarm clock without any speci... by knotty66 on Sunday July 03, 2011 @07:00PM (#2724837)
Me too. Lovely sound to wake up to.

sleep 6h && cat /dev/urandom > /dev/dsp

Re:Show HN: Use your mac as an alarm clock without any speci... by hollerith on Sunday July 03, 2011 @02:41PM (#2724272)
I would like this solution better if I knew a way to play an audio file from "the commandline" without having to rely on a big app like iTunes or VLC.
Re:Show HN: Use your mac as an alarm clock without any speci... by judofyr on Sunday July 03, 2011 @02:55PM (#2724318)

    /usr/bin/afplay
Re:Show HN: Use your mac as an alarm clock without any speci... by hollerith on Sunday July 03, 2011 @03:04PM (#2724337)
Thanks -- exactly what I wanted.
Re:Show HN: Use your mac as an alarm clock without any speci... by dholowiski on Sunday July 03, 2011 @01:28PM (#2724082)
That's cool, but doesn't everyone use their cell phone as their alarm clock?
Re:Show HN: Use your mac as an alarm clock without any speci... by vishaldpatel on Sunday July 03, 2011 @01:41PM (#2724115)
Haha, yes a lot of people do, I think. I wanted to setup an internet radio station as my alarm clock and I still use my laptop =).