Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Use your mac as an alarm clock without any special alarm clock apps (seevishal.com)
28 points by vishaldpatel on July 3, 2011 | hide | past | favorite | 27 comments


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.


Ah cool - I'll add the iCal version to the post as well, thanks! =).


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


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.


Thanks! That's a good point, I'm going to have to do that (and perhaps add an option to fade it in gradually.)


Thanks, used the first code, will see how I like this compared to Awaken which I have used for a long time.


I grabbed the second and will check it out. I was using Awaken until I got my iPhone last year.


Thanks, I used #3. Counting on it to wake me up tomorrow.


AppleScript does not take into account the system volume level or mute status. That should be the first line of the script.


For reference, to set the volume, one would use something like:

   set volume 10


Thank you both. Will add that to the applescript on the blog post. Cheers.


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. :-)


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.


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.


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...


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.


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


come on, just 'man at' and use vlc and point to a mp3. been doing it since 2001.


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.)


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.


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


Me too. Lovely sound to wake up to.

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


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.


    /usr/bin/afplay


Thanks -- exactly what I wanted.


That's cool, but doesn't everyone use their cell phone as their alarm clock?


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 =).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: