docs/iamb.5

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