diff --git a/Cargo.lock b/Cargo.lock index 14966f1..f15a57a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "oxidefetch" -version = "1.4.3" +version = "1.4.4" dependencies = [ "byte-unit", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 13f3a52..b74798e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "oxidefetch" description = "A fast, cross platform Fetch program for your terminal" -version = "1.4.3" +version = "1.4.4" edition = "2021" authors = [ "NamedNeon", "shibedrill" ] license = "MIT" diff --git a/README.md b/README.md index 890e990..50133b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# oxidefetch 1.4.3 +# oxidefetch 1.4.4 Fully cross platform Neofetch clone written in Rust. Up to 25 times faster than Neofetch! ![alt text](image.png "Example output of OxideFetch on a WSL2 Arch Linux host") @@ -97,6 +97,7 @@ No weird quirks to report at this time. **1.4.1:** Changed terminal color to match shell color. **1.4.2:** Updated colors and logos of a few distros. They will now display correctly. **1.4.3:** Removed newline print before information. This should be up to the user to print, using their shell profile. +**1.4.4:** Fixed an issue where GPUs would all print on one line. ### License This software is covered by the MIT license. See license.txt for details. diff --git a/src/main.rs b/src/main.rs index 785cc7a..4a3e580 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,7 +166,7 @@ impl Information { gpu_info_as_string .unwrap() // TODO: Please figure out a way to get rid of this unwrap() call. // I feel like I did so well avoiding unwrap calls everywhere except for here. - .split("\n") + .lines() .collect::>()[1], )]) } @@ -177,7 +177,7 @@ impl Information { // On *nix, hopefully, "lspci | grep VGA | awk -F 'VGA compatible controller: ' '{print $2}'" gives us our GPU name. // Since pipes can't be processed as arguments, we need to do all this in a subshell under SH. let command_output = std::process::Command::new("sh") - .args(["-c", "lspci | grep VGA | awk -F 'VGA compatible controller: ' '{print $2}'"]) + .args(["-c", "lspci | grep VGA | awk -F'VGA compatible controller: ' '{print $2}'"]) .output(); // Check if running the command resulted in an error. If not, convert to a vector. @@ -191,11 +191,11 @@ impl Information { match output_string.as_ref() { "" => None, _ => { - Some(vec![ - output_string - .split("\n") - .collect() - ]) + let mut gpu_vec = vec!(); + for s in output_string.trim().split('\n') { + gpu_vec.push(s.to_string()); + } + Some(gpu_vec) } } }