You are not logged in.

1

Sunday, May 22nd 2005, 9:30pm

Kopete tell me who is on

Hi,

I just assembled some scripts, to have my system talking to me via mbrola. Works fine so far. Now I want kopete to execute this script with some parameters, to tell me the username, which has just signed on or wrote me a message.

The only parameter available I found was %s, but in case, the user signed on, it tells me the complete notification text, and in case of a incomming message, it even reads me the complete message. What I would prefer is "#username# signed on" oder "#username# wrote a message".
For my call (echo "%s bla etc" | say), are there any other parameters available, maybe some, which only contains the Username invocating the notification? Is there any documentation about?

Thx,
Pirf2

2

Monday, May 23rd 2005, 9:29pm

RE: Kopete tell me who is on

I don't know if there are other parameters available, but you can always make a simple bash-script that edits the input given by Kopete and gives the changed output to you program. The program which is used for this often for these kind of things is sed. If you don't know how to write a regular expression, please post a line that Kopete gives.

3

Monday, May 23rd 2005, 9:46pm

Regular expression is a really good idea: I have renamed all users to "Nick (Real Name)", Kopete %s outputs "Nick (Real Name) is now online.", so it would be fine, to return only what is written in brakets. Since Kopete can invoke shellscripts only globally on all contacts, but not on specific ones, I could even use this, to restrict voice output on a few users.

I only use regexpressions coding java, if you could just give me an example how I use them on sed, I guess I can adjust the details by myself.

Thx,
Pirf

4

Tuesday, May 24th 2005, 7:02am

I think the following expression will do the trick:

Source code

1
echo "%s" | sed 's/^.*(\(.*\)).*$/\1/g'