You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

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.