Compare commits

..

No commits in common. "5a50f9c44406a19b28ced8770c8dba9de3751a75" and "b75adff1c80634c44fd60a6bde35341088f414b8" have entirely different histories.

6 changed files with 29 additions and 35 deletions

2
Cargo.lock generated
View File

@ -348,7 +348,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
[[package]]
name = "oxidefetch"
version = "1.4.8"
version = "1.4.7"
dependencies = [
"byte-unit",
"chrono",

View File

@ -1,12 +1,11 @@
[package]
name = "oxidefetch"
description = "A fast, cross platform Fetch program for your terminal"
version = "1.4.8"
version = "1.4.7"
edition = "2021"
authors = [ "NamedNeon", "shibedrill" ]
license = "MIT"
readme = "README.md"
repository = "https://github.com/shibedrill/oxidefetch"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -33,4 +32,4 @@ codegen-units = 1
panic = "abort"
[features]
field-titles = []
field-titles = []

View File

@ -1,4 +1,4 @@
# oxidefetch 1.4.8
# oxidefetch 1.4.6
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")
@ -21,26 +21,20 @@ OxideFetch can display all of the following information:
- Kernel version
- Uptime
- Shell
- Terminal emulator/console
- Terminal
- CPU
- GPU
- Memory
Also, the field-titles feature can be enabled at compile-time, which will display the name of each field in white before the information within that field. By default, it is disabled.
- Memory
- Terminal emulator
### Installation
Download a binary for your platform, and place it in your `$PATH`.
Currently, only Windows (x86_64, gnu/msvc) and Linux (x86_64/aarch64, gnu/musl) have binaries available. If you want a binary for another platform, you will have to follow the instructions to build from source.
Download a binary for your platform, and place it in your PATH.
Currently, only Windows (x86) and Linux (x86) have binaries available. If you want a binary for another platform, you will have to follow the instructions to build from source.
### Dependencies
#### Build/Install
To build Oxidefetch, you need Cargo. If you do not already have Cargo installed on your system, you can do so by installing Rustup- either via the [instructions on their website](https://doc.rust-lang.org/cargo/getting-started/installation.html "instructions on their website") or via your system package manager.
You will also probably need a C/C++ compiler and a build system- most likely CMake and Visual Studio Build Tools, or GNU Make and the GNU compiler collection. You will be prompted to install these if they're not found during compilation.
You can use Cargo, once it's installed, to automatically build and install Oxidefetch like so:
`cargo install --git https://github.com/shibedrill/oxidefetch`.
Alternatively, you can get it from the Crates repos, using `cargo install oxidefetch`. But it might be slightly out of date.
From there, it *should* be in your `$PATH`. If not, add `source ~/.cargo/env` to your profile, or add `~/.cargo/bin` to your `$PATH`.
To build Oxidefetch, you need Cargo. You can use Cargo to automatically build and install it like so:
`cargo install --git https://github.com/shibedrill/oxidefetch`. (Alternatively, you can get it from the Crates repos, using `cargo install oxidefetch`. But it might be slightly out of date.) From there, it *should* be in your `$PATH`. If not, add `source ~/.cargo/env` to your profile, or add `~/.cargo/bin` to your `$PATH`. If you do not already have Cargo installed on your system, you can do so by installing Rustup- either via the [instructions on their website](https://doc.rust-lang.org/cargo/getting-started/installation.html "instructions on their website") or via your system package manager. You will also probably need a C compiler and a build system- most likely CMake or GNU Make. You will be prompted to install these if they're not found during compilation.
#### Runtime
There's only a couple runtime dependencies for this project.
1: `sh` shell installed for GPU detection on \*nix systems.
@ -50,8 +44,7 @@ GPU detection runs on Windows without any dependencies.)
3: Nerd fonts symbols are used in the output. Install a patched font on your system, or patch an already installed font.
### How you can help with the project
I need to verify the output of the OS information detection libraries I'm pulling in. To do this, I need the help of people with varying types of systems. I've tested a few, but there's some I'm unable to test. To help, you can kindly clone this repo, and inside the folder, run `cargo test -- --nocapture`, and send the resultant `test_output.txt` file to my noreply email address, or directly to me on Discord at `@shibedrill`. This program does NOT collect information regarding your real name, IP, location, hardware serial numbers, etc. You can look at the file it generates to be sure- it's all plaintext, babey. Also, consider contributing to [libpci-rs](https://github.com/namedneon/libpci-rs), which will eventually take responsibility for the GPU detection.
I need to verify the output of the OS information detection libraries I'm pulling in. To do this, I need the help of people with varying types of systems. I've tested a few, but there's some I'm unable to test. To help, you can kindly clone this repo, and inside the folder, run `cargo test -- --nocapture`, and send the resultant `test_output.txt` file to my noreply email address, or directly to me on Discord at `@shibedrill`. This program does NOT collect information regarding your real name, IP, location, hardware serial numbers, etc. You can look at the file it generates to be sure- it's all plaintext, babey.
#### Tested distributions/platforms:
- Alma Linux
- Alpine Linux
@ -104,9 +97,8 @@ No weird quirks to report at this time.
**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.
**1.4.5:** Minor changes to system color detection. Removed all warnings.
**1.4.6:** Cargo formatting applied to all files. Mild string reformatting in print statements.
**1.4.7:** Removed several `unwrap()` calls. Changed debug output to serialize to RON.
**1.4.8:** Applied Clippy suggestions. Added stuff to README.
**1.4.6:** Cargo formatting applied to all files. Mild string reformatting in print statements.
**1.4.7:** Removed several `unwrap()` calls. Changed debug output to serialize to RON.
### License
This software is covered by the MIT license. See license.txt for details.

BIN
image.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -28,10 +28,10 @@ use crate::terminal::get_terminal;
use byte_unit::*;
use chrono::*;
use colored::*;
use compound_duration;
use std::env;
use sysinfo::*;
use whoami;
#[cfg(test)]
use serde::Serialize;
@ -141,7 +141,7 @@ impl Information {
shell: {
let var = env::var("SHELL");
if let Ok(var_ok) = var {
Some(var_ok.split('/').last().unwrap().to_string())
Some(format!("{}", var_ok.split('/').last().unwrap()))
} else {
None
}

View File

@ -56,13 +56,16 @@ macro_rules! match_env_to_terminal {
pub fn get_terminal() -> Option<String> {
// Match Apple terminals.
if let Ok(f) = env::var("TERM_PROGRAM") {
return match f.as_str() {
"iTerm.app" => Some("iTerm2".to_string()),
"Terminal.app" => Some("Apple Terminal".to_string()),
"Hyper.app" => Some("Hyper".to_string()),
_ => None,
};
match env::var("TERM_PROGRAM") {
Ok(f) => {
return match f.as_str() {
"iTerm.app" => Some("iTerm2".to_string()),
"Terminal.app" => Some("Apple Terminal".to_string()),
"Hyper.app" => Some("Hyper".to_string()),
_ => None,
};
}
Err(_) => (),
};
match_env_to_terminal!("ConEmuPID", "ConEmu");
@ -76,7 +79,7 @@ pub fn get_terminal() -> Option<String> {
Ok(f) => f,
Err(_) => "".to_string(),
};
let shell_name = shell.split('/').last().unwrap();
let shell_name = shell.split("/").last().unwrap();
#[allow(unused_assignments)]
let mut name: Option<String> = None;
@ -134,7 +137,7 @@ pub fn get_terminal() -> Option<String> {
return match name {
Some(f) => {
// Remove the file extension.
let mut res = f.split('.').next().unwrap().to_string();
let mut res = f.split(".").nth(0).unwrap().to_string();
// Try to get a "prettier name".
if PRETTY_NAMES.contains_key(res.as_str()) {