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