View Single Post
Old 06-20-2012, 05:35 AM   #5
thatworkshop
hub
thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.
 
thatworkshop's Avatar
 
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
18. Alarm clock using crontab

This is a very very very plain alarm clock for K5, and any *nix-based device in general. It just adds an entry to crontab. That's it. Until someone has time to do something like geekmaster mentioned in this post, we can use this. I simply don't have time right now.
[Credits go to eureka for this post.

Alright, you can do it in two ways:
A: Use Kindle's builtin media player (benefit: reusing what's already in Kindle! drawback: rings just 10 times which you can change in alarm.sh file)
B. Use mplayer (benefit: rings until you tell it to stop via GUI Launcher. drawback: installing a piece of software you might never use!)

No matter which way you want your alarm clock, go ahead and extract alarmMP3.zip in /mnt/us/

For A:
1. Append the following line to your /etc/crontab/root
Code:
00    05        1-31    1-12        0-6     /mnt/us/opt/alarm.sh
2. Extract alarmScript.zip in /mnt/us/
3. Reboot or even better...
Spoiler:
issue killall crond in SSH


For B:
1. Get MPlayer and put in the directory /mnt/us/opt/
2. Append the following line to your /etc/crontab/root
Code:
00    05        1-31    1-12        0-6     /mnt/us/opt/mplayer/mplayer -loop 0 -volume 200 /mnt/us/music/alarm.mp3
3. Extract alarmclock.zip into /mnt/us/
4. Reboot or even better...
Spoiler:
issue killall crond and then restart framework in SSH


Spoiler:
This is syntax of crontab entries (from http://www.adminschoice.com/crontab-quick-reference):
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
Attached Files
File Type: zip alarmMP3.zip (14.2 KB, 230 views)
File Type: zip alarmclock.zip (797 Bytes, 221 views)
File Type: zip alarmScript.zip (342 Bytes, 234 views)

Last edited by thatworkshop; 08-24-2012 at 09:05 AM.
thatworkshop is offline   Reply With Quote