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