You are not logged in.

#1 2009-12-22 22:15:49

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

icsy - An Alarm for Power Nappers

This is another little script in my collection of useless software.

I often find myself wanting to take a 20 minute nap at about midnight because I'm too tired to continue working, but know that I have a ton of stuff due by the morning.  Previous attempts at this with an ordinary alarm clock typically end up causing me to shut the alarm off without having fully woken up.  I imagine that there are tons of programs out there that help solve this, but what the heck...

Presenting icsy (I can't Sleep Yet!)

http://jwcxz.com/projects/icsy/ - aur package

icsy allows you to set an alarm for some time and then forces you to wake up by asking simple math questions.  If you don't answer the questions correctly in the allotted time period, the snooze alarm will go off.

Sample usage:

$ icsy -t 2 -s 5 -n2
setting alarm for 2 seconds
press enter when awake 
starting snooze timer for 5 seconds
are you __really__ awake?
what is 5-53? 0  
what is 82+20? 0
0/2 correct... try again
what is 34+90? 124
what is 28+47? 75
:) everything was correct
now get back to work!

You can change:
- the amount of time until the alarm goes off
- the snooze alarm time
- the number of questions asked
- the alarm file to play (uses mplayer by default)
- or you can override the alarm with a custom command

There's no configuration file support yet, but I'll add that in later.

Also, there's an unfortunate little bug due to Python's Popen that captures Ctrl-C and sends it to mplayer, thus allowing you to inadvertently kill the alarm.  I'd like to solve this problem eventually, but I don't think it's a major deal-breaker right now.

Enjoy.


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#2 2009-12-22 23:10:41

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: icsy - An Alarm for Power Nappers

This is priceless. Not that I actually plan on using it, but the problem is all to familar... I can sleep (reasonable) fine for hours, with my hand magicaly levitating over the snooze button just a second before the next alarm goes off.
Also I have to change the alarm tone from time to time, because they simply wear off, and what wakes me up than are the annoyed neighbours banging on the wall. Play music as alarm? Someone turns on the radio in my dreams...

This may actually improve your math skills, if you escalate the question's difficulty. Sleep can be a powerful force...

Offline

#3 2009-12-23 02:18:32

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: icsy - An Alarm for Power Nappers

Sweet idea.  Unfortunately I foresee myself just muting the speakers instead.

Offline

#4 2009-12-23 06:12:55

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: icsy - An Alarm for Power Nappers

I set my computer up to send a housemate e-mails to his GMail which got pushed to his blackberry. He then had to wake me up and have me turn it off. Unfortunately, he realized it's easier to just restart my computer.

But I like the idea. I've been thinking of doing it for a while. Maybe you could incorporate "smart tests" for the alarm: was there computer activity after the alarm was turned off? Has it been going on for too long? Check if the speakers are muted. If they are, unmute and re-alarm. Also, maybe blocking things like shutdown and restart. Or just blocking all input except for answering the questions?

Offline

#5 2009-12-23 11:45:11

mutantpineapple
Member
From: UK
Registered: 2009-12-16
Posts: 29

Re: icsy - An Alarm for Power Nappers

i love this idea! and i definitely need it. i currently have three alarm clocks and i sleep through them all.

unfortunately i can do maths without having to be consciously awake. i prove that in work every day wink

Offline

#6 2009-12-23 13:04:51

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

Re: icsy - An Alarm for Power Nappers

hokasch wrote:

This may actually improve your math skills, if you escalate the question's difficulty. Sleep can be a powerful force...

mutantpineapple wrote:

unfortunately i can do maths without having to be consciously awake. i prove that in work every day wink

Yeah, the IcsyQuestion class is stupidly easy to modify.  I was planning to do more with it, but I decided to set that aside for a later date.  I was thinking about asking multiple types of questions since I've also been known to wake up, work on some math or physics problem for ten minutes, and then fall back asleep.  When I add configuration file support, perhaps it would be a good idea to let you specify your own question class (similar to how PyTyle does things).

tdy wrote:

Unfortunately I foresee myself just muting the speakers instead.

Yeah, this is definitely a problem.  I'm thinking of maybe adding some stuff in there that continually tells alsa to unmute the master channel or something.

majiq wrote:

But I like the idea. I've been thinking of doing it for a while. Maybe you could incorporate "smart tests" for the alarm: was there computer activity after the alarm was turned off? Has it been going on for too long? Check if the speakers are muted. If they are, unmute and re-alarm. Also, maybe blocking things like shutdown and restart. Or just blocking all input except for answering the questions?

A long time ago, I thought of writing a daemon that started a timer every time it detected no activity.  If that timer reaches some specified time (e.g. 20 minutes), it starts an alarm.  Maybe I'll try to incorporate that, or spin it off as a new project.

I've never been able to shutdown or restart without being awake, but that's an interesting idea.


It's interesting to see that so many people sleep through their alarms like I do.  I guess I'm not alone.  smile


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#7 2009-12-23 20:17:09

Tomone
Member
Registered: 2009-09-29
Posts: 18

Re: icsy - An Alarm for Power Nappers

I really like this idea because today I got up to my alarm and, in my still half-asleep state, turned it off and went back to bed.
Also, I tried it out, but there's no alarm sound.

Offline

#8 2009-12-23 20:35:02

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

Re: icsy - An Alarm for Power Nappers

Tomone wrote:

I really like this idea because today I got up to my alarm and, in my still half-asleep state, turned it off and went back to bed.
Also, I tried it out, but there's no alarm sound.

By default, icsy calls mplayer to play ~/.icsy.mp3 (see icsy -h for more info).  You can specify a different alarm file with -a or specify a different command with -c (in case you want to use mpg123, or even perhaps send-shock-to-my-brain.sh).


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#9 2009-12-23 22:53:53

Tomone
Member
Registered: 2009-09-29
Posts: 18

Re: icsy - An Alarm for Power Nappers

Do you have a good alarm sound that you use?

Offline

#10 2009-12-23 23:37:49

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

Re: icsy - An Alarm for Power Nappers

You can try FlashKit:
http://flashkit.com/

I've tried a few alarms from there with varying success.  I need loud obnoxious noises to wake me up.  This one isn't bad:
http://www.flashkit.com/soundfx/Electro … /index.php

One of my projects for the near future is to make a device that sends some shock pulses into my arm.  Yes, it really has gotten that bad.


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#11 2010-01-07 03:29:16

1LordAnubis
Member
Registered: 2008-10-10
Posts: 251
Website

Re: icsy - An Alarm for Power Nappers

Awesome; unfortunately when you turn off kalarm, you may not be awake... The problem I have is hitting the mute button instead of looking at the alarm- then there is the problem with the thinkpad user that has it set up so software can't access the hardware buttons (Of course, that proved beneficial when a friend with a shell account decided to rick roll me).

Tomone wrote:

Do you have a good alarm sound that you use?

Mos Eisley Spaceport.ogg (very loud star wars cantina music)


Any society that would give up a little liberty to gain a little security will deserve neither and lose both.
-Benjamin Franklin
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.
-George Bernard Shaw

Offline

Board footer

Powered by FluxBB