docs/iamb.5
661 lines · 16498 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.It Sy reaction_display
222Defines whether or not reactions should be shown.
223.It Sy reaction_shortcode_display
224Defines whether or not reactions should be shown as their respective shortcode.
225.It Sy read_receipt_send
226Defines whether or not public read confirmations are sent.
227.It Sy read_receipt_display
228Defines whether or not read confirmations are displayed.
229.It Sy request_timeout
230Defines the maximum time per request in seconds.
231.It Sy sort
232Configures how to sort the lists shown in windows like
233.Sy :rooms
234or
235.Sy :members .
236See
237.Sx "SORTING LISTS"
238for more details.
239.It Sy state_event_display
240Defines whether the state events like joined or left are shown.
241.It Sy terminal
242Subsection for configuring how specific terminal features are used (or not used).
243See
244.Sx TERMINAL
245for more details.
246.It Sy typing_notice_send
247Defines whether or not the typing state is sent.
248.It Sy typing_notice_display
249Defines whether or not the typing state is displayed.
250.It Sy user
251Overrides values for the specified user.
252See
253.Sx "USER OVERRIDES"
254for details on the format.
255.It Sy username_display
256Defines how usernames are shown for message senders.
257Possible values are
258.Dq Sy username ,
259.Dq Sy localpart ,
260or
261.Dq Sy displayname .
262.It Sy user_gutter_width
263Specify the width of the column where usernames are displayed in a room.
264Usernames that are too long are truncated.
265If this value is less than 3, the usernames are displayed in an extra line at the top of the message
266and this value is only used to indent the message.
267Defaults to 30.
268.It Sy tabstop
269Number of spaces that a <Tab> counts for.
270Defaults to 4.
271.It Sy ssl_verify
272Enable SSL verification for the HTTP requests.
273Defaults to true.
274.El
275.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
276.Bd -literal -offset indent
277[settings]
278username = "username"
279message_shortcode_display = true
280reaction_shortcode_display = true
281.Ed
282.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
283.Bd -literal -offset indent
284[settings]
285request_timeout = 120
286.Ed
287.Sh ENCRYPTION
288The
289.Sy settings.encryption
290subsection allows controlling how encrypted rooms are presented.
291.Pp
292The available fields in this subsection are:
293.Bl -tag -width Ds
294.It Sy indicator
295Defines when an encryption status indicator is shown.
296Possible values are:
297.Dq Sy enabled
298(default, always indicate status),
299.Dq Sy disabled
300(never indicate status),
301.Dq Sy only-unencrypted ,
302and
303.Dq Sy only-encrypted .
304.It Sy indicator_location
305Defines where the encryption status indicator is shown when relevant.
306Possible values are:
307.Dq Sy title ,
308and
309.Dq Sy prompt
310(the default).
311Both can be used via
312.Dq Sy title|prompt .
313.El
314.Sh MOUSE
315The
316.Sy settings.mouse
317subsection allows enabling mouse support.
318Currently the only difference is that scrolling moves the window view instead of changing the selection.
319.Pp
320The available fields in this subsection are:
321.Bl -tag -width Ds
322.It Sy enabled
323Defaults to
324.Sy false .
325Setting this field to
326.Sy true
327enables mouse support.
328.El
329.Sh NOTIFICATIONS
330The
331.Sy settings.notifications
332subsection allows configuring how notifications for new messages behave.
333.Pp
334The available fields in this subsection are:
335.Bl -tag -width Ds
336.It Sy enabled
337Defaults to
338.Sy false .
339Setting this field to
340.Sy true
341enables notifications.
342.It Sy via
343Defaults to
344.Dq Sy desktop
345to use the desktop mechanism (default).
346Setting this field to
347.Dq Sy bell
348will use the terminal bell instead.
349Both can be used via
350.Dq Sy desktop|bell .
351.It Sy show_message
352controls whether to show the message in the desktop notification, and defaults to
353.Sy true .
354Messages are truncated beyond a small length.
355The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
356In other words, you can simply change the rules with another client.
357.It Sy sound_hint
358Controls the notification sound name that is passed as a hint to the notification daemon.
359.El
360.Ss Example 1: Enable notifications with default options
361.Bd -literal -offset indent
362[settings.notifications]
363enabled = true
364.Ed
365.Ss Example 2: Enable notifications using terminal bell
366.Bd -literal -offset indent
367[settings.notifications]
368enabled = true
369via = "bell"
370show_message = false
371.Ed
372.Ss Example 3: Enable notifications using the instant message sound
373.Bd -literal -offset indent
374[settings.notifications]
375enabled = true
376sound_hint = "message-new-instant" # Linux
377sound_hint = "IM" # Windows
378.Ed
379.Sh "SORTING LISTS"
380The
381.Sy settings.sort
382subsection allows configuring how different windows have their contents sorted.
383.Pp
384Fields available within this subsection are:
385.Bl -tag -width Ds
386.It Sy rooms
387How to sort the
388.Sy :rooms
389window.
390Defaults to
391.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
392.It Sy chats
393How to sort the
394.Sy :chats
395window.
396Defaults to the
397.Sy rooms
398value.
399.It Sy dms
400How to sort the
401.Sy :dms
402window.
403Defaults to the
404.Sy rooms
405value.
406.It Sy spaces
407How to sort the
408.Sy :spaces
409window.
410Defaults to the
411.Sy rooms
412value.
413.It Sy members
414How to sort the
415.Sy :members
416window.
417Defaults to
418.Sy ["power",\ "id"] .
419.El
420.Pp
421The available values are:
422.Bl -tag -width Ds
423.It Sy favorite
424Put favorite rooms before other rooms.
425.It Sy lowpriority
426Put lowpriority rooms after other rooms.
427.It Sy name
428Sort rooms by alphabetically ascending room name.
429.It Sy alias
430Sort rooms by alphabetically ascending canonical room alias.
431.It Sy id
432Sort rooms by alphabetically ascending Matrix room identifier.
433.It Sy unread
434Put unread rooms before other rooms.
435.It Sy recent
436Sort rooms by most recent message timestamp.
437.It Sy invite
438Put invites before other rooms.
439.El
440.Pp
441Add a
442.Dq Sy ~
443in front of any value to flip the order.
444.Ss Example 1: Group room members by their server first and descending localpart second
445.Bd -literal -offset indent
446[settings.sort]
447members = ["server", "~localpart"]
448.Ed
449.Sh TERMINAL
450The
451.Sy settings.terminal
452subsection allows overriding how
453.Sy iamb
454interacts with your terminal.
455.Pp
456The available fields in this subsection are:
457.Bl -tag -width Ds
458.It Sy cursor_shape
459Control the terminal cursor shape used by iamb.
460Possible values are:
461.Dq Sy default ,
462.Dq Sy block ,
463.Dq Sy line , and
464.Dq Sy underline .
465Defaults to
466.Dq Sy default .
467.It Sy enable_extended_keys
468Defines whether to explicitly enable or disable requesting extended keypresses from your terminal.
469By default, when unset,
470.Sy iamb
471will attempt to auto-detect support in your terminal and request extended keypresses from the terminal if supported.
472.It Sy enable_title
473Whether to set the title of the terminal window to
474.Dq Sy iamb (<user_id>) .
475Defaults to true.
476.El
477.It Sy indicator
478.Sh "USER OVERRIDES"
479The
480.Sy settings.users
481subsections allows overriding how specific senders are displayed.
482Overrides are mapped onto Matrix User IDs such as
483.Sy @user:matrix.org ,
484and are typically written as inline tables containing the following keys:
485.Bl -tag -width Ds
486.It Sy name
487Change the display name of the user.
488.It Sy color
489Change the color the user is shown as.
490Possible values are:
491.Dq Sy black ,
492.Dq Sy blue ,
493.Dq Sy cyan ,
494.Dq Sy dark-gray ,
495.Dq Sy gray ,
496.Dq Sy green ,
497.Dq Sy light-blue ,
498.Dq Sy light-cyan ,
499.Dq Sy light-green ,
500.Dq Sy light-magenta ,
501.Dq Sy light-red ,
502.Dq Sy light-yellow ,
503.Dq Sy magenta ,
504.Dq Sy none ,
505.Dq Sy red ,
506.Dq Sy white ,
507and
508.Dq Sy yellow .
509.El
510.Ss Example 1: Override how @ada:example.com appears in chat
511.Bd -literal -offset indent
512[settings.users]
513"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
514.Ed
515.Sh STARTUP LAYOUT
516The
517.Sy layout
518section allows configuring the initial set of tabs and windows to show when
519starting the client.
520.Bl -tag -width Ds
521.It Sy style
522Specifies what window layout to load when starting.
523Valid values are
524.Dq Sy restore
525to restore the layout from the last time the client was exited,
526.Dq Sy new
527to open a single window (uses the value of
528.Sy default_room
529if set), or
530.Dq Sy config
531to open the layout described under
532.Sy tabs .
533.It Sy tabs
534If
535.Sy style
536is set to
537.Sy config ,
538then this value will be used to open a set of tabs and windows at startup.
539Each object can contain either a
540.Sy window
541key specifying a username, room identifier or room alias to show, or a
542.Sy split
543key specifying an array of window objects.
544.El
545.Ss Example 1: Show a single room every startup
546.Bd -literal -offset indent
547[settings]
548default_room = "#iamb-users:0x.badd.cafe"
549
550[layout]
551style = "new"
552.Ed
553.Ss Example 2: Show a specific layout every startup
554.Bd -literal -offset indent
555[layout]
556style = "config"
557
558[[layout.tabs]]
559window = "iamb://dms"
560
561[[layout.tabs]]
562window = "iamb://rooms"
563
564[[layout.tabs]]
565split = [
566 { "window" = "#iamb-users:0x.badd.cafe" },
567 { "window" = "#iamb-dev:0x.badd.cafe" }
568]
569.Ed
570.Sh "CUSTOM KEYBINDINGS"
571The
572.Sy macros
573subsections allow configuring custom keybindings.
574Available subsections are:
575.Bl -tag -width Ds
576.It Sy insert , Sy i
577Map the key sequences in this section in
578.Sy Insert
579mode.
580.It Sy normal , Sy n
581Map the key sequences in this section in
582.Sy Normal
583mode.
584.It Sy visual , Sy v
585Map the key sequences in this section in
586.Sy Visual
587mode.
588.It Sy select
589Map the key sequences in this section in
590.Sy Select
591mode.
592.It Sy command , Sy c
593Map the key sequences in this section in
594.Sy Visual
595mode.
596.It Sy operator-pending
597Map the key sequences in this section in
598.Sy "Operator Pending"
599mode.
600.El
601.Pp
602Multiple modes can be given together by separating their names with
603.Dq Sy | .
604.Ss Example 1: Use "jj" to exit Insert mode
605.Bd -literal -offset indent
606[macros.insert]
607"jj" = "<Esc>"
608.Ed
609.Ss Example 2: Use "V" for switching between message bar and room history
610.Bd -literal -offset indent
611[macros."normal|visual"]
612"V" = "<C-W>m"
613.Ed
614.Sh DIRECTORIES
615Specifies the directories to save data in.
616Configured as an object under the key
617.Sy dirs .
618.Bl -tag -width Ds
619.It Sy cache
620Specifies where to store assets and temporary data in.
621(For example,
622.Sy logs
623will also go in here by default.)
624Defaults to
625.Ev $XDG_CACHE_HOME/iamb .
626.It Sy data
627Specifies where to store persistent data in, such as E2EE room keys.
628Defaults to
629.Ev $XDG_DATA_HOME/iamb .
630.It Sy downloads
631Specifies where to store downloaded files.
632Defaults to
633.Ev $XDG_DOWNLOAD_DIR .
634.It Sy logs
635Specifies where to store log files.
636Defaults to
637.Ev ${cache}/logs .
638.El
639.Sh FILES
640.Bl -tag -width Ds
641.It Pa ~/.config/iamb/config.toml
642The TOML configuration file that
643.Sy iamb
644loads by default.
645.It Pa ~/.config/iamb/config.json
646A JSON configuration file that
647.Sy iamb
648will load if the TOML one is not found.
649.It Pa /usr/share/iamb/config.example.toml
650A sample configuration file with examples of how to set different values.
651.El
652.Sh "REPORTING BUGS"
653Please report bugs in
654.Sy iamb
655or its manual pages at
656.Lk https://github.com/ulyssa/iamb/issues
657.Sh SEE ALSO
658.Xr iamb 1
659.Pp
660Extended documentation is available online at
661.Lk https://iamb.chat