![]() |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
@ rotoflex
Thought the idea of clock chimes interesting, so I wrote a script that will check the time and play the proper sound files. You just need to set 4 alarms each running the script at :00, :15, :30, :45. Brute force, but it works. I didn't see an option in alarmed to run every 15 minutes, although somebody should be able to construct the proper cron syntax, which would get it down to 1 alarm. Code:
#! /bin/bash |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
Quote:
Did you modify it by having the script only check & play the hours, calling the script at the top of the hour; & adding an additional 3 alarmd events at the quarters to call only 15, 30, or 45 specifically? That seems like a useful approach for others: they can just run the script hourly for a top of the hour chime, and then have the option for adding the quarters (or deleting the events for the quarters, if they can't handle chimes every 15 minutes). |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
I modified the script, although as you point out, you can just set your quarterly chimes directly. For quarterly chimes, you'd need 4 alarms, but as you point out, you can eliminate any of them (ie hourly only, hourly / half hour, quarters).
Code for hourly chime at :00 and quarterly chimes only at :15, :30, :45 Code:
#! /bin/bash Code:
#! /bin/bash Add these lines at the beginning of the script Code:
checklate=`date +%H` Code:
fi |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
Hi, I modified alarmed to include better cron syntax, so with the latest version you can write Cron String " */15 8-18 * * * " to call the chim in every quarter from 8AM to 6PM.
|
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
lemmyslender:
I am not familiar with linux shell scripts, but looking at the Wikipedia page to see if your "silent" addition could be compacted into one code block instead of 2 if statements wrapping at the top & bottom, would this do the same if it were at the beginning of the script: Code:
checklate=`date +%H` |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
My apology if this issue has been raised before.
The original alarmd could ring alarm even when the device is shutdown. It's so useful in many occasion. However, it seems that the alarm scheduled by alarmed cannot wake the device from shutdown. Is there any workaround here? Please kindly advise. |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
Quote:
|
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
Changing the date +%H to date +%I can remove a lot of repetition:
Quote:
|
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
I am not sure if this has been addressed earlier but then my search effort did not yield any results.
After i did a complete reflash of my device including eMMC, my alarmed does not change profiles as per schedule as expected. It changes the profile on a mind of its own. It used to work perfectly fine earlier but it does not now. Just as an addendum, I did not restore anything other than my contacts and calendar after the reflash. Can some one please help me out? |
Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
Quote:
Now for the 2nd simplification.. ----------------------------------------------------------- Quote:
2nd, two "if... then.." inside each other with no other code between the if's or fi's can be simplified into just one "if". The inside code only gets executed if condition 1 AND condition 2 are true, so you can join them with an "AND" to get: Code:
checklate=`date +%H` You could also have used [ $checklate -gt 21 ] && [ $checklate -lt 5 ] which is the one to use if each condition is a command instead of a square-bracketed-expression. But joining them inside the square brackets with -a doesn't involve so much work for the shell (though not by a lot). You could even merge the whole if/then/fi block into one line and one full command, using an '&&' because && will only run the later command(s) if the earlier one finishes successfully: Code:
[ $checklate -gt 21 -a $checklate -lt 5 ] && exit 1 PS for a challenge, "[ $checklate -gt 21 -a $checklate -lt 5 ] && ( exit 1 )" (note the extra brackets) will never exit the script early - do who knows why? |
All times are GMT. The time now is 05:47. |
vBulletin® Version 3.8.8