an experimental irc client
1comlink(3)
2
3# NAME
4
5comlink - primary lua module for use in comlink configuration
6
7# SYNOPSIS
8
9*local comlink = require*(_"comlink"_)
10
11*comlink.setup*(_config_)
12
13*local conn = comlink.connect*(_config_)
14
15*local channel = comlink.selected_channel*()
16
17*comlink.log*(_msg_)
18
19*comlink.bind*(_key_, _action_)
20
21*comlink.notify*(_title_, _body_)
22
23*comlink.add_command*(_cmd_, _callback_)
24
25# DESCRIPTION
26
27The comlink module is the entrypoint into configuring and scripting comlink.
28This module provides application level API calls.
29
30*comlink.setup*
31 Accepts a configuration table. This table defines the global application
32 configuration. The table has the following required fields:
33
34 - *markread_on_focus*: boolean, whether to update unread indicator on
35 focus gain
36
37*comlink.connect*
38 Accepts a configuration table. This table defines the server
39 configuration. The table has the following required fields:
40
41 - *server*: string, the server URL
42 - *user*: string, username used in SASL
43 - *nick*: string, nickname to identify as
44 - *password*: string, password to use in SASL
45 - *real_name*: string, user's real name
46
47 The following optional fields are available:
48
49 - *port*: uint16 (default=6697 (tls) or 6667), port to use for
50 connection
51 - *tls*: boolean (default=true), when true, use an encrypted connection
52
53*comlink.log*
54 Accepts a string and inserts a log statement into the comlink
55 logs. This can be helpful for debugging.
56
57*comlink.bind*
58 Accepts a string description of the _key_, as well an _action_. Keys may
59 include modifiers which must be of the form *shift*, *alt*, *ctrl*,
60 *super*, *hyper*, or *meta*. Named keys may be used as well, for example
61 *f1* or *tab*. To add a modifier to a key use a *+*, for example
62 "*ctrl+a*". An _action_ can be either a string or a lua function.
63 Available string actions are:
64
65 - *next_channel*
66 - *prev_channel*
67 - *quit*
68 - *redraw*
69
70*comlink.notify*
71 Accepts two strings: the first is the title of the notification and the
72 second is the body of the notification. This function produces a system
73 notification on terminals which support OSC 777.
74
75*comlink.add_command*
76 Adds the string _cmd_ as an available command in comlink. This command
77 will show up in the completion list as well. When invoked, the
78 _callback_ function will be called and receives the arguments from the
79 command line, with the command removed and whitespace stripped.
80
81# RETURN VALUES
82
83*comlink.connect*
84 Returns a *connection*. The connection represents a connection to a
85 single server. In the presence of the _soju.im/bouncer-networks_
86 extension, discovered networks will inherit callbacks set on
87 *connection*. See *comlink_connection*(3).
88
89*comlink.selected_channel*
90 Returns a *channel*, or *nil* if no channel is selected. See
91 *comlink_channel*(3).
92
93# SEE ALSO
94
95*comlink*(1), *comlink_connection*(3), *comlink_channel*(3)