[Evolution] Tip for signatures with fortunes



A workaround to add short fortunes to signatures for Evolution 1.0.x.
Here it is:

This goes to ~/.profile or ~/.bashrc:

------------------------------------------------------------------ SNIP!
if [ -x ~/bin/signfortune.sh ]; then
        . ~/bin/signfortune.sh
fi

if [ ! -e ~/.signature-lock ]; then
        echo "* * * * * /home/`whoami`/bin/signfortune.sh > /dev/null" |
crontab -
        touch ~/.signature-lock
        export SIGNLOCK="1"
fi
------------------------------------------------------------------ SNIP!

This is the ~/bin/signfortune.sh:

------------------------------------------------------------------ SNIP!
#!/bin/sh

cat > ~/.signature.txt << EOF
*** YOUR SIGNATURE HERE ***

`/usr/games/fortune -s`
EOF
------------------------------------------------------------------ SNIP!

and finally the ~/.bash_logout

------------------------------------------------------------------ SNIP!
if [ $SIGNLOCK == "1" ]; then
        crontab -d
        rm -f ~/.signature-lock
fi
------------------------------------------------------------------ SNIP!

Sure, it's slackware here and I've got fortune from bsdgames collection.
Don't forget to modify paths and signature :)

This will replace the crontab for your user account with a call to the
script to rewrite the signature in every minute, until you logout. And
when you do, ~/.bash_logout will remove the crontab entry and it's won't
waste any CPU time anymore.

The thing which hurts is that if you're logged on, and you've got
APM/ACPI enabled, it will never go standby or suspend, I think.

-HTH
-- 
Enver ALTIN (a.k.a. skyblue)   - Software developer, generic solvent.
http://enver.casdb.com/        - mailto: ealtin at casdb dot com
http://enver.casdb.com/CV.html - Just me, myself and I.

Always borrow money from a pessimist; he doesn't expect to be paid
back.

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]