Commit 8b74938c8a

8b74938c8a5042cf3c761ba57f0b4140f3c73702

parent: ddf3bb2947

Unregistered key

Ulyssa <git@ulyssa.dev> · 2026-10-05 01:02 UTC
committer: <noreply@github.com>

Add `config.basic.toml` and rename example config to `config.full.toml` (#782)

Layout: unified · split

PACKAGING.md +2 −1
@@ -32,7 +32,8 @@ you'll want to install as part of a package:
32| Repository Path | Installed Path (may vary per OS) | 32| Repository Path | Installed Path (may vary per OS) |
33| ----------------------- | ----------------------------------------------- | 33| ----------------------- | ----------------------------------------------- |
34| /iamb.desktop | /usr/share/applications/iamb.desktop | 34| /iamb.desktop | /usr/share/applications/iamb.desktop |
35| /config.example.toml | /usr/share/iamb/config.example.toml | 35| /config.basic.toml | /usr/share/iamb/config.basic.toml |
36| /config.full.toml | /usr/share/iamb/config.full.toml |
36| /docs/iamb-256x256.png | /usr/share/icons/hicolor/256x256/apps/iamb.png | 37| /docs/iamb-256x256.png | /usr/share/icons/hicolor/256x256/apps/iamb.png |
37| /docs/iamb-512x512.png | /usr/share/icons/hicolor/512x512/apps/iamb.png | 38| /docs/iamb-512x512.png | /usr/share/icons/hicolor/512x512/apps/iamb.png |
38| /docs/iamb.svg | /usr/share/icons/hicolor/scalable/apps/iamb.svg | 39| /docs/iamb.svg | /usr/share/icons/hicolor/scalable/apps/iamb.svg |
config.basic.toml added +10
@@ -0,0 +1,10 @@
1# ==============================================================================
2# This is an example of a basic `config.toml` for iamb.
3#
4# Reference iamb(5) or <https://iamb.chat> for the options you can set here.
5# ==============================================================================
6[profiles.default]
7user_id = "@user:matrix.org"
8
9[settings]
10ignorecase = true
config.example.toml → config.full.toml renamed +28 −3
@@ -1,13 +1,27 @@
1# ==============================================================================
2# NOTE: This file demonstrates using most of the configuration options in iamb!
3#
4# While some of the options in here are set to their defaults, many of them are
5# not and might not actually be what you want to use!
6#
7# If you want to start with something simple, use `config.basic.toml` and add
8# things in one-by-one as you need them.
9# ==============================================================================
1default_profile = "default" 10default_profile = "default"
2 11
12# Specify a user profile to log in as.
13#
14# Usually `user_id` is sufficient, and you will be prompted for a password at
15# startup, but you can use `url` to override the typical homeserver discovery,
16# and `password_file` to avoid being prompted for a password at login.
3[profiles.default] 17[profiles.default]
4user_id = "@user:matrix.org" 18user_id = "@user:matrix.org"
5password_file = "/path/to/password" 19password_file = "/path/to/password"
6url = "https://matrix.org" 20url = "https://matrix-client.matrix.org"
7 21
8[settings] 22[settings]
9default_markup = "html" 23default_markup = "markdown"
10default_register = "+" 24default_register = "\""
11default_room = "#iamb-users:0x.badd.cafe" 25default_room = "#iamb-users:0x.badd.cafe"
12default_split = "vertical" 26default_split = "vertical"
13external_edit_file_suffix = ".md" 27external_edit_file_suffix = ".md"
@@ -29,31 +43,38 @@ typing_notice_send = true
29user_gutter_width = 30 43user_gutter_width = 30
30username_display = "username" 44username_display = "username"
31 45
46# Settings related to the encryption indicator:
32[settings.encryption] 47[settings.encryption]
33indicator = "only-encrypted" 48indicator = "only-encrypted"
34indicator_location = "title|prompt" 49indicator_location = "title|prompt"
35 50
51# Settings related to showing image previews in the terminal:
36[settings.image_preview] 52[settings.image_preview]
37protocol = { type = "sixel", filter = "Nearest" } 53protocol = { type = "sixel", filter = "Nearest" }
38size = { "width" = 66, "height" = 10 } 54size = { "width" = 66, "height" = 10 }
39 55
56# Settings related to proxying homeserver requests:
40[settings.proxy] 57[settings.proxy]
41url = "" # An empty string disables any proxying 58url = "" # An empty string disables any proxying
42auth = "Bearer abcd1234" 59auth = "Bearer abcd1234"
43headers.X-Proxy-Config = "foobar" 60headers.X-Proxy-Config = "foobar"
44 61
62# Settings related to overriding how lists of rooms are sorted:
45[settings.sort] 63[settings.sort]
46rooms = ["favorite", "lowpriority", "unread", "name"] 64rooms = ["favorite", "lowpriority", "unread", "name"]
47members = ["power", "id"] 65members = ["power", "id"]
48 66
67# Settings related to how iamb interacts with the terminal:
49[settings.terminal] 68[settings.terminal]
50cursor_shape = "default" 69cursor_shape = "default"
51enable_extended_keys = false 70enable_extended_keys = false
52enable_title = true 71enable_title = true
53 72
73# Settings related to overriding how specific users are shown:
54[settings.users] 74[settings.users]
55"@user:matrix.org" = { "name" = "John Doe", "color" = "magenta" } 75"@user:matrix.org" = { "name" = "John Doe", "color" = "magenta" }
56 76
77# Specify a specific tab and window layout to use every time iamb starts:
57[layout] 78[layout]
58style = "config" 79style = "config"
59 80
@@ -69,12 +90,14 @@ split = [
69 { "window" = "#iamb-dev:0x.badd.cafe" } 90 { "window" = "#iamb-dev:0x.badd.cafe" }
70] 91]
71 92
93# Map specific key inputs to other keys:
72[macros.insert] 94[macros.insert]
73"jj" = "<Esc>" 95"jj" = "<Esc>"
74 96
75[macros."normal|visual"] 97[macros."normal|visual"]
76"V" = "<C-W>m" 98"V" = "<C-W>m"
77 99
100# Map command aliases to to other commands:
78[aliases] 101[aliases]
79"c" = "chats" 102"c" = "chats"
80"d" = "download" 103"d" = "download"
@@ -85,11 +108,13 @@ split = [
85"ca" = "cancel" 108"ca" = "cancel"
86"red" = "redact" 109"red" = "redact"
87 110
111# Specify different directories to use instead of the system defaults:
88[dirs] 112[dirs]
89cache = "/home/user/.cache/iamb/" 113cache = "/home/user/.cache/iamb/"
90logs = "/home/user/.local/share/iamb/logs/" 114logs = "/home/user/.local/share/iamb/logs/"
91downloads = "/home/user/Downloads/" 115downloads = "/home/user/Downloads/"
92 116
117# Override default colors:
93[theme] 118[theme]
94timeline.state.color = "cyan" 119timeline.state.color = "cyan"
95timeline.redacted.color = "245" # light gray 120timeline.redacted.color = "245" # light gray
docs/iamb.5 +4 −2
@@ -1146,8 +1146,10 @@ loads by default.
1146A JSON configuration file that 1146A JSON configuration file that
1147.Sy iamb 1147.Sy iamb
1148will load if the TOML one is not found. 1148will load if the TOML one is not found.
1149.It Pa /usr/share/iamb/config.example.toml 1149.It Pa /usr/share/iamb/config.basic.toml
1150A sample configuration file with examples of how to set different values. 1150A sample configuration file showing the basic values needed to get started.
1151.It Pa /usr/share/iamb/config.basic.toml
1152A sample configuration file with examples of how to set many different values.
1151.El 1153.El
1152.Sh "REPORTING BUGS" 1154.Sh "REPORTING BUGS"
1153Please report bugs in 1155Please report bugs in
src/config/mod.rs +3 −3
@@ -135,7 +135,7 @@ fn deserialize_register<'de, D>(deserializer: D) -> Result<Option<Register>, D::
135where 135where
136 D: serde::de::Deserializer<'de>, 136 D: serde::de::Deserializer<'de>,
137{ 137{
138 let r = <&'de str>::deserialize(deserializer)?; 138 let r = String::deserialize(deserializer)?;
139 139
140 if r.len() > 1 { 140 if r.len() > 1 {
141 return Err(D::Error::custom("expected a single character to specify a register")); 141 return Err(D::Error::custom("expected a single character to specify a register"));
@@ -1972,8 +1972,8 @@ mod tests {
1972 1972
1973 #[test] 1973 #[test]
1974 fn test_load_example_config_toml() { 1974 fn test_load_example_config_toml() {
1975 let path = PathBuf::from("config.example.toml"); 1975 let path = PathBuf::from("config.full.toml");
1976 let config = IambConfig::load_toml(&path).expect("can load example_config.toml"); 1976 let config = IambConfig::load_toml(&path).expect("can load config.full.toml");
1977 1977
1978 let IambConfig { 1978 let IambConfig {
1979 profiles, 1979 profiles,