Jump to content

Konversation/Scripts/Ghosttrick/en: Difference between revisions

From KDE UserBase Wiki
FuzzyBot (talk | contribs)
Updating to match new version of source page
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
/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.
/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 (~/.kde/share/apps/konversation/scripts), under the name "getnickback", and mark it as executable:
Hence, you would have to put something like this into the user-local scripts folder (KDE3 & KDE4: <tt>~/.kde/share/apps/konversation/scripts</tt>, KF5: <tt>~/.local/share/konversation/scripts</tt>), under the name "getnickback", and mark it as executable:


; For KDE 3.5 use this here:
; For KDE 3.5 use this here:
<syntaxhighlight lang="php" line>
<!--}}-->{{Input|<syntaxhighlight lang="php" line>
#!/bin/sh
#!/bin/sh


Line 27: Line 27:
# now identify yourself at the server
# now identify yourself at the server
dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass"
dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass"
</syntaxhighlight>
</syntaxhighlight>}}<!--{{-->


; As KDE 4 has changed to dbus instead of dcop use this version for KDE 4:
; As KDE 4 and later has changed to use D-Bus instead of DCOP, use this variant for versions based on kdelibs4 or KF5:
<!--}}-->{{Input|<syntaxhighlight lang="php" line>
<!--}}-->{{Input|<syntaxhighlight lang="php" line>
#!/bin/sh
#!/bin/sh

Latest revision as of 17:30, 3 June 2016

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
'"`UNIQ--syntaxhighlight-00000001-QINU`"'
As KDE 4 and later has changed to use D-Bus instead of DCOP, use this variant for versions based on kdelibs4 or KF5
'"`UNIQ--syntaxhighlight-00000005-QINU`"'

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