Commit 6600685dd5

6600685dd55ab2a374896526503f60a4f3c07b82

parent: ed1b88c197

Unregistered key

Ulyssa <git@ulyssa.dev> · 2024-03-26 15:55 UTC
committer: <noreply@github.com>

Update manual pages to use mdoc(7) and list commands (#230)

Layout: unified · split

.gitignore −1
@@ -1,5 +1,4 @@
1/target 1/target
2/result 2/result
3/TODO 3/TODO
4/docs/iamb.[15]
5.direnv 4.direnv
Cargo.lock +2 −40
@@ -1110,12 +1110,6 @@ version = "0.4.4"
1110source = "registry+https://github.com/rust-lang/crates.io-index" 1110source = "registry+https://github.com/rust-lang/crates.io-index"
1111checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43" 1111checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43"
1112 1112
1113[[package]]
1114name = "deunicode"
1115version = "1.4.0"
1116source = "registry+https://github.com/rust-lang/crates.io-index"
1117checksum = "890d779e1bc371e4fa7727ef6d29a9346be20ddfe40cd8c744cd083ce0640b15"
1118
1119[[package]] 1113[[package]]
1120name = "diff" 1114name = "diff"
1121version = "0.1.13" 1115version = "0.1.13"
@@ -1704,15 +1698,6 @@ dependencies = [
1704 "windows-targets 0.48.5", 1698 "windows-targets 0.48.5",
1705] 1699]
1706 1700
1707[[package]]
1708name = "getopts"
1709version = "0.2.21"
1710source = "registry+https://github.com/rust-lang/crates.io-index"
1711checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
1712dependencies = [
1713 "unicode-width",
1714]
1715
1716[[package]] 1701[[package]]
1717name = "getrandom" 1702name = "getrandom"
1718version = "0.2.12" 1703version = "0.2.12"
@@ -1966,7 +1951,7 @@ dependencies = [
1966 1951
1967[[package]] 1952[[package]]
1968name = "iamb" 1953name = "iamb"
1969version = "0.0.9-alpha.1" 1954version = "0.0.9"
1970dependencies = [ 1955dependencies = [
1971 "arboard", 1956 "arboard",
1972 "bitflags 2.4.2", 1957 "bitflags 2.4.2",
@@ -1983,7 +1968,6 @@ dependencies = [
1983 "image", 1968 "image",
1984 "lazy_static 1.4.0", 1969 "lazy_static 1.4.0",
1985 "libc", 1970 "libc",
1986 "mandown",
1987 "markup5ever_rcdom", 1971 "markup5ever_rcdom",
1988 "matrix-sdk", 1972 "matrix-sdk",
1989 "mime", 1973 "mime",
@@ -2470,16 +2454,6 @@ dependencies = [
2470 "libc", 2454 "libc",
2471] 2455]
2472 2456
2473[[package]]
2474name = "mandown"
2475version = "0.1.3"
2476source = "registry+https://github.com/rust-lang/crates.io-index"
2477checksum = "12243a468e9660b178540f73c43bdc544d64bd3cde749de0bd851e0dbacfd683"
2478dependencies = [
2479 "deunicode 1.4.0",
2480 "pulldown-cmark",
2481]
2482
2483[[package]] 2457[[package]]
2484name = "maplit" 2458name = "maplit"
2485version = "1.0.2" 2459version = "1.0.2"
@@ -3480,18 +3454,6 @@ dependencies = [
3480 "syn 2.0.52", 3454 "syn 2.0.52",
3481] 3455]
3482 3456
3483[[package]]
3484name = "pulldown-cmark"
3485version = "0.9.3"
3486source = "registry+https://github.com/rust-lang/crates.io-index"
3487checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998"
3488dependencies = [
3489 "bitflags 1.3.2",
3490 "getopts",
3491 "memchr",
3492 "unicase",
3493]
3494
3495[[package]] 3457[[package]]
3496name = "qoi" 3458name = "qoi"
3497version = "0.4.1" 3459version = "0.4.1"
@@ -4317,7 +4279,7 @@ version = "0.1.4"
4317source = "registry+https://github.com/rust-lang/crates.io-index" 4279source = "registry+https://github.com/rust-lang/crates.io-index"
4318checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" 4280checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373"
4319dependencies = [ 4281dependencies = [
4320 "deunicode 0.4.4", 4282 "deunicode",
4321] 4283]
4322 4284
4323[[package]] 4285[[package]]
Cargo.toml +1 −4
@@ -1,6 +1,6 @@
1[package] 1[package]
2name = "iamb" 2name = "iamb"
3version = "0.0.9-alpha.1" 3version = "0.0.9"
4edition = "2018" 4edition = "2018"
5authors = ["Ulyssa <git@ulyssa.dev>"] 5authors = ["Ulyssa <git@ulyssa.dev>"]
6repository = "https://github.com/ulyssa/iamb" 6repository = "https://github.com/ulyssa/iamb"
@@ -20,9 +20,6 @@ bundled = ["matrix-sdk/bundled-sqlite", "rustls-tls"]
20native-tls = ["matrix-sdk/native-tls"] 20native-tls = ["matrix-sdk/native-tls"]
21rustls-tls = ["matrix-sdk/rustls-tls"] 21rustls-tls = ["matrix-sdk/rustls-tls"]
22 22
23[build-dependencies]
24mandown = "0.1.3"
25
26[build-dependencies.vergen] 23[build-dependencies.vergen]
27version = "8" 24version = "8"
28default-features = false 25default-features = false
PACKAGING.md +11
@@ -23,5 +23,16 @@ enable it when building:
23Note that this [can fail][ring-lto] in some build environments if both Clang 23Note that this [can fail][ring-lto] in some build environments if both Clang
24and GCC are present. 24and GCC are present.
25 25
26## Documentation
27
28In addition to the compiled binary, there are other files in the repo that
29you'll want to install as part of a package:
30
31| Repository Path | Installed Path (may vary per OS) |
32| -------------------- | ----------------------------------- |
33| /config.example.toml | /usr/share/iamb/config.example.toml |
34| /docs/iamb.1 | /usr/share/man/man1/iamb.1 |
35| /docs/iamb.5 | /usr/share/man/man5/iamb.5 |
36
26[ring-lto]: https://github.com/briansmith/ring/issues/1444 37[ring-lto]: https://github.com/briansmith/ring/issues/1444
27[rustls]: https://crates.io/crates/rustls 38[rustls]: https://crates.io/crates/rustls
build.rs −20
@@ -1,29 +1,9 @@
1use std::error::Error; 1use std::error::Error;
2use std::fs;
3use std::iter::FromIterator;
4use std::path::PathBuf;
5 2
6use mandown::convert;
7use vergen::EmitBuilder; 3use vergen::EmitBuilder;
8 4
9const IAMB_1_MD: &str = include_str!("docs/iamb.1.md");
10const IAMB_5_MD: &str = include_str!("docs/iamb.5.md");
11
12fn main() -> Result<(), Box<dyn Error>> { 5fn main() -> Result<(), Box<dyn Error>> {
13 EmitBuilder::builder().git_sha(true).emit()?; 6 EmitBuilder::builder().git_sha(true).emit()?;
14 7
15 // Build the manual pages.
16 println!("cargo:rerun-if-changed=docs/iamb.1.md");
17 println!("cargo:rerun-if-changed=docs/iamb.5.md");
18
19 let iamb_1 = convert(IAMB_1_MD, "IAMB", 1);
20 let iamb_5 = convert(IAMB_5_MD, "IAMB", 5);
21
22 let out_dir = std::env::var("OUT_DIR");
23 let out_dir = out_dir.as_deref().unwrap_or("docs");
24
25 fs::write(PathBuf::from_iter([out_dir, "iamb.1"]), iamb_1.as_bytes())?;
26 fs::write(PathBuf::from_iter([out_dir, "iamb.5"]), iamb_5.as_bytes())?;
27
28 Ok(()) 8 Ok(())
29} 9}
config.example.toml +13 −1
@@ -31,7 +31,19 @@ members = ["power", "id"]
31"@user:matrix.org" = { "name" = "John Doe", "color" = "magenta" } 31"@user:matrix.org" = { "name" = "John Doe", "color" = "magenta" }
32 32
33[layout] 33[layout]
34style = "restore" 34style = "config"
35
36[[layout.tabs]]
37window = "iamb://dms"
38
39[[layout.tabs]]
40window = "iamb://rooms"
41
42[[layout.tabs]]
43split = [
44 { "window" = "#iamb-users:0x.badd.cafe" },
45 { "window" = "#iamb-dev:0x.badd.cafe" }
46]
35 47
36[macros.insert] 48[macros.insert]
37"jj" = "<Esc>" 49"jj" = "<Esc>"
docs/iamb.1 added +196
@@ -0,0 +1,196 @@
1.\" iamb(1) 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.1
8.Dd Mar 24, 2024
9.Dt IAMB 1
10.Os
11.Sh NAME
12.Nm iamb
13.Nd a terminal-based client for Matrix for the Vim addict
14.Sh SYNOPSIS
15.Nm
16.Op Fl hV
17.Op Fl P Ar profile
18.Op Fl C Ar dir
19.Sh DESCRIPTION
20.Nm
21is a client for the Matrix communication protocol.
22It provides a terminal user interface with familiar Vim keybindings, and
23includes support for multiple profiles, threads, spaces, notifications,
24reactions, custom keybindings, and more.
25.Pp
26This manual page includes a quick rundown of the available commands in
27.Nm .
28For example usage and a full description of each one and its arguments, please
29refer to the full documentation online.
30.Sh OPTIONS
31.Bl -tag -width Ds
32.It Fl P , Fl Fl profile
33The profile to start
34.Nm
35with.
36If this flag is not specified,
37then it defaults to using
38.Sy default_profile
39(see
40.Xr iamb 5 ) .
41.It Fl C , Fl Fl config-directory
42Path to the directory the configuration file is located in.
43.It Fl h , Fl Fl help
44Show the help text and quit.
45.It Fl V , Fl Fl version
46Show the current
47.Nm
48version and quit.
49.El
50
51.Sh "GENERAL COMMANDS"
52.Bl -tag -width Ds
53.It Sy ":chats"
54View a list of joined rooms and direct messages.
55.It Sy ":dms"
56View a list of direct messages.
57.It Sy ":logout"
58Log out of
59.Nm .
60.It Sy ":rooms"
61View a list of joined rooms.
62.It Sy ":spaces"
63View a list of joined spaces.
64.It Sy ":verify"
65View a list of ongoing E2EE verifications.
66.It Sy ":welcome"
67View the startup Welcome window.
68.El
69
70.Sh "MESSAGE COMMANDS"
71.Bl -tag -width Ds
72.It Sy ":download"
73Download an attachment from the selected message.
74.It Sy ":edit"
75Edit the selected message.
76.It Sy ":editor"
77Open an external
78.Ev $EDITOR
79to compose a message.
80.It Sy ":open"
81Download and then open an attachment, or open a link in a message.
82.It Sy ":react [shortcode]"
83React to the selected message with an Emoji.
84.It Sy ":redact [reason]"
85Redact the selected message.
86.It Sy ":reply"
87Reply to the selected message.
88.It Sy ":unreact [shortcode]"
89Remove your reaction from the selected message.
90When no arguments are given, remove all of your reactions from the message.
91.It Sy ":upload"
92Upload an attachment and send it to the currently selected room.
93.El
94
95.Sh "ROOM COMMANDS"
96.Bl -tag -width Ds
97.It Sy ":create"
98Create a new room.
99.It Sy ":invite accept"
100Accept an invitation to the currently focused room.
101.It Sy ":invite reject"
102Reject an invitation to the currently focused room.
103.It Sy ":invite send [user]"
104Send an invitation to a user to join the currently focused room.
105.It Sy ":join [room]"
106Join a room.
107.It Sy ":leave"
108Leave the currently focused room.
109.It Sy ":members"
110View a list of members of the currently focused room.
111.It Sy ":room name set [name]"
112Set the name of the currently focused room.
113.It Sy ":room name unset"
114Unset the name of the currently focused room.
115.It Sy ":room tag set [tag]"
116Add a tag to the currently focused room.
117.It Sy ":room tag unset [tag]"
118Remove a tag from the currently focused room.
119.It Sy ":room topic set [topic]"
120Set the topic of the currently focused room.
121.It Sy ":room topic unset"
122Unset the topic of the currently focused room.
123.El
124
125.Sh "WINDOW COMMANDS"
126.Bl -tag -width Ds
127.It Sy ":horizontal [cmd]"
128Change the behaviour of the given command to be horizontal.
129.It Sy ":leftabove [cmd]"
130Change the behaviour of the given command to open before the current window.
131.It Sy ":only" , Sy ":on"
132Quit all but one window in the current tab.
133.It Sy ":quit" , Sy ":q"
134Quit a window.
135.It Sy ":quitall" , Sy ":qa"
136Quit all windows in the current tab.
137.It Sy ":resize"
138Resize a window.
139.It Sy ":rightbelow [cmd]"
140Change the behaviour of the given command to open after the current window.
141.It Sy ":split" , Sy ":sp"
142Horizontally split a window.
143.It Sy ":vertical [cmd]"
144Change the layout of the following command to be vertical.
145.It Sy ":vsplit" , Sy ":vsp"
146Vertically split a window.
147.El
148
149.Sh "TAB COMMANDS"
150.Bl -tag -width Ds
151.It Sy ":tab [cmd]"
152Run a command that opens a window in a new tab.
153.It Sy ":tabclose" , Sy ":tabc"
154Close a tab.
155.It Sy ":tabedit [room]" , Sy ":tabe"
156Open a room in a new tab.
157.It Sy ":tabrewind" , Sy ":tabr"
158Go to the first tab.
159.It Sy ":tablast" , Sy ":tabl"
160Go to the last tab.
161.It Sy ":tabnext" , Sy ":tabn"
162Go to the next tab.
163.It Sy ":tabonly" , Sy ":tabo"
164Close all but one tab.
165.It Sy ":tabprevious" , Sy ":tabp"
166Go to the preview tab.
167.El
168
169.Sh EXAMPLES
170.Ss Example 1: Starting with a specific profile
171To start with a profile named
172.Sy personal
173instead of the
174.Sy default_profile
175value:
176.Bd -literal -offset indent
177$ iamb -P personal
178.Ed
179.Ss Example 2: Using an alternate configuration directory
180By default,
181.Nm
182will use the XDG directories, but you may sometimes want to store
183your configuration elsewhere.
184.Bd -literal -offset indent
185$ iamb -C ~/src/iamb-dev/dev-config/
186.Ed
187.Sh "REPORTING BUGS"
188Please report bugs in
189.Nm
190or its manual pages at
191.Lk https://github.com/ulyssa/iamb/issues
192.Sh "SEE ALSO"
193.Xr iamb 5
194.Pp
195Extended documentation is available online at
196.Lk https://iamb.chat
docs/iamb.1.md deleted −29
@@ -1,29 +0,0 @@
1# NAME
2
3iamb – a terminal-based client for Matrix for the Vim addict
4
5# SYNOPSIS
6
7**iamb** [**--profile** _profile_] [**--config-directory** _directory_] [**--help** | **--version**]
8
9# OPTIONS
10
11These options are primitives at the top-level of the file.
12
13**--profile**, **-P**
14> The profile to start with. Overrides **default_profile** from **iamb(5)**.
15
16**--config-directory**, **-C**
17> Path to the directory the configuration file is located in.
18
19**--help**, **-h**
20> Show a short help text and quit.
21
22**--version**, **-V**
23> Show the iamb version and quit.
24
25# SEE ALSO
26
27**iamb(5)**
28
29Full documentation is available online at \<https://iamb.chat\>
docs/iamb.5 added +555
@@ -0,0 +1,555 @@
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.1
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 url
79The URL of the user's server.
80(For example "https://matrix.org" for "@user:matrix.org".)
81This is only needed when the server does not have a
82.Pa /.well-known/matrix/client
83entry.
84.El
85.Pp
86In addition to the above fields, you can also reuse the following fields to set
87per-profile overrides of their global values:
88.Bl -bullet -offset indent -width 1m
89.It
90.Sy dirs
91.It
92.Sy layout
93.It
94.Sy macros
95.It
96.Sy settings
97.El
98.Ss Example 1: A single profile
99.Bd -literal -offset indent
100[profiles.personal]
101user_id = "@user:matrix.org"
102.Ed
103.Ss Example 2: Two profiles with a default
104In the following example, there are two profiles,
105.Dq personal
106(set to be the default) and
107.Dq work .
108The
109.Dq work
110profile has an explicit URL set for its homeserver.
111.Bd -literal -offset indent
112default_profile = "personal"
113
114[profiles.personal]
115user_id = "@user:matrix.org"
116
117[profiles.work]
118user_id = "@user:example.com"
119url = "https://matrix.example.com"
120.Ed
121.Sh SETTINGS
122These options are configured as an object under the
123.Sy settings
124key and can be overridden as described in
125.Sx PROFILES .
126.Bl -tag -width Ds
127
128.It Sy default_room
129The room to show by default instead of the
130.Sy :welcome
131window.
132
133.It Sy image_preview
134Enable image previews and configure it.
135An empty object will enable the feature with default settings, omitting it will disable the feature.
136The available fields in this object are:
137.Bl -tag -width Ds
138.It Sy size
139An optional object with
140.Sy width
141and
142.Sy height
143fields to specify the preview size in cells.
144Defaults to 66 and 10.
145.It Sy protocol
146An optional object to override settings that will normally be guessed automatically:
147.Bl -tag -width Ds
148.It Sy type
149An optional string set to one of the protocol types:
150.Dq Sy sixel ,
151.Dq Sy kitty , and
152.Dq Sy halfblocks .
153.It Sy font_size
154An optional list of two numbers representing font width and height in pixels.
155.El
156.El
157.It Sy log_level
158Specifies the lowest log level that should be shown.
159Possible values are:
160.Dq Sy trace ,
161.Dq Sy debug ,
162.Dq Sy info ,
163.Dq Sy warn , and
164.Dq Sy error .
165
166.It Sy message_shortcode_display
167Defines whether or not Emoji characters in messages should be replaced by their
168respective shortcodes.
169
170.It Sy message_user_color
171Defines whether or not the message body is colored like the username.
172
173.It Sy notifications
174When this subsection is present, you can enable and configure push notifications.
175See
176.Sx NOTIFICATIONS
177for more details.
178
179.It Sy open_command
180Defines a custom command and its arguments to run when opening downloads instead of the default.
181(For example,
182.Sy ["my-open",\ "--file"] . )
183
184.It Sy reaction_display
185Defines whether or not reactions should be shown.
186
187.It Sy reaction_shortcode_display
188Defines whether or not reactions should be shown as their respective shortcode.
189
190.It Sy read_receipt_send
191Defines whether or not read confirmations are sent.
192
193.It Sy read_receipt_display
194Defines whether or not read confirmations are displayed.
195
196.It Sy request_timeout
197Defines the maximum time per request in seconds.
198
199.It Sy sort
200Configures how to sort the lists shown in windows like
201.Sy :rooms
202or
203.Sy :members .
204See
205.Sx "SORTING LISTS"
206for more details.
207
208.It Sy typing_notice_send
209Defines whether or not the typing state is sent.
210
211.It Sy typing_notice_display
212Defines whether or not the typing state is displayed.
213
214.It Sy user
215Overrides values for the specified user.
216See
217.Sx "USER OVERRIDES"
218for details on the format.
219
220.It Sy username_display
221Defines how usernames are shown for message senders.
222Possible values are
223.Dq Sy username ,
224.Dq Sy localpart , or
225.Dq Sy displayname .
226
227.It Sy user_gutter_width
228Specify the width of the column where usernames are displayed in a room.
229Usernames that are too long are truncated.
230Defaults to 30.
231.El
232
233.Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)
234.Bd -literal -offset indent
235[settings]
236username = "username"
237message_shortcode_display = true
238reaction_shortcode_display = true
239.Ed
240
241.Ss Example 2: Increase request timeout to 2 minutes for a slow homeserver
242.Bd -literal -offset indent
243[settings]
244request_timeout = 120
245.Ed
246
247.Sh NOTIFICATIONS
248
249The
250.Sy settings.notifications
251subsection allows configuring how notifications for new messages behave.
252
253The available fields in this subsection are:
254.Bl -tag -width Ds
255.It Sy enabled
256Defaults to
257.Sy false .
258Setting this field to
259.Sy true
260enables notifications.
261
262.It Sy via
263Defaults to
264.Dq Sy desktop
265to use the desktop mechanism (default).
266Setting this field to
267.Dq Sy bell
268will use the terminal bell instead.
269
270.It Sy show_message
271controls whether to show the message in the desktop notification, and defaults to
272.Sy true .
273Messages are truncated beyond a small length.
274The notification rules are stored server side, loaded once at startup, and are currently not configurable in iamb.
275In other words, you can simply change the rules with another client.
276.El
277
278.Ss Example 1: Enable notifications with default options
279.Bd -literal -offset indent
280[settings]
281notifications = {}
282.Ed
283.Ss Example 2: Enable notifications using terminal bell
284.Bd -literal -offset indent
285[settings.notifications]
286via = "bell"
287show_message = false
288.Ed
289
290.Sh "SORTING LISTS"
291
292The
293.Sy settings.sort
294subsection allows configuring how different windows have their contents sorted.
295
296Fields available within this subsection are:
297.Bl -tag -width Ds
298.It Sy rooms
299How to sort the
300.Sy :rooms
301window.
302Defaults to
303.Sy ["favorite",\ "lowpriority",\ "unread",\ "name"] .
304.It Sy chats
305How to sort the
306.Sy :chats
307window.
308Defaults to the
309.Sy rooms
310value.
311.It Sy dms
312How to sort the
313.Sy :dms
314window.
315Defaults to the
316.Sy rooms
317value.
318.It Sy spaces
319How to sort the
320.Sy :spaces
321window.
322Defaults to the
323.Sy rooms
324value.
325.It Sy members
326How to sort the
327.Sy :members
328window.
329Defaults to
330.Sy ["power",\ "id"] .
331.El
332.El
333
334.Ss Example 1: Group room members by ther server first
335.Bd -literal -offset indent
336[settings.sort]
337members = ["server", "localpart"]
338.Ed
339
340.Sh "USER OVERRIDES"
341
342The
343.Sy settings.users
344subsections allows overriding how specific senders are displayed.
345Overrides are mapped onto Matrix User IDs such as
346.Sy @user:matrix.org ,
347and are typically written as inline tables containing the following keys:
348
349.Bl -tag -width Ds
350.It Sy name
351Change the display name of the user.
352
353.It Sy color
354Change the color the user is shown as.
355Possible values are:
356.Dq Sy black ,
357.Dq Sy blue ,
358.Dq Sy cyan ,
359.Dq Sy dark-gray ,
360.Dq Sy gray ,
361.Dq Sy green ,
362.Dq Sy light-blue ,
363.Dq Sy light-cyan ,
364.Dq Sy light-green ,
365.Dq Sy light-magenta ,
366.Dq Sy light-red ,
367.Dq Sy light-yellow ,
368.Dq Sy magenta ,
369.Dq Sy none ,
370.Dq Sy red ,
371.Dq Sy white ,
372and
373.Dq Sy yellow .
374.El
375
376.Ss Example 1: Override how @ada:example.com appears in chat
377.Bd -literal -offset indent
378[settings.users]
379"@ada:example.com" = { name = "Ada Lovelace", color = "light-red" }
380.Ed
381
382.Sh STARTUP LAYOUT
383
384The
385.Sy layout
386section allows configuring the initial set of tabs and windows to show when
387starting the client.
388
389.Bl -tag -width Ds
390.It Sy style
391Specifies what window layout to load when starting.
392Valid values are
393.Dq Sy restore
394to restore the layout from the last time the client was exited,
395.Dq Sy new
396to open a single window (uses the value of
397.Sy default_room
398if set), or
399.Dq Sy config
400to open the layout described under
401.Sy tabs .
402
403.It Sy tabs
404If
405.Sy style
406is set to
407.Sy config ,
408then this value will be used to open a set of tabs and windows at startup.
409Each object can contain either a
410.Sy window
411key specifying a username, room identifier or room alias to show, or a
412.Sy split
413key specifying an array of window objects.
414.El
415
416.Ss Example 1: Show a single room every startup
417.Bd -literal -offset indent
418[settings]
419default_room = "#iamb-users:0x.badd.cafe"
420
421[layout]
422style = "new"
423.Ed
424.Ss Example 2: Show a specific layout every startup
425.Bd -literal -offset indent
426[layout]
427style = "config"
428
429[[layout.tabs]]
430window = "iamb://dms"
431
432[[layout.tabs]]
433window = "iamb://rooms"
434
435[[layout.tabs]]
436split = [
437 { "window" = "#iamb-users:0x.badd.cafe" },
438 { "window" = "#iamb-dev:0x.badd.cafe" }
439]
440.Ed
441
442.Sh "CUSTOM KEYBINDINGS"
443
444The
445.Sy macros
446subsections allow configuring custom keybindings.
447Available subsections are:
448
449.Bl -tag -width Ds
450.It Sy insert , Sy i
451Map the key sequences in this section in
452.Sy Insert
453mode.
454
455.It Sy normal , Sy n
456Map the key sequences in this section in
457.Sy Normal
458mode.
459
460.It Sy visual , Sy v
461Map the key sequences in this section in
462.Sy Visual
463mode.
464
465.It Sy select
466Map the key sequences in this section in
467.Sy Select
468mode.
469
470.It Sy command , Sy c
471Map the key sequences in this section in
472.Sy Visual
473mode.
474
475.It Sy operator-pending
476Map the key sequences in this section in
477.Sy "Operator Pending"
478mode.
479.El
480
481Multiple modes can be given together by separating their names with
482.Dq Sy | .
483
484.Ss Example 1: Use "jj" to exit Insert mode
485.Bd -literal -offset indent
486[macros.insert]
487"jj" = "<Esc>"
488.Ed
489
490.Ss Example 2: Use "V" for switching between message bar and room history
491.Bd -literal -offset indent
492[macros."normal|visual"]
493"V" = "<C-W>m"
494.Ed
495
496.Sh DIRECTORIES
497
498Specifies the directories to save data in.
499Configured as an object under the key
500.Sy dirs .
501
502.Bl -tag -width Ds
503.It Sy cache
504Specifies where to store assets and temporary data in.
505(For example,
506.Sy image_preview
507and
508.Sy logs
509will also go in here by default.)
510Defaults to
511.Ev $XDG_CACHE_HOME/iamb .
512
513.It Sy data
514Specifies where to store persistent data in, such as E2EE room keys.
515Defaults to
516.Ev $XDG_DATA_HOME/iamb .
517
518.It Sy downloads
519Specifies where to store downloaded files.
520Defaults to
521.Ev $XDG_DOWNLOAD_DIR .
522
523.It Sy image_previews
524Specifies where to store automatically downloaded image previews.
525Defaults to
526.Ev ${cache}/image_preview_downloads .
527
528.It Sy logs
529Specifies where to store log files.
530Defaults to
531.Ev ${cache}/logs .
532.El
533.Sh FILES
534.Bl -tag -width Ds
535.It Pa ~/.config/iamb/config.toml
536The TOML configuration file that
537.Sy iamb
538loads by default.
539.It Pa ~/.config/iamb/config.json
540A JSON configuration file that
541.Sy iamb
542will load if the TOML one is not found.
543.It Pa /usr/share/iamb/config.example.toml
544A sample configuration file with examples of how to set different values.
545.El
546.Sh "REPORTING BUGS"
547Please report bugs in
548.Sy iamb
549or its manual pages at
550.Lk https://github.com/ulyssa/iamb/issues
551.Sh SEE ALSO
552.Xr iamb 1
553.Pp
554Extended documentation is available online at
555.Lk https://iamb.chat
docs/iamb.5.md deleted −171
@@ -1,171 +0,0 @@
1# NAME
2
3config.json – configuration file for iamb
4
5# SYNOPSIS
6
7Configuration must be placed under _~/.config/iamb/_ and is named config.json.
8
9Example configuration usually comes bundled with your installation and can
10typically be found in _/usr/share/iamb_.
11
12As implied by the filename, the configuration is formatted in JSON. It's
13structure and fields are described below.
14
15# BASIC SETTINGS
16
17These options are primitives at the top-level of the file.
18
19**default_profile** (type: string)
20> The default profile to connect to, unless overwritten by a commandline
21> switch. It has to be defined in the *PROFILES* section.
22
23# PROFILES
24
25These options are configured as a map under the profiles name.
26
27**user_id** (type: string)
28> The user ID to use when connecting to the server. For example "user" for
29> "@user:matrix.org".
30
31**url** (type: string)
32> The URL of the users server. For example "https://matrix.org" for
33> "@user:matrix.org".
34
35**settings** (type: settings object)
36> Overwrite general settings for this account. The fields are identical to
37> those in *TUNABLES*.
38
39**layout** (type: startup layout object)
40> Overwrite general settings for this account. The fields are identical to
41> those in *STARTUP LAYOUT*.
42
43**dirs** (type: XDG overrides object)
44> Overwrite general settings for this account. The fields are identical to
45> those in *DIRECTORIES*.
46
47# TUNABLES
48
49These options are configured as a map under the *settings* key and can be
50overridden as described in *PROFILES*.
51
52**log_level** (type: string)
53> Specifies the lowest log level that should be shown. Possible values
54> are: _trace_, _debug_, _info_, _warn_, and _error_.
55
56**message_shortcode_display** (type: boolean)
57> Defines whether or not emoji characters in messages should be replaced by
58> their respective shortcodes.
59
60**reaction_display** (type: boolean)
61> Defines whether or not reactions should be shown.
62
63**reaction_shortcode_display** (type: boolean)
64> Defines whether or not reactions should be shown as their respective
65> shortcode.
66
67**read_receipt_send** (type: boolean)
68> Defines whether or not read confirmations are sent.
69
70**read_receipt_display** (type: boolean)
71> Defines whether or not read confirmations are displayed.
72
73**request_timeout** (type: uint64)
74> Defines the maximum time per request in seconds.
75
76**typing_notice_send** (type: boolean)
77> Defines whether or not the typing state is sent.
78
79**typing_notice_display** (type: boolean)
80> Defines whether or not the typing state is displayed.
81
82**user** (type: map)
83> Overrides values for the specified user. See *USER OVERRIDES* for
84> details on the format.
85
86**default_room** (type: string)
87> The room to show by default instead of a welcome-screen.
88
89**message_user_color** (type: boolean)
90> Defines whether or not the message body is colored like the username.
91
92**notifications** (type: notifications object)
93> Configures push-notifications.
94> *enabled* `true` to enable the feature, defaults to `false`.
95> *via* `"desktop"` to use desktop mechanism (default), or `"bell"` to use
96> terminal bell.
97> *show_message* to show the message in the desktop notification. Defaults
98> to `true`. Messages are truncated beyond a small length.
99> The notification _rules_ are stored server side, loaded once at startup,
100> and are currently not configurable in iamb. In other words, you can
101> simply change the rules with another client.
102
103**image_preview** (type: image_preview object)
104> Enable image previews and configure it. An empty object will enable the
105> feature with default settings, omitting it will disable the feature.
106> *size* is an optional object with *width* and *height* numbers, which are
107> used to set the preview size in characters. Defaults to 66 and 10.
108> *protocol* is an optional object to override settings that should normally
109> be guessed automatically.
110> *protocol.type* is an optional string with one of the protocol types:
111> _sixel_, _kitty_, _halfblocks_.
112> *protocol.font_size* is an optional list of two numbers representing font
113> width and height in pixels.
114
115**user_gutter_width** (type: usize)
116> Specify the width of the column where usernames are displayed in a room.
117> Usernames that are too long are truncated.
118
119## USER OVERRIDES
120
121Overrides are mapped onto matrix User IDs such as _@user:matrix.org_ and are
122maps containing the following key value pairs.
123
124**name** (type: string)
125> Change the display name of the user.
126
127**color** (type: string)
128> Change the color the user is shown as. Possible values are: _black_,
129> _blue_, _cyan_, _dark-gray_, _gray_, _green_, _light-blue_,
130> _light-cyan_, _light-green_, _light-magenta_, _light-red_,
131> _light-yellow_, _magenta_, _none_, _red_, _white_, _yellow_
132
133# STARTUP LAYOUT
134
135Specifies what initial set of tabs and windows to show when starting the
136client. Configured as an object under the key *layout*.
137
138**style** (type: string)
139> Specifies what window layout to load when starting. Valid values are
140> _restore_ to restore the layout from the last time the client was exited,
141> _new_ to open a single window (uses the value of _default\_room_ if set), or
142> _config_ to open the layout described under _tabs_.
143
144**tabs** (type: array of window objects)
145> If **style** is set to _config_, then this value will be used to open a set
146> of tabs and windows at startup. Each object can contain either a **window**
147> key specifying a username, room identifier or room alias to show, or a
148> **split** key specifying an array of window objects.
149
150# DIRECTORIES
151
152Specifies the directories to save data in. Configured as a map under the key
153*dirs*.
154
155**cache** (type: string)
156> Specifies where to store assets and temporary data in.
157
158**logs** (type: string)
159> Specifies where to store log files.
160
161**downloads** (type: string)
162> Specifies where to store downloaded files.
163
164**image_previews** (type: string)
165> Specifies where to store automatically downloaded image previews.
166
167# SEE ALSO
168
169*iamb(1)*
170
171Full documentation is available online at \<https://iamb.chat\>