We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab18161 commit 872b9ccCopy full SHA for 872b9cc
docs/example_config.toml
@@ -2,7 +2,8 @@
2
ascii = "stack"
3
seperator = ": "
4
modules = ["os", "desktop", "shell", "uptime"]
5
-lowercase = false
+key_lowercase = false # true: "os", false: "OS"
6
+value_lowercase = false # true: "debian", false: "Debian"
7
8
[colours]
9
primary = "\u001B[39m" # reset
src/config/config.rs
@@ -14,7 +14,8 @@ pub struct DisplayConfig {
14
pub ascii: String,
15
pub seperator: String,
16
pub modules: Vec<String>,
17
- pub lowercase: bool,
+ pub key_lowercase: bool,
18
+ pub value_lowercase: bool,
19
}
20
21
#[derive(Deserialize, Serialize)]
@@ -34,7 +35,8 @@ pub fn default() -> Config {
34
35
"shell".to_string(),
36
"uptime".to_string(),
37
],
- lowercase: false,
38
+ key_lowercase: false,
39
+ value_lowercase: false,
40
},
41
colours: ColoursConfig {
42
primary: "\x1B[39m".to_string(),
src/main.rs
@@ -35,15 +35,18 @@ fn main() -> Result<(), Box<dyn Error>> {
continue;
- let (key, mut value) = match module_name {
- "os" => ("OS", data::os::distro()),
- "desktop" => ("DE", data::desktop::desktop()),
- "shell" => ("SH", data::shell::shell()),
- "uptime" => ("UP", data::uptime::uptime()),
+ let (mut key, mut value) = match module_name {
+ "os" => ("OS".to_string(), data::os::distro()),
+ "desktop" => ("DE".to_string(), data::desktop::desktop()),
+ "shell" => ("SH".to_string(), data::shell::shell()),
+ "uptime" => ("UP".to_string(), data::uptime::uptime()),
43
_ => return Err(format!("unknown module '{}'", module_name).into()),
44
};
45
46
- if cfg.display.lowercase {
+ if cfg.display.key_lowercase {
47
+ key = key.to_lowercase()
48
+ }
49
+ if cfg.display.value_lowercase {
50
value = value.to_lowercase();
51
52
0 commit comments