docs/iamb.5
616 lines · 15325 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.5
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 password_file
79The path to the file containing the password to use when connecting to the server.
80.It Sy url
81The URL of the user's server.
82(For example "https://matrix.org" for "@user:matrix.org".)
83This is only needed when the server does not have a
84.Pa /.well-known/matrix/client
85entry.
86.El
87.Pp
88In addition to the above fields, you can also reuse the following fields to set
89per-profile overrides of their global values:
90.Bl -bullet -offset indent -width 1m
91.It
92.Sy dirs
93.It
94.Sy layout
95.It
96.Sy macros
97.It
98.Sy settings
99.El
100.Ss Example 1: A single profile
101.Bd -literal -offset indent
102[profiles.personal]
103user_id = "@user:matrix.org"
104.Ed
105.Ss Example 2: Two profiles with a default
106In the following example, there are two profiles,
107.Dq personal
108(set to be the default) and
109.Dq work .
110The
111.Dq work
112profile has an explicit URL set for its homeserver.
113.Bd -literal -offset indent
114default_profile = "personal"
115
116[profiles.personal]
117user_id = "@user:matrix.org"
118
119[profiles.work]
120user_id = "@user:example.com"
121url = "https://matrix.example.com"
122.Ed
123.Sh SETTINGS
124These options are configured as an object under the
125.Sy settings
126key and can be overridden as described in
127.Sx PROFILES .
128.Bl -tag -width Ds
129.It Sy encryption
130Configuration subsection for specific settings related to room encryption.
131See
132.Sx ENCRYPTION
133for more details.
134.It Sy external_edit_file_suffix
135Suffix to append to temporary file names when using the :editor command. Defaults to .md.
136.It Sy default_room
137The room to show by default instead of the
138.Sy :welcome
139window.
140.It Sy image_preview
141Enable image previews and configure it.
142An empty object will enable the feature with default settings, omitting it will disable the feature.
143The available fields in this object are:
144.Bl -tag -width Ds
145.It Sy size
146An optional object with
147.Sy width
148and
149.Sy height
150fields to specify the preview size in cells.
151Defaults to 66 and 10.
152.It Sy protocol
153An optional object to override settings that will normally be guessed automatically:
154.Bl -tag -width Ds
155.It Sy type
156An optional string set to one of the protocol types:
157.Dq Sy sixel ,
158.Dq Sy kitty ,
159and
160.Dq Sy halfblocks .
161.It Sy font_size
162An optional list of two numbers representing font width and height in pixels.
163.El
164.El
165.It Sy log_level
166Specifies the lowest log level that should be shown.
167Possible values are:
168.Dq Sy trace ,
169.Dq Sy debug ,
170.Dq Sy info ,
171.Dq Sy warn
172(the default), and
173.Dq Sy error .
174Also supports the syntax defined by
175.Lk https://docs.rs/tracing_subscriber/0.3.16/tracing_subscriber/filter/struct.EnvFilter.html
176.It Sy max_log_files
177Specifies how many daily log files should be saved.
178Set this to
179.Sy 0
180to disable automatically deleting log files.
181Defaults to
182.Sy 7 .
183.It Sy mouse
184Enable mouse support
185See
186.Sx MOUSE
187for more details.
188.It Sy message_shortcode_display
189Defines whether or not Emoji characters in messages should be replaced by their
190respective shortcodes.
191.It Sy message_user_color
192Defines whether or not the message body is colored like the username.
193.It Sy normal_after_send
194Defines whether to reset input to Normal mode after sending a message.
195.It Sy notifications
196When this subsection is present, you can enable and configure push notifications.
197See
198.Sx NOTIFICATIONS
199for more details.
200.It Sy open_command
201Defines a custom command and its arguments to run when opening downloads instead of the default.
202(For example,
203.Sy ["my-open",\ "--file"] . )
204.It Sy reaction_display
205Defines whether or not reactions should be shown.
206.It Sy reaction_shortcode_display
207Defines whether or not reactions should be shown as their respective shortcode.
208.It Sy read_receipt_send
209Defines whether or not read confirmations are sent.
210.It Sy read_receipt_display
211Defines whether or not read confirmations are displayed.
212.It Sy request_timeout
213Defines the maximum time per request in seconds.
214.It Sy sort
215Configures how to sort the lists shown in windows like
216.Sy :rooms
217or
218.Sy :members .
219See
220.Sx "SORTING LISTS"
221for more details.
222.It Sy state_event_display
223Defines whether the state events like joined or left are shown.
224.It Sy typing_notice_send
225Defines whether or not the typing state is sent.
226.It Sy typing_notice_display
227Defines whether or not the typing state is displayed.
228.It Sy user
229Overrides values for the specified user.
230See
231.Sx "USER OVERRIDES"
232for details on the format.
233.It Sy username_display
234Defines how usernames are shown for message senders.
235Possible values are
236.Dq Sy username ,
237.Dq Sy localpart ,
238or
239.Dq Sy displayname .
240.It Sy user_gutter_width
241Specify the width of the column where usernames are displayed in a room.
242Usernames that are too long are truncated.
243If this value is less than 3, the usernames are displayed in an extra line at the top of the message
244and this value is only used to indent the message.
245Defaults to 30.
246.It Sy tabstop
247Number of spaces that a <Tab> counts for.
248Defaults to 4.
249
250.It Sy ssl_verify
251Enable SSL verification for the HTTP requests.
252Defaults to true.
253.El
254.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
255.Bd -literal -offset indent
256[settings]
257username = "username"
258message_shortcode_display = true
259reaction_shortcode_display = true
260.Ed
261.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
262.Bd -literal -offset indent
263[settings]
264request_timeout = 120
265.Ed
266.Sh ENCRYPTION
267The
268.Sy settings.encryption
269subsection allows controlling how encrypted rooms are presented.
270.Pp
271The available fields in this subsection are:
272.Bl -tag -width Ds
273.It Sy indicator
274Defines when an encryption status indicator is shown.
275Possible values are:
276.Dq Sy enabled
277(default, always indicate status),
278.Dq Sy disabled
279(never indicate status),
280.Dq Sy only-unencrypted ,
281and
282.Dq Sy only-encrypted .
283.It Sy indicator_location
284Defines where the encryption status indicator is shown when relevant.
285Possible values are:
286.Dq Sy title ,
287and
288.Dq Sy prompt
289(the default).
290Both can be used via
291.Dq Sy title|prompt .
292.Sh MOUSE
293The
294.Sy settings.mouse
295subsection allows enabling mouse support.
296Currently the only difference is that scrolling moves the window view instead of changing the selection.
297.Pp
298The available fields in this subsection are:
299.Bl -tag -width Ds
300.It Sy enabled
301Defaults to
302.Sy false .
303Setting this field to
304.Sy true
305enables mouse support.
306.El
307.Sh NOTIFICATIONS
308The
309.Sy settings.notifications
310subsection allows configuring how notifications for new messages behave.
311.Pp
312The available fields in this subsection are:
313.Bl -tag -width Ds
314.It Sy enabled
315Defaults to
316.Sy false .
317Setting this field to
318.Sy true
319enables notifications.
320.It Sy via
321Defaults to
322.Dq Sy desktop
323to use the desktop mechanism (default).
324Setting this field to
325.Dq Sy bell
326will use the terminal bell instead.
327Both can be used via
328.Dq Sy desktop|bell .
329.It Sy show_message
330controls whether to show the message in the desktop notification, and defaults to
331.Sy true .
332Messages are truncated beyond a small length.
333The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
334In other words, you can simply change the rules with another client.
335.It Sy sound_hint
336Controls the notification sound name that is passed as a hint to the notification daemon.
337.El
338.Ss Example 1: Enable notifications with default options
339.Bd -literal -offset indent
340[settings.notifications]
341enabled = true
342.Ed
343.Ss Example 2: Enable notifications using terminal bell
344.Bd -literal -offset indent
345[settings.notifications]
346enabled = true
347via = "bell"
348show_message = false
349.Ed
350.Ss Example 3: Enable notifications using the instant message sound
351.Bd -literal -offset indent
352[settings.notifications]
353enabled = true
354sound_hint = "message-new-instant" # Linux
355sound_hint = "IM" # Windows
356.Ed
357.Sh "SORTING LISTS"
358The
359.Sy settings.sort
360subsection allows configuring how different windows have their contents sorted.
361.Pp
362Fields available within this subsection are:
363.Bl -tag -width Ds
364.It Sy rooms
365How to sort the
366.Sy :rooms
367window.
368Defaults to
369.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
370.It Sy chats
371How to sort the
372.Sy :chats
373window.
374Defaults to the
375.Sy rooms
376value.
377.It Sy dms
378How to sort the
379.Sy :dms
380window.
381Defaults to the
382.Sy rooms
383value.
384.It Sy spaces
385How to sort the
386.Sy :spaces
387window.
388Defaults to the
389.Sy rooms
390value.
391.It Sy members
392How to sort the
393.Sy :members
394window.
395Defaults to
396.Sy ["power",\ "id"] .
397.El
398.Pp
399The available values are:
400.Bl -tag -width Ds
401.It Sy favorite
402Put favorite rooms before other rooms.
403.It Sy lowpriority
404Put lowpriority rooms after other rooms.
405.It Sy name
406Sort rooms by alphabetically ascending room name.
407.It Sy alias
408Sort rooms by alphabetically ascending canonical room alias.
409.It Sy id
410Sort rooms by alphabetically ascending Matrix room identifier.
411.It Sy unread
412Put unread rooms before other rooms.
413.It Sy recent
414Sort rooms by most recent message timestamp.
415.It Sy invite
416Put invites before other rooms.
417.El
418.Pp
419Add a
420.Dq Sy ~
421in front of any value to flip the order.
422.Ss Example 1: Group room members by their server first and descending localpart second
423.Bd -literal -offset indent
424[settings.sort]
425members = ["server", "~localpart"]
426.Ed
427.Sh "USER OVERRIDES"
428The
429.Sy settings.users
430subsections allows overriding how specific senders are displayed.
431Overrides are mapped onto Matrix User IDs such as
432.Sy @user:matrix.org ,
433and are typically written as inline tables containing the following keys:
434.Bl -tag -width Ds
435.It Sy name
436Change the display name of the user.
437.It Sy color
438Change the color the user is shown as.
439Possible values are:
440.Dq Sy black ,
441.Dq Sy blue ,
442.Dq Sy cyan ,
443.Dq Sy dark-gray ,
444.Dq Sy gray ,
445.Dq Sy green ,
446.Dq Sy light-blue ,
447.Dq Sy light-cyan ,
448.Dq Sy light-green ,
449.Dq Sy light-magenta ,
450.Dq Sy light-red ,
451.Dq Sy light-yellow ,
452.Dq Sy magenta ,
453.Dq Sy none ,
454.Dq Sy red ,
455.Dq Sy white ,
456and
457.Dq Sy yellow .
458.El
459.Ss Example 1: Override how @ada:example.com appears in chat
460.Bd -literal -offset indent
461[settings.users]
462"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
463.Ed
464.Sh STARTUP LAYOUT
465The
466.Sy layout
467section allows configuring the initial set of tabs and windows to show when
468starting the client.
469.Bl -tag -width Ds
470.It Sy style
471Specifies what window layout to load when starting.
472Valid values are
473.Dq Sy restore
474to restore the layout from the last time the client was exited,
475.Dq Sy new
476to open a single window (uses the value of
477.Sy default_room
478if set), or
479.Dq Sy config
480to open the layout described under
481.Sy tabs .
482.It Sy tabs
483If
484.Sy style
485is set to
486.Sy config ,
487then this value will be used to open a set of tabs and windows at startup.
488Each object can contain either a
489.Sy window
490key specifying a username, room identifier or room alias to show, or a
491.Sy split
492key specifying an array of window objects.
493.El
494.Ss Example 1: Show a single room every startup
495.Bd -literal -offset indent
496[settings]
497default_room = "#iamb-users:0x.badd.cafe"
498
499[layout]
500style = "new"
501.Ed
502.Ss Example 2: Show a specific layout every startup
503.Bd -literal -offset indent
504[layout]
505style = "config"
506
507[[layout.tabs]]
508window = "iamb://dms"
509
510[[layout.tabs]]
511window = "iamb://rooms"
512
513[[layout.tabs]]
514split = [
515 { "window" = "#iamb-users:0x.badd.cafe" },
516 { "window" = "#iamb-dev:0x.badd.cafe" }
517]
518.Ed
519.Sh "CUSTOM KEYBINDINGS"
520The
521.Sy macros
522subsections allow configuring custom keybindings.
523Available subsections are:
524.Bl -tag -width Ds
525.It Sy insert , Sy i
526Map the key sequences in this section in
527.Sy Insert
528mode.
529.It Sy normal , Sy n
530Map the key sequences in this section in
531.Sy Normal
532mode.
533.It Sy visual , Sy v
534Map the key sequences in this section in
535.Sy Visual
536mode.
537.It Sy select
538Map the key sequences in this section in
539.Sy Select
540mode.
541.It Sy command , Sy c
542Map the key sequences in this section in
543.Sy Visual
544mode.
545.It Sy operator-pending
546Map the key sequences in this section in
547.Sy "Operator Pending"
548mode.
549.El
550.Pp
551Multiple modes can be given together by separating their names with
552.Dq Sy | .
553.Ss Example 1: Use "jj" to exit Insert mode
554.Bd -literal -offset indent
555[macros.insert]
556"jj" = "<Esc>"
557.Ed
558.Ss Example 2: Use "V" for switching between message bar and room history
559.Bd -literal -offset indent
560[macros."normal|visual"]
561"V" = "<C-W>m"
562.Ed
563.Sh DIRECTORIES
564Specifies the directories to save data in.
565Configured as an object under the key
566.Sy dirs .
567.Bl -tag -width Ds
568.It Sy cache
569Specifies where to store assets and temporary data in.
570(For example,
571.Sy image_preview
572and
573.Sy logs
574will also go in here by default.)
575Defaults to
576.Ev $XDG_CACHE_HOME/iamb .
577.It Sy data
578Specifies where to store persistent data in, such as E2EE room keys.
579Defaults to
580.Ev $XDG_DATA_HOME/iamb .
581.It Sy downloads
582Specifies where to store downloaded files.
583Defaults to
584.Ev $XDG_DOWNLOAD_DIR .
585.It Sy image_previews
586Specifies where to store automatically downloaded image previews.
587Defaults to
588.Ev ${cache}/image_preview_downloads .
589.It Sy logs
590Specifies where to store log files.
591Defaults to
592.Ev ${cache}/logs .
593.El
594.Sh FILES
595.Bl -tag -width Ds
596.It Pa ~/.config/iamb/config.toml
597The TOML configuration file that
598.Sy iamb
599loads by default.
600.It Pa ~/.config/iamb/config.json
601A JSON configuration file that
602.Sy iamb
603will load if the TOML one is not found.
604.It Pa /usr/share/iamb/config.example.toml
605A sample configuration file with examples of how to set different values.
606.El
607.Sh "REPORTING BUGS"
608Please report bugs in
609.Sy iamb
610or its manual pages at
611.Lk https://github.com/ulyssa/iamb/issues
612.Sh SEE ALSO
613.Xr iamb 1
614.Pp
615Extended documentation is available online at
616.Lk https://iamb.chat