docs/iamb.5

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