2014-06-09 22:42:18 +01:00
2014-05-23 23:54:02 +01:00
2013-09-01 16:48:46 +01:00
2013-09-20 00:49:13 +01:00
2013-09-20 00:49:13 +01:00
2013-09-02 00:10:37 +01:00
2013-09-20 00:49:13 +01:00
2014-06-09 22:35:42 +01:00
2013-09-15 21:38:59 +01:00
2013-09-20 00:49:13 +01:00
2013-09-20 00:49:13 +01:00
2014-06-04 00:11:44 +01:00
2014-06-09 22:42:18 +01:00
2013-09-20 00:49:13 +01:00

profanity-plugins

Plugin support for Profanity is currently in development at the plugins branch.

Supported languages for writing plugins are C, Python, Ruby and Lua.

Building Profanity with plugin support

autoconf-archive, libtool and the development packages for each supported langauge are required e.g.:

python-dev
lua-dev
ruby-dev

Check out the plugins branch and run the usual:

./bootstrap.sh
./configure
make
sudo make install

By default, support for each language is optional and will be attempted during ./configure. To force support for a language, or disable support, the following flags may be used with ./configure.

--enable-c-plugins, --disable-c-plugins
--enable-python-plugins, --disable-python-plugins
--enable-ruby-plugins, --disable-ruby-plugins
--enable-lua-plugins, --disable-lua-plugins

A wrapper script is included to enable support for currently stable plugin languages:

./configure-plugins

This script currently forces support for C, Python and Ruby. Lua support for all platforms is still in progress.

Loading plugins

  1. Copy the plugin

For Python, Ruby and Lua plugins, copy the plugin to $XDG_DATA/profanity/plugins/, (~/.local/share/profanity/plugins/ on most systems).

For C plugins, build the plugin using the supplied Makefile, and then copy the .so file to the same location.

  1. Add to profrc

For all types of plugins, the list of plugins to acutally load when starting Profanity is defined in $XDG_CONFIG/profanity/profrc (~/.config/profanity/profrc on most systems).

For example:

[plugins]
load=browser.py;connect.lua;ChatStart.rb;cricket-score.py;platform-info.py;ascii.py;pid.so

Run the /plugins command to see a list of installed plugins.

Example plugin code

Whilst the API is being developed, the following test plugins are a good reference of possible hooks and API calls available:

python-test.py
RubyTest.rb
luatest.lua
test-c-plugin/test-c-plugin.c

Cricket score

The cricket score python plugin polls a public API to find the score of a given match, shows the score in the console and a desktop notification when it changes. It also adds a /cricket command to show the score at any time.

alt tag

Description
Python and C plugins collection for the CProof XMPP client
Readme 387 KiB
Languages
Python 75.7%
C 20.5%
Makefile 1.8%
Awk 1.4%
Shell 0.6%