Fixed GPUs displaying all on one line
This commit is contained in:
parent
a418ba1bac
commit
02fd780267
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -333,7 +333,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
|
||||
|
||||
[[package]]
|
||||
name = "oxidefetch"
|
||||
version = "1.4.3"
|
||||
version = "1.4.4"
|
||||
dependencies = [
|
||||
"byte-unit",
|
||||
"chrono",
|
||||
|
@ -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"
|
||||
|
@ -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!
|
||||
|
||||

|
||||
@ -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.
|
||||
|
14
src/main.rs
14
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::<Vec<&str>>()[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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user