You are not logged in.

1

Saturday, June 10th 2006, 6:17am

[kopete] and fortune

Hi!

Can I use fortune in kopete to create away-messages?

Thanks,
Seb

GotenXiao

Beginner

Posts: 5

Location: England

  • Send private message

2

Monday, July 17th 2006, 7:05pm

I did this very thing not too long ago. I've got mine setup as a cronjob :P

newMessage:

Source code

1
2
3
#!/bin/bash
# change Kopete's away message
/opt/kde/bin/dcop --user goten kopete KopeteIface setAway "`/home/goten/oneliner`" 0

oneliner:

Source code

1
2
3
4
#!/bin/bash
# strip newlines from a short fortune
fort=`/usr/games/fortune -s`
echo ${fort//'\n'//''}

crontab excerpt:

Source code

1
2
# update Kopete's away message
*/4 * * * * /home/goten/newMessage


You'll need to change them to match your system, obviously. Works quite well.