forked from profanity-im/profanity-im.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugins.html
260 lines (255 loc) · 12.3 KB
/
plugins.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html>
<head>
<title>Profanity, a console based XMPP client - User Guide</title>
<meta charset="utf-8">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<link href="css/profanity.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/analytics.js"></script>
</head>
<body id="article">
<img class="overlay" src="images/profanity_mouth-only.png" alt="Profanity Illustration">
<header>
<a href="index.html">
<h1>Profani<span class="kern-ty">ty</span></h1>
</a>
<h2>Plugins</h2>
</header>
<article id="manual">
<section>
<h3>Contents</h3>
<ul>
<li><a href="#overview">Overview</a>
<li><a href="#featured-plugins">Featured Plugins</a>
<li><a href="#developing-plugins">Developing Plugins</a>
<ul>
<li>
<a href="#python-plugins">Python</a>,
<a href="#c-plugins">C</a>
</li>
</ul>
<li><a href="#themes-settings">Themes and Settings</a>
<li><a href="#contributing-plugins">Contributing Plugins</a>
</ul>
</section>
<section>
<a name="overview"></a>
<h3>Overview</h3>
<p>
Profanity supports plugins written in Python and C. The <a
href="https://github.com/boothj5/profanity-plugins" target="_blank">profanity-plugins</a> project
contains various plugins maintained by Profanity's author and other community maintained plugins.
</p>
<p>
The master branch of the plugins repository is in synch with development in the master branch of
Profanity. Branching is used to maintain plugins for releases of Profanity:
</p>
<table>
<tr>
<td>Profanity 0.5.0</td>
<td><a href="https://github.com/boothj5/profanity-plugins/tree/0.5.0"
target="_blank">https://github.com/boothj5/profanity-plugins/tree/0.5.0</a></td>
</tr>
<tr>
<td>Profanity 0.5.1 to 0.6.0</td>
<td><a href="https://github.com/boothj5/profanity-plugins/tree/0.5.1"
target="_blank">https://github.com/boothj5/profanity-plugins/tree/0.5.1</a></td>
</tr>
</table>
<p>
There is a <a href="https://github.com/boothj5/profanity/issues/749" target="_blank">known issue</a>
that C plugins do not currently work on Cygwin.
</p>
<p>
To install a Python plugin:
</p>
<pre><code>/plugins install ~/projects-git/profanity-plugins/say.py</code></pre>
<p>
Any module dependencies for the plugin should be on the Python system path. If a plugin imports modules
relative to its location, these modules need to manually be copied to
<code>~/.local/share/profanity/plugins/</code>
</p>
<p>
To install a C plugin:
</p>
<pre><code>/plugins install ~/projects-git/profanity-plugins/pid/pid.so</code></pre>
<p>
See the <a href="reference.html#plugins"><code>/plugins</code></a> command for more information on
installing and enabling/disabling plugins.
</p>
<p>
If a plugin registers it's own commands, the usual <a href="reference.html#help"><code>/help</code></a>
command can be used to find out more information:
</p>
<pre><code>/help say</code></pre>
</section>
<section>
<a name="featured-plugins"></a>
<h3>Featured Plugins</h3>
<p>
This section list some of the plugins currently available.
</p>
<table>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/ascii.py"
target="_blank"><code>ascii.py</code></a></td>
<td>Convert text to ascii art text and send to the current recipient or room.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/browser.py"
target="_blank"><code>browser.py</code></a></td>
<td>Open received links in the system default browser.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/clients.py"
target="_blank"><code>clients.py</code></a></td>
<td>Show client software used by each occupant in the current chat room, using <a
href="https://xmpp.org/extensions/xep-0092.html" target="_blank">xep-0092 Software
Version</a>.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/imgur.py"
target="_blank"><code>imgur.py</code></a></td>
<td>Send a local image file or a screenshot to a recipient or chat room using imgur.com.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/paste.py"
target="_blank"><code>paste.py</code></a></td>
<td>Send the contents of the clipboard to the current recipient or room.</td>
</tr>
<tr>
<td><a href="https://github.com/Neo-Oli/profanity-termux-notification"
target="_blank"><code>termuxnotify.py</code></a></td>
<td>Notifications for Termux on Android.<br> See also <a
href="https://github.com/Neo-Oli/profanity-notifycmd"
target="_blank"><code>notifycmd.py</code></a> for a generic version to run any system
command on new messages.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/presence_notify.py"
target="_blank"><code>presence_notify.py</code></a></td>
<td>Configure desktop notifications for presence updates from contacts.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/say.py"
target="_blank"><code>say.py</code></a></td>
<td>Read out loud messages from recipients or in chat rooms.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/sounds.py"
target="_blank"><code>sounds.py</code></a></td>
<td>Play sounds when messages received.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/syscmd.py"
target="_blank"><code>syscmd.py</code></a></td>
<td>Display the result shell commands in a new window.<br>
Send results of shell commands to recipients or chat rooms.</td>
</tr>
<tr>
<td><a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/wikipedia-prof.py"
target="_blank"><code>wikipedia-prof.py</code></a></td>
<td>Search wikipedia and show search results, pages, links etc in a new window.</td>
</tr>
</table>
</section>
<section>
<a name="developing-plugins"></a>
<h3>Developing Plugins</h3>
<p>
Profanity provides an API for plugins to access various functionality. Plugins may also implement
'hooks' that Profanity will call on specific events.
</p>
<a name="python-plugins"></a>
<h4>Python</h4>
<p>
Python plugins need to import the <code>prof</code> module to access the API.
</p>
<p>
Profanity may be compiled against Python 2 or Python 3, so plugins should be able to work with both, the
<a href="https://pypi.python.org/pypi/future" target="_blank">future</a> library can be used in most
cases.
<p>
Full documentation of the <code>prof</code> module and the hooks a plugin may implement can be found
at:
</p>
<p>
<a href="plugins/0.5.1/python/html/index.html">0.5.1 to 0.6.0 Python API documentation</a>
</p>
<p>
Previous versions:<br>
<a href="plugins/0.5.0/python/html/index.html">0.5.0</a>
</p>
<a name="c-plugins"></a>
<h4>C</h4>
<p>
C plugins need to include the <code>profapi.h</code> header to access the API, and must be linked
against <code>libprofanity</code> using the linker flag <code>-lprofanity</code>.
</p>
<p>
C plugins should include a <code>Makefile</code> to build a shared library (a <code>.so</code> file)
which is the file Profanity will load.
</p>
<p>
Full documentation of the <code>profapi.h</code> header and the hooks a plugin may implement can be
found at:
</p>
<p>
<a href="plugins/0.5.1/c/html/index.html">0.5.1 to 0.6.0 C API documentation</a>
</p>
<p>
Previous versions:<br>
<a href="plugins/0.5.0/c/html/index.html">0.5.0</a>
</p>
</section>
<section>
<a name="themes-settings"></a>
<h3>Themes and Settings</h3>
<p>
Plugins may make use of themes and settings by accessing the following files:
</p>
<pre><code>~/.local/share/profanity/plugin_themes
~/.local/share/profanity/plugin_settings</code></pre>
<p>
Example theme properties for <a
href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/syscmd.py"
target="_blank">syscmd.py</a>:
</p>
<pre><code>[system]
command=cyan
result=green</code></pre>
<p>
Example settings for <a href="https://github.com/boothj5/profanity-plugins/blob/0.5.1/stable/say.py"
target="_blank">say.py</a>:
</p>
<pre><code>[say]
args=-v english -s 120
enabled=active</code></pre>
<p>
API functions are available to read and write to the settings and theme files.
</p>
<p>
Plugins should contain documentation on the available settings and colours, most plugins have a command
to manipulate settings.
</p>
</section>
<section>
<a name="contributing-plugins"></a>
<h3>Contributing Plugins</h3>
<p>
Submit a pull request to the <a href="https://github.com/boothj5/profanity-plugins"
target="_blank">profanity-plugins</a> project.
</p>
<p>
If the current API doesn't have what you need, raise an issue at the <a
href="https://github.com/boothj5/profanity" target="_blank">Profanity</a> repository.
</p>
</section>
</article>
<footer>
<p class="matty">site designed by <a href="http://www.matthewbalaam.co.uk">Matthew Balaam</a></p>
</footer>
</body>
</html>