Konversation/Scripts/Ghosttrick

Jump to: navigation, search

Other languages:

The settings of a network contain a "Commands" field which can be used to run input line commands upon a connection to that network being established. In that field, there's a special "%nick" variable available which expands into the current nickname. This can be combined with the /exec command to run an external script that evaluates whether the nickname is the desired nick, and if not, use Konversation's DCOP IPC interface to make it send the ghost command to nickserv.

Hence, you would have to put something like this into the user-local scripts folder (KDE3 & KDE4: ~/.kde/share/apps/konversation/scripts, KF5: ~/.local/share/konversation/scripts), under the name "getnickback", and mark it as executable:

For KDE 3.5 use this here
 1 #!/bin/sh
 2 
 3 nick=********           # your desired nickanme
 4 pass=********           # the according password
 5 
 6 # don't edit below #
 7 
 8 PORT=$1
 9 SERVER=$2
10 NICK=$4
11 
12 # if your current assigned nick isn't the same as your desired one, ghost yourself and change nick
13 if [ "$NICK" != "$nick" ]
14 then
15   dcop $PORT default raw $SERVER "PRIVMSG nickserv :GHOST $nick $pass"
16   dcop $PORT default raw $SERVER "/nick $nick"
17 fi
18 
19 # now identify yourself at the server
20 dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass"
As KDE 4 and later has changed to use D-Bus instead of DCOP, use this variant for versions based on kdelibs4 or KF5
 1 #!/bin/sh
 2 
 3 nick=********           # your desired nickanme
 4 pass=********           # the according password
 5 
 6 # don't edit below #
 7 
 8 CONNECTION=$1
 9 NICK=$3
10 
11 # if your current assigned nick isn't the same as your desired one, ghost yourself and change nick
12 if [ "$NICK" != "$nick" ]
13 then
14   qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :GHOST $nick $pass"
15   qdbus org.kde.konversation /irc raw $CONNECTION "NICK $nick"
16 fi
17 
18 # now identify yourself at the server
19 qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :IDENTIFY $pass"

Notice the nick and password settings you need to fill in as you need them to be. Then, into the network's "Commands" field put /exec getnickback %nick


This page was last edited on 3 June 2016, at 17:30. Content is available under Creative Commons License SA 4.0 unless otherwise noted.