Difference between revisions of "Pager Nagger"
Jump to navigation
Jump to search
Hopspitfire (talk | contribs) m (Pager/Nagger moved to Pager Nagger) |
JackieRipper (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | I use my phone as a pager when I'm on-call at work. The Pre's notification tone is | + | I use my phone as a pager when I'm on-call at work. The Pre's notification tone is ''way'' too short and quiet to wake me up. Here's a script that will nag you by playing a .wav file every minute while you have unread messages. |
== Prerequisites== | == Prerequisites== |
Revision as of 03:51, 17 August 2009
I use my phone as a pager when I'm on-call at work. The Pre's notification tone is way too short and quiet to wake me up. Here's a script that will nag you by playing a .wav file every minute while you have unread messages.
Prerequisites
- Root access
- Cron enabled
Script code
#!/bin/sh SOUND=/media/internal/ringtones/pager.wav check() { cmd='SELECT summary FROM com_palm_messaging_data_ChatThread WHERE unreadCount > 0 AND type = "SMS" AND summary != "";' output=$(echo $cmd|sqlite3 /var/luna/data/dbdata/PalmDatabase.db3 2> /dev/null) || return 0 if [ -n "$output" ] ; then return 1 fi } play() { x=0 until [ "$x" = 4 ] ; do aplay -q "$SOUND" sleep 60 check if [ "$?" = 1 ] ; then x=$((x + 1)) else x=4 fi done } if [ ! -f "$SOUND" ] ; then SOUND=/usr/palm/sounds/alert.wav fi check || play
Installation
- Copy a .wav file to /media/internal/ringtones/pager.wav (or to the ringtones directory in USB mode).
mkdir -p /opt/scripts
- Copy the script to /opt/scripts/pager.
chmod +x /opt/scripts/pager rootfs_open -w
- Add the following line to /etc/cron/crontabs/root:
*/5 * * * * /opt/scripts/pager
Remember to copy a .wav file to /media/internal/ringtones/pager.wav.
To Do/Bugs
As the message is marked read in the database when it is closed, the sound will continue to play every minute until the messaging app is closed (or until that chat card is closed if you've done the Create a new card for each conversation mod).
Pyrognome tested this and works as stated.
Acknowledgments
Thanks to Sargun for the tracking script which inspired the layout of the code, as well as started me looking at the databases.