docs/iamb.5

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