docs/iamb.5

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