docs/iamb.5

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