The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Fortune teller as Email signature

Contributed by: Nigel Malthus
This tip is valid for: Both BeOS and Haiku

If you like the idea of using fortune to give you a random message of the day at boot-up, try this: it not only gives a message, but also appends it as a motto to your e-mail signature (with the option of rejecting the message if you don’t much like it, and trying another).

To begin, you need a basic signature with your name, address, URL, etc, configured in BeMail. It will exist as a file called signature_0 in /boot/home/config/settings/bemail/signatures. Create it now if you haven’t already.

Now create two more blank signatures. Call the first something like “motto”, the second something like “Autosignature”. They don’t need to contain text, as long as they exist; they will be signature_1 and signature_2 respectively. In BeMail preferences, choose the second as your default email signature.

Now cut and paste the following into StyledEdit:

fortune >
cat /boot/home/config/settings/bemail/signatures/signature_0
 /boot/home/config/settings/bemail/signatures/signature_1 >
alert "Today's e-mail motto is:
   `cat /boot/home/config/settings/bemail/signatures/signature_1`"
"Uh... no. Try another"  OK && sigscript

And save the file as “sigscript” somewhere in your path, such as in /boot/home/config/bin. Finally, add the line “sigscript” (without the quotes) to UserBootscript.
Now, whenever you boot, sigscript will run and give you an alert box showing the day’s motto. Type “sigscript” in a terminal to test it. Open a new mail message to see the result.

This could of course be adapted for other e-mail programs. Also, the wording of the alert box and its buttons can be altered to taste, as long as the syntax is preserved.

Posted in Miscellaneous

(comments are closed).