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

Friday, January 27th 2006, 5:51pm

[kopete] Change away message via script? / game browser integration

Does anyone in here know of a method to make xqf [1] report the quake 3 server one is currently playing on to kopete?

I'd like to have kopete change my away message to something like : "<nickname> is currently playing <game> on server <ip:port>".

xqf can be configured to place a launch-info file in ~/.qf/LaunchInfo.txt that contains all the Info i want Kopete to show and it can run a program (~./qf/PreLaunch) before starting the game, so my question boils down to : "Is there any way to make kopete show this information as my away message?" or "How do i access the away messages via a script/program?"

[1] http://www.linuxgames.com/xqf/

2

Sunday, January 29th 2006, 10:31am

RE: [kopete] Change away message via script? / game browser integration

You can use dcop for changing away messages. For example, a command like this should work:

Source code

1
dcop kopete default setAway "A away message" true

You can use variables to make a non-static message.

3

Thursday, February 2nd 2006, 9:36pm

RE: [kopete] Change away message via script? / game browser integration

thanks a lot for the tip on using dcop.

the following script does the trick for me. hope it helps somebody.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# make kopete show the game and server you are currently playing on
# when starting a game from XQF
#
# copy this file to ~/.qf/PreLaunch, chmod+x and make sure that XQF creates the launchinfo file and
# executes this file as prelaunch script (XQF -> preferences -> gereneral -> ...when launching a game )

##### settings #####

YOURNAME="spirit"
YOURNICK="dichtfux"

##### get info #####
XQFHOME="$HOME/.qf"
INFOFILE="$XQFHOME/LaunchInfo.txt"

if [ ! -r $INFOFILE ]; then
	echo "infofile not found at $INFOFILE. using default message."
	STATUS="$YOURNAME is playing online games. his nick is $YOURNICK."
else
	GAME=$(grep ^GameType $INFOFILE | sed s/GameType//)
	MOD=$(grep ^ServerMod $INFOFILE | sed s/ServerMod//)
	SRVADR=$(grep ^ServerAddr $INFOFILE | sed s/ServerAddr//)
	SRVNAME=$(grep ^ServerName $INFOFILE | sed s/ServerName//)
	STATUS="$YOURNAME is playing $GAME $MOD on a server named $SRVNAME ($SRVADR ). \
                his nickname is currently $YOURNICK."
fi

##### show info #####


dcop kopete KopeteIface setAway "$STATUS"
echo "set kopete away message to : \"$STATUS\""