docs/iamb.5
587 lines · 13023 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 state_event_display
212Defines whether the state events like joined or left are shown.
213
214.It Sy typing_notice_send
215Defines whether or not the typing state is sent.
216
217.It Sy typing_notice_display
218Defines whether or not the typing state is displayed.
219
220.It Sy user
221Overrides values for the specified user.
222See
223.Sx "USER OVERRIDES"
224for details on the format.
225
226.It Sy username_display
227Defines how usernames are shown for message senders.
228Possible values are
229.Dq Sy username ,
230.Dq Sy localpart , or
231.Dq Sy displayname .
232
233.It Sy user_gutter_width
234Specify the width of the column where usernames are displayed in a room.
235Usernames that are too long are truncated.
236Defaults to 30.
237
238.It Sy tabstop
239Number of spaces that a <Tab> counts for.
240Defaults to 4.
241.El
242
243.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
244.Bd -literal -offset indent
245[settings]
246username = "username"
247message_shortcode_display = true
248reaction_shortcode_display = true
249.Ed
250
251.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
252.Bd -literal -offset indent
253[settings]
254request_timeout = 120
255.Ed
256
257.Sh NOTIFICATIONS
258
259The
260.Sy settings.notifications
261subsection allows configuring how notifications for new messages behave.
262
263The available fields in this subsection are:
264.Bl -tag -width Ds
265.It Sy enabled
266Defaults to
267.Sy false .
268Setting this field to
269.Sy true
270enables notifications.
271
272.It Sy via
273Defaults to
274.Dq Sy desktop
275to use the desktop mechanism (default).
276Setting this field to
277.Dq Sy bell
278will use the terminal bell instead.
279Both can be used via
280.Dq Sy desktop|bell .
281
282.It Sy show_message
283controls whether to show the message in the desktop notification, and defaults to
284.Sy true .
285Messages are truncated beyond a small length.
286The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
287In other words, you can simply change the rules with another client.
288.El
289
290.Ss Example 1: Enable notifications with default options
291.Bd -literal -offset indent
292[settings]
293notifications = {}
294.Ed
295.Ss Example 2: Enable notifications using terminal bell
296.Bd -literal -offset indent
297[settings.notifications]
298via = "bell"
299show_message = false
300.Ed
301
302.Sh "SORTING LISTS"
303
304The
305.Sy settings.sort
306subsection allows configuring how different windows have their contents sorted.
307
308Fields available within this subsection are:
309.Bl -tag -width Ds
310.It Sy rooms
311How to sort the
312.Sy :rooms
313window.
314Defaults to
315.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
316.It Sy chats
317How to sort the
318.Sy :chats
319window.
320Defaults to the
321.Sy rooms
322value.
323.It Sy dms
324How to sort the
325.Sy :dms
326window.
327Defaults to the
328.Sy rooms
329value.
330.It Sy spaces
331How to sort the
332.Sy :spaces
333window.
334Defaults to the
335.Sy rooms
336value.
337.It Sy members
338How to sort the
339.Sy :members
340window.
341Defaults to
342.Sy ["power",\ "id"] .
343.El
344
345The available values are:
346.Bl -tag -width Ds
347.It Sy favorite
348Put favorite rooms before other rooms.
349.It Sy lowpriority
350Put lowpriority rooms after other rooms.
351.It Sy name
352Sort rooms by alphabetically ascending room name.
353.It Sy alias
354Sort rooms by alphabetically ascending canonical room alias.
355.It Sy id
356Sort rooms by alphabetically ascending Matrix room identifier.
357.It Sy unread
358Put unread rooms before other rooms.
359.It Sy recent
360Sort rooms by most recent message timestamp.
361.It Sy invite
362Put invites before other rooms.
363.El
364.El
365
366.Ss Example 1: Group room members by their server first
367.Bd -literal -offset indent
368[settings.sort]
369members = ["server", "localpart"]
370.Ed
371
372.Sh "USER OVERRIDES"
373
374The
375.Sy settings.users
376subsections allows overriding how specific senders are displayed.
377Overrides are mapped onto Matrix User IDs such as
378.Sy @user:matrix.org ,
379and are typically written as inline tables containing the following keys:
380
381.Bl -tag -width Ds
382.It Sy name
383Change the display name of the user.
384
385.It Sy color
386Change the color the user is shown as.
387Possible values are:
388.Dq Sy black ,
389.Dq Sy blue ,
390.Dq Sy cyan ,
391.Dq Sy dark-gray ,
392.Dq Sy gray ,
393.Dq Sy green ,
394.Dq Sy light-blue ,
395.Dq Sy light-cyan ,
396.Dq Sy light-green ,
397.Dq Sy light-magenta ,
398.Dq Sy light-red ,
399.Dq Sy light-yellow ,
400.Dq Sy magenta ,
401.Dq Sy none ,
402.Dq Sy red ,
403.Dq Sy white ,
404and
405.Dq Sy yellow .
406.El
407
408.Ss Example 1: Override how @ada:example.com appears in chat
409.Bd -literal -offset indent
410[settings.users]
411"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
412.Ed
413
414.Sh STARTUP LAYOUT
415
416The
417.Sy layout
418section allows configuring the initial set of tabs and windows to show when
419starting the client.
420
421.Bl -tag -width Ds
422.It Sy style
423Specifies what window layout to load when starting.
424Valid values are
425.Dq Sy restore
426to restore the layout from the last time the client was exited,
427.Dq Sy new
428to open a single window (uses the value of
429.Sy default_room
430if set), or
431.Dq Sy config
432to open the layout described under
433.Sy tabs .
434
435.It Sy tabs
436If
437.Sy style
438is set to
439.Sy config ,
440then this value will be used to open a set of tabs and windows at startup.
441Each object can contain either a
442.Sy window
443key specifying a username, room identifier or room alias to show, or a
444.Sy split
445key specifying an array of window objects.
446.El
447
448.Ss Example 1: Show a single room every startup
449.Bd -literal -offset indent
450[settings]
451default_room = "#iamb-users:0x.badd.cafe"
452
453[layout]
454style = "new"
455.Ed
456.Ss Example 2: Show a specific layout every startup
457.Bd -literal -offset indent
458[layout]
459style = "config"
460
461[[layout.tabs]]
462window = "iamb://dms"
463
464[[layout.tabs]]
465window = "iamb://rooms"
466
467[[layout.tabs]]
468split = [
469 { "window" = "#iamb-users:0x.badd.cafe" },
470 { "window" = "#iamb-dev:0x.badd.cafe" }
471]
472.Ed
473
474.Sh "CUSTOM KEYBINDINGS"
475
476The
477.Sy macros
478subsections allow configuring custom keybindings.
479Available subsections are:
480
481.Bl -tag -width Ds
482.It Sy insert , Sy i
483Map the key sequences in this section in
484.Sy Insert
485mode.
486
487.It Sy normal , Sy n
488Map the key sequences in this section in
489.Sy Normal
490mode.
491
492.It Sy visual , Sy v
493Map the key sequences in this section in
494.Sy Visual
495mode.
496
497.It Sy select
498Map the key sequences in this section in
499.Sy Select
500mode.
501
502.It Sy command , Sy c
503Map the key sequences in this section in
504.Sy Visual
505mode.
506
507.It Sy operator-pending
508Map the key sequences in this section in
509.Sy "Operator Pending"
510mode.
511.El
512
513Multiple modes can be given together by separating their names with
514.Dq Sy | .
515
516.Ss Example 1: Use "jj" to exit Insert mode
517.Bd -literal -offset indent
518[macros.insert]
519"jj" = "<Esc>"
520.Ed
521
522.Ss Example 2: Use "V" for switching between message bar and room history
523.Bd -literal -offset indent
524[macros."normal|visual"]
525"V" = "<C-W>m"
526.Ed
527
528.Sh DIRECTORIES
529
530Specifies the directories to save data in.
531Configured as an object under the key
532.Sy dirs .
533
534.Bl -tag -width Ds
535.It Sy cache
536Specifies where to store assets and temporary data in.
537(For example,
538.Sy image_preview
539and
540.Sy logs
541will also go in here by default.)
542Defaults to
543.Ev $XDG_CACHE_HOME/iamb .
544
545.It Sy data
546Specifies where to store persistent data in, such as E2EE room keys.
547Defaults to
548.Ev $XDG_DATA_HOME/iamb .
549
550.It Sy downloads
551Specifies where to store downloaded files.
552Defaults to
553.Ev $XDG_DOWNLOAD_DIR .
554
555.It Sy image_previews
556Specifies where to store automatically downloaded image previews.
557Defaults to
558.Ev ${cache}/image_preview_downloads .
559
560.It Sy logs
561Specifies where to store log files.
562Defaults to
563.Ev ${cache}/logs .
564.El
565.Sh FILES
566.Bl -tag -width Ds
567.It Pa ~/.config/iamb/config.toml
568The TOML configuration file that
569.Sy iamb
570loads by default.
571.It Pa ~/.config/iamb/config.json
572A JSON configuration file that
573.Sy iamb
574will load if the TOML one is not found.
575.It Pa /usr/share/iamb/config.example.toml
576A sample configuration file with examples of how to set different values.
577.El
578.Sh "REPORTING BUGS"
579Please report bugs in
580.Sy iamb
581or its manual pages at
582.Lk https://github.com/ulyssa/iamb/issues
583.Sh SEE ALSO
584.Xr iamb 1
585.Pp
586Extended documentation is available online at
587.Lk https://iamb.chat