docs/iamb.5
558 lines · 12284 bytes
1.\" iamb(7) manual page
2.\"
3.\" This manual page is written using the mdoc(7) macros. For more
4.\" information, see <https://manpages.bsd.lv/mdoc.html>.
5.\"
6.\" You can preview this file with:
7.\" $ man ./docs/iamb.1
8.Dd Mar 24, 2024
9.Dt IAMB 5
10.Os
11.Sh NAME
12.Nm config.toml
13.Nd configuration file for
14.Sy iamb
15.Sh DESCRIPTION
16Configuration must be placed under
17.Pa ~/.config/iamb/
18and named
19.Nm .
20(If
21.Ev $XDG_CONFIG_HOME
22is set, then
23.Sy iamb
24will look for a directory named
25.Pa iamb
26there instead.)
27.Pp
28Example configuration usually comes bundled with your installation and can
29typically be found in
30.Pa /usr/share/iamb .
31.Pp
32As implied by the filename, the configuration is formatted in TOML.
33It's structure and fields are described below.
34.Sh CONFIGURATION
35These options are sections at the top-level of the file.
36.Bl -tag -width Ds
37.It Sy profiles
38A map of profile names containing per-account information.
39See
40.Sx PROFILES .
41.It Sy default_profile
42The name of the default profile to connect to, unless overwritten by a
43commandline switch.
44It should be one of the names defined in the
45.Sy profiles
46section.
47.It Sy settings
48Overwrite general settings for
49.Sy iamb .
50See
51.Sx SETTINGS
52for a description of possible values.
53.It Sy layout
54Configure the default window layout to use when starting
55.Sy iamb .
56See
57.Sx "STARTUP LAYOUT"
58for more information on how to configure this object.
59.It Sy macros
60Map keybindings to other keybindings.
61See
62.Sx "CUSTOM KEYBINDINGS"
63for how to configure this object.
64.It Sy dirs
65Configure the directories to use for data, logs, and more.
66See
67.Sx DIRECTORIES
68for the possible values you can set in this object.
69.El
70.Sh PROFILES
71These options are configured as fields in the
72.Sy profiles
73object.
74.Bl -tag -width Ds
75.It Sy user_id
76The user ID to use when connecting to the server.
77For example "user" in "@user:matrix.org".
78.It Sy url
79The URL of the user's server.
80(For example "https://matrix.org" for "@user:matrix.org".)
81This is only needed when the server does not have a
82.Pa /.well-known/matrix/client
83entry.
84.El
85.Pp
86In addition to the above fields, you can also reuse the following fields to set
87per-profile overrides of their global values:
88.Bl -bullet -offset indent -width 1m
89.It
90.Sy dirs
91.It
92.Sy layout
93.It
94.Sy macros
95.It
96.Sy settings
97.El
98.Ss Example 1: A single profile
99.Bd -literal -offset indent
100[profiles.personal]
101user_id = "@user:matrix.org"
102.Ed
103.Ss Example 2: Two profiles with a default
104In the following example, there are two profiles,
105.Dq personal
106(set to be the default) and
107.Dq work .
108The
109.Dq work
110profile has an explicit URL set for its homeserver.
111.Bd -literal -offset indent
112default_profile = "personal"
113
114[profiles.personal]
115user_id = "@user:matrix.org"
116
117[profiles.work]
118user_id = "@user:example.com"
119url = "https://matrix.example.com"
120.Ed
121.Sh SETTINGS
122These options are configured as an object under the
123.Sy settings
124key and can be overridden as described in
125.Sx PROFILES .
126.Bl -tag -width Ds
127
128.It Sy external_edit_file_suffix
129Suffix to append to temporary file names when using the :editor command. Defaults to .md.
130
131.It Sy default_room
132The room to show by default instead of the
133.Sy :welcome
134window.
135
136.It Sy image_preview
137Enable image previews and configure it.
138An empty object will enable the feature with default settings, omitting it will disable the feature.
139The available fields in this object are:
140.Bl -tag -width Ds
141.It Sy size
142An optional object with
143.Sy width
144and
145.Sy height
146fields to specify the preview size in cells.
147Defaults to 66 and 10.
148.It Sy protocol
149An optional object to override settings that will normally be guessed automatically:
150.Bl -tag -width Ds
151.It Sy type
152An optional string set to one of the protocol types:
153.Dq Sy sixel ,
154.Dq Sy kitty , and
155.Dq Sy halfblocks .
156.It Sy font_size
157An optional list of two numbers representing font width and height in pixels.
158.El
159.El
160.It Sy log_level
161Specifies the lowest log level that should be shown.
162Possible values are:
163.Dq Sy trace ,
164.Dq Sy debug ,
165.Dq Sy info ,
166.Dq Sy warn , and
167.Dq Sy error .
168
169.It Sy message_shortcode_display
170Defines whether or not Emoji characters in messages should be replaced by their
171respective shortcodes.
172
173.It Sy message_user_color
174Defines whether or not the message body is colored like the username.
175
176.It Sy notifications
177When this subsection is present, you can enable and configure push notifications.
178See
179.Sx NOTIFICATIONS
180for more details.
181
182.It Sy open_command
183Defines a custom command and its arguments to run when opening downloads instead of the default.
184(For example,
185.Sy ["my-open",\ "--file"] . )
186
187.It Sy reaction_display
188Defines whether or not reactions should be shown.
189
190.It Sy reaction_shortcode_display
191Defines whether or not reactions should be shown as their respective shortcode.
192
193.It Sy read_receipt_send
194Defines whether or not read confirmations are sent.
195
196.It Sy read_receipt_display
197Defines whether or not read confirmations are displayed.
198
199.It Sy request_timeout
200Defines the maximum time per request in seconds.
201
202.It Sy sort
203Configures how to sort the lists shown in windows like
204.Sy :rooms
205or
206.Sy :members .
207See
208.Sx "SORTING LISTS"
209for more details.
210
211.It Sy typing_notice_send
212Defines whether or not the typing state is sent.
213
214.It Sy typing_notice_display
215Defines whether or not the typing state is displayed.
216
217.It Sy user
218Overrides values for the specified user.
219See
220.Sx "USER OVERRIDES"
221for details on the format.
222
223.It Sy username_display
224Defines how usernames are shown for message senders.
225Possible values are
226.Dq Sy username ,
227.Dq Sy localpart , or
228.Dq Sy displayname .
229
230.It Sy user_gutter_width
231Specify the width of the column where usernames are displayed in a room.
232Usernames that are too long are truncated.
233Defaults to 30.
234.El
235
236.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
237.Bd -literal -offset indent
238[settings]
239username = "username"
240message_shortcode_display = true
241reaction_shortcode_display = true
242.Ed
243
244.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
245.Bd -literal -offset indent
246[settings]
247request_timeout = 120
248.Ed
249
250.Sh NOTIFICATIONS
251
252The
253.Sy settings.notifications
254subsection allows configuring how notifications for new messages behave.
255
256The available fields in this subsection are:
257.Bl -tag -width Ds
258.It Sy enabled
259Defaults to
260.Sy false .
261Setting this field to
262.Sy true
263enables notifications.
264
265.It Sy via
266Defaults to
267.Dq Sy desktop
268to use the desktop mechanism (default).
269Setting this field to
270.Dq Sy bell
271will use the terminal bell instead.
272
273.It Sy show_message
274controls whether to show the message in the desktop notification, and defaults to
275.Sy true .
276Messages are truncated beyond a small length.
277The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
278In other words, you can simply change the rules with another client.
279.El
280
281.Ss Example 1: Enable notifications with default options
282.Bd -literal -offset indent
283[settings]
284notifications = {}
285.Ed
286.Ss Example 2: Enable notifications using terminal bell
287.Bd -literal -offset indent
288[settings.notifications]
289via = "bell"
290show_message = false
291.Ed
292
293.Sh "SORTING LISTS"
294
295The
296.Sy settings.sort
297subsection allows configuring how different windows have their contents sorted.
298
299Fields available within this subsection are:
300.Bl -tag -width Ds
301.It Sy rooms
302How to sort the
303.Sy :rooms
304window.
305Defaults to
306.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
307.It Sy chats
308How to sort the
309.Sy :chats
310window.
311Defaults to the
312.Sy rooms
313value.
314.It Sy dms
315How to sort the
316.Sy :dms
317window.
318Defaults to the
319.Sy rooms
320value.
321.It Sy spaces
322How to sort the
323.Sy :spaces
324window.
325Defaults to the
326.Sy rooms
327value.
328.It Sy members
329How to sort the
330.Sy :members
331window.
332Defaults to
333.Sy ["power",\ "id"] .
334.El
335.El
336
337.Ss Example 1: Group room members by ther server first
338.Bd -literal -offset indent
339[settings.sort]
340members = ["server", "localpart"]
341.Ed
342
343.Sh "USER OVERRIDES"
344
345The
346.Sy settings.users
347subsections allows overriding how specific senders are displayed.
348Overrides are mapped onto Matrix User IDs such as
349.Sy @user:matrix.org ,
350and are typically written as inline tables containing the following keys:
351
352.Bl -tag -width Ds
353.It Sy name
354Change the display name of the user.
355
356.It Sy color
357Change the color the user is shown as.
358Possible values are:
359.Dq Sy black ,
360.Dq Sy blue ,
361.Dq Sy cyan ,
362.Dq Sy dark-gray ,
363.Dq Sy gray ,
364.Dq Sy green ,
365.Dq Sy light-blue ,
366.Dq Sy light-cyan ,
367.Dq Sy light-green ,
368.Dq Sy light-magenta ,
369.Dq Sy light-red ,
370.Dq Sy light-yellow ,
371.Dq Sy magenta ,
372.Dq Sy none ,
373.Dq Sy red ,
374.Dq Sy white ,
375and
376.Dq Sy yellow .
377.El
378
379.Ss Example 1: Override how @ada:example.com appears in chat
380.Bd -literal -offset indent
381[settings.users]
382"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
383.Ed
384
385.Sh STARTUP LAYOUT
386
387The
388.Sy layout
389section allows configuring the initial set of tabs and windows to show when
390starting the client.
391
392.Bl -tag -width Ds
393.It Sy style
394Specifies what window layout to load when starting.
395Valid values are
396.Dq Sy restore
397to restore the layout from the last time the client was exited,
398.Dq Sy new
399to open a single window (uses the value of
400.Sy default_room
401if set), or
402.Dq Sy config
403to open the layout described under
404.Sy tabs .
405
406.It Sy tabs
407If
408.Sy style
409is set to
410.Sy config ,
411then this value will be used to open a set of tabs and windows at startup.
412Each object can contain either a
413.Sy window
414key specifying a username, room identifier or room alias to show, or a
415.Sy split
416key specifying an array of window objects.
417.El
418
419.Ss Example 1: Show a single room every startup
420.Bd -literal -offset indent
421[settings]
422default_room = "#iamb-users:0x.badd.cafe"
423
424[layout]
425style = "new"
426.Ed
427.Ss Example 2: Show a specific layout every startup
428.Bd -literal -offset indent
429[layout]
430style = "config"
431
432[[layout.tabs]]
433window = "iamb://dms"
434
435[[layout.tabs]]
436window = "iamb://rooms"
437
438[[layout.tabs]]
439split = [
440 { "window" = "#iamb-users:0x.badd.cafe" },
441 { "window" = "#iamb-dev:0x.badd.cafe" }
442]
443.Ed
444
445.Sh "CUSTOM KEYBINDINGS"
446
447The
448.Sy macros
449subsections allow configuring custom keybindings.
450Available subsections are:
451
452.Bl -tag -width Ds
453.It Sy insert , Sy i
454Map the key sequences in this section in
455.Sy Insert
456mode.
457
458.It Sy normal , Sy n
459Map the key sequences in this section in
460.Sy Normal
461mode.
462
463.It Sy visual , Sy v
464Map the key sequences in this section in
465.Sy Visual
466mode.
467
468.It Sy select
469Map the key sequences in this section in
470.Sy Select
471mode.
472
473.It Sy command , Sy c
474Map the key sequences in this section in
475.Sy Visual
476mode.
477
478.It Sy operator-pending
479Map the key sequences in this section in
480.Sy "Operator Pending"
481mode.
482.El
483
484Multiple modes can be given together by separating their names with
485.Dq Sy | .
486
487.Ss Example 1: Use "jj" to exit Insert mode
488.Bd -literal -offset indent
489[macros.insert]
490"jj" = "<Esc>"
491.Ed
492
493.Ss Example 2: Use "V" for switching between message bar and room history
494.Bd -literal -offset indent
495[macros."normal|visual"]
496"V" = "<C-W>m"
497.Ed
498
499.Sh DIRECTORIES
500
501Specifies the directories to save data in.
502Configured as an object under the key
503.Sy dirs .
504
505.Bl -tag -width Ds
506.It Sy cache
507Specifies where to store assets and temporary data in.
508(For example,
509.Sy image_preview
510and
511.Sy logs
512will also go in here by default.)
513Defaults to
514.Ev $XDG_CACHE_HOME/iamb .
515
516.It Sy data
517Specifies where to store persistent data in, such as E2EE room keys.
518Defaults to
519.Ev $XDG_DATA_HOME/iamb .
520
521.It Sy downloads
522Specifies where to store downloaded files.
523Defaults to
524.Ev $XDG_DOWNLOAD_DIR .
525
526.It Sy image_previews
527Specifies where to store automatically downloaded image previews.
528Defaults to
529.Ev ${cache}/image_preview_downloads .
530
531.It Sy logs
532Specifies where to store log files.
533Defaults to
534.Ev ${cache}/logs .
535.El
536.Sh FILES
537.Bl -tag -width Ds
538.It Pa ~/.config/iamb/config.toml
539The TOML configuration file that
540.Sy iamb
541loads by default.
542.It Pa ~/.config/iamb/config.json
543A JSON configuration file that
544.Sy iamb
545will load if the TOML one is not found.
546.It Pa /usr/share/iamb/config.example.toml
547A sample configuration file with examples of how to set different values.
548.El
549.Sh "REPORTING BUGS"
550Please report bugs in
551.Sy iamb
552or its manual pages at
553.Lk https://github.com/ulyssa/iamb/issues
554.Sh SEE ALSO
555.Xr iamb 1
556.Pp
557Extended documentation is available online at
558.Lk https://iamb.chat