Certainly, I'm happy to try to help!
Originally Posted by cuethirteen
A few options:
1) edit the system file itself
2) make your own file, and overwrite the entire system file
3) merge your custom stuff into the stock file.
The code above is option 3.
You'll need to root your pre. Since I do not yet know how to trigger an event off of a luna restart, you also have to run the command manually, either when connected via novaterm or ssh, or from a terminal app on the phone. That, or write a service that then has a front end in webos. Yuck. If I have to go through all of that trouble, I might as well write my own app to handle everything, but I don't have that kind of time, unfortunately. Maybe this winter if somebody doesn't beat me to it :-). If I can figure out how to trigger off of a luna restart event, I could possibly distribute this as a patch. I'm not sure.
Just get the script onto the phone, and 'chmod +x' it. Then from the terminal, just type './autoreplace' from root's home (assuming you named the file 'autoreplace' and placed it in root's home). You will then just keep the text-edit-autoreplace.txt file in /media/internal (default USB partition).
Basically, the code does this:
1) removes our custom stuff from the real file (denoted by START and END)
2) re-creates the START and END tags to denote our custom autoreplace
3) copies our custom autoreplace between them.
So, your custom file (/media/internal/text-edit-autoreplace.txt)may look like this:
The script demonstrated will add it to the system file like this:
Sorry if this confuses more than helps. Note that this is actually a code snippet from a larger script of mine, so you also have to add the following to the start and end of the script, or it won't work:
mount -o rw,remount /
mount -o ro,remount /