docs/iamb.5
774 lines · 19976 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 cache_policy
130Configure how downloaded files and image previews are cached internally.
131Specifying this object will replace the upstream defaults and possibly lead to unconstrained cache growth.
132Possible keys and their effect are documented at:
133.br
134.Lk https://docs.rs/matrix-sdk/latest/matrix_sdk/media/struct.MediaRetentionPolicy.html#fields
135.It Sy default_markup
136Controls how text in the message bar is interpreted by default.
137Possible values are
138.Dq Sy html ,
139.Dq Sy markdown
140(the default) and
141.Dq Sy plaintext .
142.It Sy default_room
143The room to show by default instead of the
144.Sy :welcome
145window.
146.It Sy default_split
147Controls which direction
148.Sy <C-W>f
149and
150.Sy <C-W><C-F>
151open a new split when following a room identifier under the cursor.
152Possible values are
153.Dq Sy horizontal
154(the default) and
155.Dq Sy vertical .
156.It Sy encryption
157Configuration subsection for specific settings related to room encryption.
158See
159.Sx ENCRYPTION
160for more details.
161.It Sy external_edit_file_suffix
162Suffix to append to temporary file names when using the :editor command. Defaults to .md.
163.It Sy image_preview
164Subsection for configuring image previews. See
165.Sx "IMAGE PREVIEWS"
166for more details.
167.It Sy log_level
168Specifies the lowest log level that should be shown.
169Possible values are:
170.Dq Sy trace ,
171.Dq Sy debug ,
172.Dq Sy info ,
173.Dq Sy warn
174(the default), and
175.Dq Sy error .
176Also supports the syntax defined by
177.Lk https://docs.rs/tracing_subscriber/0.3.16/tracing_subscriber/filter/struct.EnvFilter.html
178.It Sy max_log_files
179Specifies how many daily log files should be saved.
180Set this to
181.Sy 0
182to disable automatically deleting log files.
183Defaults to
184.Sy 7 .
185.It Sy mouse
186Enable mouse support
187See
188.Sx MOUSE
189for more details.
190.It Sy message_shortcode_display
191Defines whether or not Emoji characters in messages should be replaced by their
192respective shortcodes.
193.It Sy members_split
194When set, this forces the
195.Sy :members
196command to open in a new window split instead of in the same window.
197Possible values are
198.Dq Sy vertical
199or
200.Dq Sy horizontal ,
201to control what kind of split is done.
202.It Sy message_user_color
203Defines whether or not the message body is colored like the username.
204.It Sy normal_after_send
205Defines whether to reset input to Normal mode after sending a message.
206.It Sy notifications
207When this subsection is present, you can enable and configure push notifications.
208See
209.Sx NOTIFICATIONS
210for more details.
211.It Sy open_command
212Defines a custom command and its arguments to run when opening downloads instead of the default.
213(For example,
214.Sy ["my-open",\ "--file"] . )
215.It Sy proxy
216When this subsection is present, you can configure how requests are proxied to the homeserver.
217See
218.Sx PROXYING
219for more details.
220.It Sy reaction_display
221Defines whether or not reactions should be shown.
222.It Sy reaction_shortcode_display
223Defines whether or not reactions should be shown as their respective shortcode.
224.It Sy read_receipt_send
225Defines whether or not public read confirmations are sent.
226.It Sy read_receipt_trigger
227Defines under what conditions threads and rooms are marked read.
228Possible values are:
229.Bl -tag -width Ds
230.It Sy focused
231The room or thread must be focused and scrolled to the last message.
232This is the default value.
233.It Sy visible
234The room or thread must be on screen and scrolled to the last message.
235.It Sy scrollback
236Some portion of the scrollback for the room or thread must be on screen, but
237the room does not need to be scrolled to the last message.
238.It Sy message
239A message must be sent to the room before marking it read.
240.El
241.It Sy read_receipt_display
242Defines whether or not read confirmations are displayed.
243.It Sy request_timeout
244Defines the maximum time per request in seconds.
245.It Sy sort
246Configures how to sort the lists shown in windows like
247.Sy :rooms
248or
249.Sy :members .
250See
251.Sx "SORTING LISTS"
252for more details.
253.It Sy state_event_display
254Defines whether the state events like joined or left are shown.
255.It Sy terminal
256Subsection for configuring how specific terminal features are used (or not used).
257See
258.Sx TERMINAL
259for more details.
260.It Sy typing_notice_send
261Defines whether or not the typing state is sent.
262.It Sy typing_notice_display
263Defines whether or not the typing state is displayed.
264.It Sy user
265Overrides values for the specified user.
266See
267.Sx "USER OVERRIDES"
268for details on the format.
269.It Sy username_display
270Defines how usernames are shown for message senders.
271Possible values are
272.Dq Sy username ,
273.Dq Sy localpart ,
274or
275.Dq Sy displayname .
276.It Sy user_gutter_width
277Specify the width of the column where usernames are displayed in a room.
278Usernames that are too long are truncated.
279If this value is less than 3, the usernames are displayed in an extra line at the top of the message
280and this value is only used to indent the message.
281Defaults to 30.
282.It Sy tabstop
283Number of spaces that a <Tab> counts for.
284Defaults to 4.
285.It Sy ssl_verify
286Enable SSL verification for the HTTP requests.
287Defaults to true.
288.El
289.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
290.Bd -literal -offset indent
291[settings]
292username = "username"
293message_shortcode_display = true
294reaction_shortcode_display = true
295.Ed
296.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
297.Bd -literal -offset indent
298[settings]
299request_timeout = 120
300.Ed
301.Sh ENCRYPTION
302The
303.Sy settings.encryption
304subsection allows controlling how encrypted rooms are presented.
305.Pp
306The available fields in this subsection are:
307.Bl -tag -width Ds
308.It Sy indicator
309Defines when an encryption status indicator is shown.
310Possible values are:
311.Dq Sy enabled
312(default, always indicate status),
313.Dq Sy disabled
314(never indicate status),
315.Dq Sy only-unencrypted ,
316and
317.Dq Sy only-encrypted .
318.It Sy indicator_location
319Defines where the encryption status indicator is shown when relevant.
320Possible values are:
321.Dq Sy title ,
322and
323.Dq Sy prompt
324(the default).
325Both can be used via
326.Dq Sy title|prompt .
327.El
328.Sh IMAGE PREVIEWS
329The
330.Sy settings.image_preview
331subsection allows configuring image previews.
332.Pp
333The available fields in this subsection are:
334.Bl -tag -width Ds
335.It Sy enabled
336Defaults to
337.Sy true .
338.It Sy lazy_load
339If
340.Sy true
341(the default), download and render image previews when viewing a message with an image.
342If
343.Sy false ,
344load previews as soon as a message with an image is received.
345.It Sy size
346An optional object with
347.Sy width
348and
349.Sy height
350fields to specify the preview size in cells.
351Defaults to 66 and 10.
352.It Sy protocol
353An optional object to override settings that will normally be guessed automatically:
354.Bl -tag -width Ds
355.It Sy type
356An optional string set to one of the protocol types:
357.Dq Sy sixel ,
358.Dq Sy kitty ,
359.Dq Sy iterm2 ,
360and
361.Dq Sy halfblocks .
362.It Sy font_size
363An optional list of two numbers representing font width and height in pixels.
364.It Sy filter
365The sample filter used to scale images.
366Possible values are:
367.Dq Sy Nearest ,
368.Dq Sy Triangle
369(default) ,
370.Dq Sy CatmullRom ,
371.Dq Sy Gaussian ,
372and
373.Dq Sy Lanczos3 .
374See
375.Lk https://docs.rs/image/0.25.10/image/imageops/enum.FilterType.html
376for more information.
377.El
378.El
379.Sh MOUSE
380The
381.Sy settings.mouse
382subsection allows enabling mouse support.
383Currently the only difference is that scrolling moves the window view instead of changing the selection.
384.Pp
385The available fields in this subsection are:
386.Bl -tag -width Ds
387.It Sy enabled
388Defaults to
389.Sy false .
390Setting this field to
391.Sy true
392enables mouse support.
393.El
394.Sh NOTIFICATIONS
395The
396.Sy settings.notifications
397subsection allows configuring how notifications for new messages behave.
398.Pp
399The available fields in this subsection are:
400.Bl -tag -width Ds
401.It Sy enabled
402Defaults to
403.Sy false .
404Setting this field to
405.Sy true
406enables notifications.
407.It Sy via
408Defaults to
409.Dq Sy desktop
410to use the desktop mechanism (default).
411Setting this field to
412.Dq Sy bell
413will use the terminal bell instead.
414Both can be used via
415.Dq Sy desktop|bell .
416.It Sy show_message
417controls whether to show the message in the desktop notification, and defaults to
418.Sy true .
419Messages are truncated beyond a small length.
420The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
421In other words, you can simply change the rules with another client.
422.It Sy sound_hint
423Controls the notification sound name that is passed as a hint to the notification daemon.
424.El
425.Ss Example 1: Enable notifications with default options
426.Bd -literal -offset indent
427[settings.notifications]
428enabled = true
429.Ed
430.Ss Example 2: Enable notifications using terminal bell
431.Bd -literal -offset indent
432[settings.notifications]
433enabled = true
434via = "bell"
435show_message = false
436.Ed
437.Ss Example 3: Enable notifications using the instant message sound
438.Bd -literal -offset indent
439[settings.notifications]
440enabled = true
441sound_hint = "message-new-instant" # Linux
442sound_hint = "IM" # Windows
443.Ed
444.Sh "PROXYING"
445The
446.Sy settings.proxy
447subsection allows configuring proxying for requests to the homeserver.
448.Pp
449Fields available within this subsection are:
450.Bl -tag -width Ds
451.It Sy url
452Either a
453.Sy socks5://IP:PORT
454URL for a SOCKS server to proxy request through,
455or a
456.Sy http[s]://[USER:PASS@]HOST[:PORT]/
457URL to do HTTP(S) proxying through.
458Setting this to the empty string will explicitly disable proxying, and any environment variables will be ignored.
459.It Sy auth
460A value to send in a
461.Sy Proxy-Authorization
462header if your HTTP(S) proxy requires it,
463such as for doing Bearer authentication with a token.
464.It Sy headers
465A subsection for specifying additional headers and values to include in requests sent to the proxy.
466For example, custom HTTPS proxy server software may require specifying a
467.Sy User-Agent
468or a custom header like
469.Sy X-Proxy-Token
470in order to be allowed to send request through it.
471.El
472.Sh "SORTING LISTS"
473The
474.Sy settings.sort
475subsection allows configuring how different windows have their contents sorted.
476.Pp
477Fields available within this subsection are:
478.Bl -tag -width Ds
479.It Sy rooms
480How to sort the
481.Sy :rooms
482window.
483Defaults to
484.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
485.It Sy chats
486How to sort the
487.Sy :chats
488window.
489Defaults to the
490.Sy rooms
491value.
492.It Sy dms
493How to sort the
494.Sy :dms
495window.
496Defaults to the
497.Sy rooms
498value.
499.It Sy spaces
500How to sort the
501.Sy :spaces
502window.
503Defaults to the
504.Sy rooms
505value.
506.It Sy members
507How to sort the
508.Sy :members
509window.
510Defaults to
511.Sy ["power",\ "knock",\ "~invite",\ "id"] .
512.El
513.Pp
514The available values for sorting rooms are:
515.Bl -tag -width Ds
516.It Sy favorite
517Put favorite rooms before other rooms.
518.It Sy lowpriority
519Put lowpriority rooms after other rooms.
520.It Sy name
521Sort rooms by alphabetically ascending room name.
522.It Sy alias
523Sort rooms by alphabetically ascending canonical room alias.
524.It Sy id
525Sort rooms by alphabetically ascending Matrix room identifier.
526.It Sy server
527Sort rooms by alphabetically ascending server name from the room alias.
528This will fall back to the server from the room identifier if there is
529no canonical alias for the room.
530.It Sy unread
531Put unread rooms before other rooms.
532.It Sy recent
533Sort rooms by most recent message timestamp.
534.It Sy invite
535Put invites before other rooms.
536.El
537.Pp
538The available values for sorting users are:
539.Bl -tag -width Ds
540.It Sy power
541Put users with higher power level before other users.
542.It Sy id
543Sort users by alphabetically ascending Matrix user identifier.
544.It Sy localpart
545Sort users by alphabetically ascending local part of the user identifier.
546.It Sy server
547Sort users by alphabetically ascending server name from the user identifier.
548.It Sy invite
549Put invited users before other members.
550.It Sy knock
551Put knocking users before other members.
552.El
553.Pp
554Add a
555.Dq Sy ~
556in front of any value to flip the order.
557.Ss Example 1: Group room members by their server first and descending localpart second
558.Bd -literal -offset indent
559[settings.sort]
560members = ["server", "~localpart"]
561.Ed
562.Sh TERMINAL
563The
564.Sy settings.terminal
565subsection allows overriding how
566.Sy iamb
567interacts with your terminal.
568.Pp
569The available fields in this subsection are:
570.Bl -tag -width Ds
571.It Sy cursor_shape
572Control the terminal cursor shape used by iamb.
573Possible values are:
574.Dq Sy default ,
575.Dq Sy block ,
576.Dq Sy line , and
577.Dq Sy underline .
578Defaults to
579.Dq Sy default .
580.It Sy enable_extended_keys
581Defines whether to explicitly enable or disable requesting extended keypresses from your terminal.
582By default, when unset,
583.Sy iamb
584will attempt to auto-detect support in your terminal and request extended keypresses from the terminal if supported.
585.It Sy enable_title
586Whether to set the title of the terminal window to
587.Dq Sy iamb (<user_id>) .
588Defaults to true.
589.El
590.It Sy indicator
591.Sh "USER OVERRIDES"
592The
593.Sy settings.users
594subsections allows overriding how specific senders are displayed.
595Overrides are mapped onto Matrix User IDs such as
596.Sy @user:matrix.org ,
597and are typically written as inline tables containing the following keys:
598.Bl -tag -width Ds
599.It Sy name
600Change the display name of the user.
601.It Sy color
602Change the color the user is shown as.
603Possible values are:
604.Dq Sy black ,
605.Dq Sy blue ,
606.Dq Sy cyan ,
607.Dq Sy dark-gray ,
608.Dq Sy gray ,
609.Dq Sy green ,
610.Dq Sy light-blue ,
611.Dq Sy light-cyan ,
612.Dq Sy light-green ,
613.Dq Sy light-magenta ,
614.Dq Sy light-red ,
615.Dq Sy light-yellow ,
616.Dq Sy magenta ,
617.Dq Sy none ,
618.Dq Sy red ,
619.Dq Sy white ,
620and
621.Dq Sy yellow .
622.El
623.Ss Example 1: Override how @ada:example.com appears in chat
624.Bd -literal -offset indent
625[settings.users]
626"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
627.Ed
628.Sh STARTUP LAYOUT
629The
630.Sy layout
631section allows configuring the initial set of tabs and windows to show when
632starting the client.
633.Bl -tag -width Ds
634.It Sy style
635Specifies what window layout to load when starting.
636Valid values are
637.Dq Sy restore
638to restore the layout from the last time the client was exited,
639.Dq Sy new
640to open a single window (uses the value of
641.Sy default_room
642if set), or
643.Dq Sy config
644to open the layout described under
645.Sy tabs .
646.It Sy tabs
647If
648.Sy style
649is set to
650.Sy config ,
651then this value will be used to open a set of tabs and windows at startup.
652Each object can contain either a
653.Sy window
654key specifying a username, room identifier or room alias to show, or a
655.Sy split
656key specifying an array of window objects.
657.El
658.Ss Example 1: Show a single room every startup
659.Bd -literal -offset indent
660[settings]
661default_room = "#iamb-users:0x.badd.cafe"
662
663[layout]
664style = "new"
665.Ed
666.Ss Example 2: Show a specific layout every startup
667.Bd -literal -offset indent
668[layout]
669style = "config"
670
671[[layout.tabs]]
672window = "iamb://dms"
673
674[[layout.tabs]]
675window = "iamb://rooms"
676
677[[layout.tabs]]
678split = [
679 { "window" = "#iamb-users:0x.badd.cafe" },
680 { "window" = "#iamb-dev:0x.badd.cafe" }
681]
682.Ed
683.Sh "CUSTOM KEYBINDINGS"
684The
685.Sy macros
686subsections allow configuring custom keybindings.
687Available subsections are:
688.Bl -tag -width Ds
689.It Sy insert , Sy i
690Map the key sequences in this section in
691.Sy Insert
692mode.
693.It Sy normal , Sy n
694Map the key sequences in this section in
695.Sy Normal
696mode.
697.It Sy visual , Sy v
698Map the key sequences in this section in
699.Sy Visual
700mode.
701.It Sy select
702Map the key sequences in this section in
703.Sy Select
704mode.
705.It Sy command , Sy c
706Map the key sequences in this section in
707.Sy Visual
708mode.
709.It Sy operator-pending
710Map the key sequences in this section in
711.Sy "Operator Pending"
712mode.
713.El
714.Pp
715Multiple modes can be given together by separating their names with
716.Dq Sy | .
717.Ss Example 1: Use "jj" to exit Insert mode
718.Bd -literal -offset indent
719[macros.insert]
720"jj" = "<Esc>"
721.Ed
722.Ss Example 2: Use "V" for switching between message bar and room history
723.Bd -literal -offset indent
724[macros."normal|visual"]
725"V" = "<C-W>m"
726.Ed
727.Sh DIRECTORIES
728Specifies the directories to save data in.
729Configured as an object under the key
730.Sy dirs .
731.Bl -tag -width Ds
732.It Sy cache
733Specifies where to store assets and temporary data in.
734(For example,
735.Sy logs
736will also go in here by default.)
737Defaults to
738.Ev $XDG_CACHE_HOME/iamb .
739.It Sy data
740Specifies where to store persistent data in, such as E2EE room keys.
741Defaults to
742.Ev $XDG_DATA_HOME/iamb .
743.It Sy downloads
744Specifies where to store downloaded files.
745Defaults to
746.Ev $XDG_DOWNLOAD_DIR .
747.It Sy logs
748Specifies where to store log files.
749Defaults to
750.Ev ${cache}/logs .
751.El
752.Sh FILES
753.Bl -tag -width Ds
754.It Pa ~/.config/iamb/config.toml
755The TOML configuration file that
756.Sy iamb
757loads by default.
758.It Pa ~/.config/iamb/config.json
759A JSON configuration file that
760.Sy iamb
761will load if the TOML one is not found.
762.It Pa /usr/share/iamb/config.example.toml
763A sample configuration file with examples of how to set different values.
764.El
765.Sh "REPORTING BUGS"
766Please report bugs in
767.Sy iamb
768or its manual pages at
769.Lk https://github.com/ulyssa/iamb/issues
770.Sh SEE ALSO
771.Xr iamb 1
772.Pp
773Extended documentation is available online at
774.Lk https://iamb.chat