Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a463f4234c | |||
| beb04101db | |||
| bf60e4265b | |||
| 42421bc57d | |||
| f64ee7b7e9 | |||
| 1fa29cf831 | |||
| 4861dd5d4a | |||
| 5614b723fd | |||
| 5e1e13b091 | |||
| 79ddb3ca92 | |||
| 684929edea | |||
| f02ec8c4ba | |||
| 5fd4ed9b0c | |||
| 003c295084 | |||
| d4560e3edb | |||
| 62b4c27404 | |||
| 169368a784 | |||
| 3e47640c1a | |||
| 6ddd762b35 | |||
| 713bcce0ec | |||
| fdfd9816f5 | |||
| d6f9d1f569 | |||
| b28aa0ddf2 | |||
| a5e784c528 | |||
| 93b4dd3471 | |||
| d15afe579f | |||
| f79aca3c65 | |||
| fa3fc59a5f | |||
| afa3c1dfb9 | |||
| cf6b77a1b7 | |||
| b58425badd | |||
| 8c1713c37d | |||
| 3c7c449da4 | |||
| 2fe4b3f287 | |||
| 6a80928f10 | |||
| 4ac698817d | |||
| 13acc0b6b6 | |||
| 455f0382e7 | |||
| 0c9e4db742 | |||
| aee058e591 | |||
| b74787768f | |||
| 218c535d06 | |||
| 76ae5e507a | |||
| d2dfd950a3 | |||
| 45ee7e199e | |||
| 2cfea54a88 | |||
| 0cc6ddbca8 | |||
| 8a536c30f0 | |||
| 5c24bd443a | |||
| e691b2d9da | |||
| 5ec7b4f01a | |||
| f38b754783 | |||
| 211beb7b6a | |||
| 02c64ef281 | |||
| 4e9c510240 | |||
| d6b559fb40 |
+11
@@ -121,3 +121,14 @@ start_moderation.sh
|
|||||||
gh_moderator.toml
|
gh_moderator.toml
|
||||||
moderator-data
|
moderator-data
|
||||||
hyfetch/git
|
hyfetch/git
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
target
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
*.egg-info
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
|||||||
Generated
+8
-1
@@ -220,6 +220,12 @@ version = "2.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fs_extra"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.15"
|
version = "0.2.15"
|
||||||
@@ -245,7 +251,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyfetch"
|
name = "hyfetch"
|
||||||
version = "2.0.0-rc1"
|
version = "2.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"ansi_colours",
|
"ansi_colours",
|
||||||
@@ -258,6 +264,7 @@ dependencies = [
|
|||||||
"enable-ansi-support",
|
"enable-ansi-support",
|
||||||
"enterpolation",
|
"enterpolation",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
|
"fs_extra",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools",
|
"itertools",
|
||||||
"normpath",
|
"normpath",
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ resolver = "2"
|
|||||||
members = ["crates/*"]
|
members = ["crates/*"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "2.0.0-rc1"
|
version = "2.0.2"
|
||||||
authors = ["Azalea Gui <azalea@hydev.org>"]
|
authors = ["Azalea Gui <azalea@hydev.org>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.75.0"
|
||||||
|
|||||||
@@ -124,11 +124,65 @@ Updates to `neowofetch` begins with the emoji 🖼️
|
|||||||
Note: You can install the latest nightly version by using:
|
Note: You can install the latest nightly version by using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install git+https://github.com/hykilpikonna/hyfetch.git@master
|
cargo install --git https://github.com/hykilpikonna/hyfetch
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- CHANGELOG STARTS HERE --->
|
<!-- CHANGELOG STARTS HERE --->
|
||||||
|
|
||||||
|
### 2.0.2
|
||||||
|
|
||||||
|
This is a small patch release that adds more flags and fixes some bugs from the recent Rust rewrite.
|
||||||
|
|
||||||
|
* 🏳️🌈 **New Flags**: Added new pride flags for Nullflux ([#397](https://github.com/hykilpikonna/hyfetch/pull/397)), Hypergender ([#422](https://github.com/hykilpikonna/hyfetch/pull/422)), Fictosexual ([#394](https://github.com/hykilpikonna/hyfetch/pull/394)), and Adipophilia ([#424](https://github.com/hykilpikonna/hyfetch/pull/424)).
|
||||||
|
* 🐛 **Bug Fixes**:
|
||||||
|
* Fixed a critical bug where custom `fastfetch` configurations could break hyfetch ([#420](https://github.com/hykilpikonna/hyfetch/pull/420)).
|
||||||
|
* Corrected the `nixos_small` ASCII logo to display properly ([#421](https://github.com/hykilpikonna/hyfetch/pull/421)).
|
||||||
|
* 🔧 **Improvements**:
|
||||||
|
* Improved a warning message for better clarity ([#419](https://github.com/hykilpikonna/hyfetch/issues/419)).
|
||||||
|
|
||||||
|
### 2.0.1
|
||||||
|
|
||||||
|
(changelog is generated by Gemini from commit history)
|
||||||
|
|
||||||
|
**🦀 The Rust Rewrite!**
|
||||||
|
|
||||||
|
This is a massive update, rewriting the entire hyfetch core from Python to Rust for significantly improved performance, reliability, and maintainability. A huge thank you to **@teohhanhui** and all the contributors who made this possible!
|
||||||
|
|
||||||
|
* 🚀 **Complete Rewrite in Rust**: The entire codebase has been ported to Rust, resulting in major performance improvements and a smaller binary size.
|
||||||
|
* ⚙️ **New Backends**: In addition to neofetch and fastfetch, hyfetch now supports **macchina** as a backend option.
|
||||||
|
* 🌈 **Improved June Animation**: The `--june` pride month animation is now smoother, flicker-free ([#408](https://github.com/hykilpikonna/hyfetch/pull/408)).
|
||||||
|
* 🪟 **Native Windows Support**: The Rust version provides much-improved support for Windows.
|
||||||
|
|
||||||
|
**✨ Features & Enhancements**
|
||||||
|
|
||||||
|
* 🎨 **Automatic Theme Detection**: Hyfetch can now automatically detect your terminal's light/dark mode (when auto_detect_light_dark is true) ([#380](https://github.com/hykilpikonna/hyfetch/pull/380)).
|
||||||
|
* ✍️ **Font Logos**: Added a new feature to display a logo created from your system's font.
|
||||||
|
* 🌐 **Cloudflare for Public IP**: Now uses Cloudflare to fetch the public IP address, with a fallback option ([#416](https://github.com/hykilpikonna/hyfetch/pull/416)).
|
||||||
|
* 🖼️ **Interactive Logo Selection**: An interactive setup step now allows you to choose between default and small logo variants for your distro ([#392](https://github.com/hykilpikonna/hyfetch/pull/392)).
|
||||||
|
* 🏳️🌈 **New Pride Flags**: Added flags for Cisgender ([#386](https://github.com/hykilpikonna/hyfetch/pull/386)), Kessoku Band ([#384](https://github.com/hykilpikonna/hyfetch/pull/384)), and Watermelon Cream Lozenges ([#369](https://github.com/hykilpikonna/hyfetch/pull/369)) for memes.
|
||||||
|
* 📄 **Page Navigation**: Added `n` and `p` as shorthands for next/previous page selection and implemented page number roll-over ([#372](https://github.com/hykilpikonna/hyfetch/pull/372)).
|
||||||
|
|
||||||
|
**🖼️ New & Updated Distro Support**
|
||||||
|
|
||||||
|
* **Added Bazzite** ([#406](https://github.com/hykilpikonna/hyfetch/pull/406))
|
||||||
|
* **Added Rhino Linux Logo** ([#407](https://github.com/hykilpikonna/hyfetch/pull/407))
|
||||||
|
* **Updated openSUSE Logos & Added Slowroll**
|
||||||
|
* **Updated KSLinux Detection** ([#395](https://github.com/hykilpikonna/hyfetch/pull/395))
|
||||||
|
|
||||||
|
**🐛 Bug Fixes**
|
||||||
|
|
||||||
|
* **macOS**: Fixed CPU and memory fetching on older macOS versions like Leopard and Tiger ([#387](https://github.com/hykilpikonna/hyfetch/pull/387), [#389](https://github.com/hykilpikonna/hyfetch/pull/389)).
|
||||||
|
* **Packaging**: Resolved several issues with `cargo publish` to ensure reliable package deployment ([#405](https://github.com/hykilpikonna/hyfetch/pull/405)).
|
||||||
|
* **Performance**: Sped up RPM package counting by skipping digest and signature verification ([#371](https://github.com/hykilpikonna/hyfetch/pull/371)).
|
||||||
|
* **Animation**: Updated logic to ensure the pride month animation is always shown when `--june` is explicitly used ([#411](https://github.com/hykilpikonna/hyfetch/pull/411)).
|
||||||
|
* **General**: Fixed numerous bugs related to builds, path detection, cache handling, and distro name detection.
|
||||||
|
* **Formatting**: Fixed an unwanted space in the Python version output ([#401](https://github.com/hykilpikonna/hyfetch/pull/401)).
|
||||||
|
|
||||||
|
**🔧 Maintenance**
|
||||||
|
|
||||||
|
* **Documentation**: Updated the README with additional credits for Slackware contributors ([#365](https://github.com/hykilpikonna/hyfetch/pull/365)).
|
||||||
|
* **Build System**: Overhauled the build scripts for Rust, including support for `musl` static builds and cross-compilation for macOS and Windows.
|
||||||
|
|
||||||
### 1.99.0
|
### 1.99.0
|
||||||
|
|
||||||
This version would be the last version of HyFetch on Python as we migrate to Rust (Huge thanks to everyone on [#317](https://github.com/hykilpikonna/hyfetch/pull/317)!). It will also be an effort to start a transition that phases out the neowofetch/neofetch backend in favor of FastFetch, since the time needed to maintain the NF backend currently exceed our capacity. If you are willing to help maintaining it, please let us know!
|
This version would be the last version of HyFetch on Python as we migrate to Rust (Huge thanks to everyone on [#317](https://github.com/hykilpikonna/hyfetch/pull/317)!). It will also be an effort to start a transition that phases out the neowofetch/neofetch backend in favor of FastFetch, since the time needed to maintain the NF backend currently exceed our capacity. If you are willing to help maintaining it, please let us know!
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ which = { workspace = true, features = [] }
|
|||||||
indexmap = { workspace = true, features = ["std"] }
|
indexmap = { workspace = true, features = ["std"] }
|
||||||
regex = { workspace = true, features = ["perf", "std", "unicode"] }
|
regex = { workspace = true, features = ["perf", "std", "unicode"] }
|
||||||
unicode-normalization = { workspace = true, features = ["std"] }
|
unicode-normalization = { workspace = true, features = ["std"] }
|
||||||
|
fs_extra = "1.3.0"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
enable-ansi-support = { workspace = true, features = [] }
|
enable-ansi-support = { workspace = true, features = [] }
|
||||||
|
|||||||
+26
-10
@@ -1,7 +1,9 @@
|
|||||||
|
use std::env;
|
||||||
use std::fmt::Write as _;
|
use std::fmt::Write as _;
|
||||||
use std::path::Path;
|
use std::fs;
|
||||||
use std::{env, fs};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
use fs_extra::dir::{CopyOptions};
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use unicode_normalization::UnicodeNormalization as _;
|
use unicode_normalization::UnicodeNormalization as _;
|
||||||
@@ -23,18 +25,32 @@ impl AsciiDistro {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn anything_that_exist(paths: &[&Path]) -> Option<PathBuf> {
|
||||||
|
paths.iter().copied().find(|p| p.exists()).map(Path::to_path_buf)
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let neofetch_path = Path::new(env!("CARGO_WORKSPACE_DIR")).join("neofetch");
|
// Path hack to make file paths work in both workspace and manifest directory
|
||||||
|
let dir = PathBuf::from(env::var_os("CARGO_WORKSPACE_DIR").unwrap_or_else(|| env::var_os("CARGO_MANIFEST_DIR").unwrap()));
|
||||||
|
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
|
|
||||||
println!(
|
for file in &["neofetch", "hyfetch"] {
|
||||||
"cargo:rerun-if-changed={neofetch_path}",
|
let src = anything_that_exist(&[
|
||||||
neofetch_path = neofetch_path.display()
|
&dir.join(file),
|
||||||
);
|
&dir.join("../../").join(file),
|
||||||
|
]).expect("couldn't find neofetch");
|
||||||
|
let dst = o.join(file);
|
||||||
|
println!("cargo:rerun-if-changed={}", src.display());
|
||||||
|
|
||||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
// Copy either file or directory
|
||||||
let out_path = Path::new(&out_dir);
|
if src.is_dir() {
|
||||||
|
let opt = CopyOptions { overwrite: true, copy_inside: true, ..CopyOptions::default() };
|
||||||
|
fs_extra::dir::copy(&src, &dst, &opt).expect("Failed to copy directory to OUT_DIR");
|
||||||
|
}
|
||||||
|
else { fs::copy(&src, &dst).expect("Failed to copy file to OUT_DIR"); }
|
||||||
|
}
|
||||||
|
|
||||||
export_distros(neofetch_path, out_path);
|
export_distros(&o.join("neofetch"), &o);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn export_distros<P>(neofetch_path: P, out_path: &Path)
|
fn export_distros<P>(neofetch_path: P, out_path: &Path)
|
||||||
|
|||||||
@@ -13,15 +13,17 @@ use deranged::RangedU8;
|
|||||||
use enterpolation::bspline::BSpline;
|
use enterpolation::bspline::BSpline;
|
||||||
use enterpolation::{Curve as _, Generator as _};
|
use enterpolation::{Curve as _, Generator as _};
|
||||||
use hyfetch::ascii::RawAsciiArt;
|
use hyfetch::ascii::RawAsciiArt;
|
||||||
|
use hyfetch::ascii::NormalizedAsciiArt;
|
||||||
use hyfetch::cli_options::options;
|
use hyfetch::cli_options::options;
|
||||||
use hyfetch::color_util::{
|
use hyfetch::color_util::{
|
||||||
clear_screen, color, printc, ContrastGrayscale as _, ForegroundBackground, Lightness,
|
clear_screen, color, printc, ContrastGrayscale as _, ForegroundBackground, Lightness,
|
||||||
NeofetchAsciiIndexedColor, PresetIndexedColor, Theme as _, ToAnsiString as _,
|
NeofetchAsciiIndexedColor, PresetIndexedColor, Theme as _, ToAnsiString as _,
|
||||||
};
|
};
|
||||||
|
use hyfetch::distros::Distro;
|
||||||
use hyfetch::models::Config;
|
use hyfetch::models::Config;
|
||||||
#[cfg(feature = "macchina")]
|
#[cfg(feature = "macchina")]
|
||||||
use hyfetch::neofetch_util::macchina_path;
|
use hyfetch::neofetch_util::macchina_path;
|
||||||
use hyfetch::neofetch_util::{self, add_pkg_path, fastfetch_path, get_distro_ascii, literal_input, ColorAlignment, NEOFETCH_COLORS_AC, NEOFETCH_COLOR_PATTERNS, TEST_ASCII};
|
use hyfetch::neofetch_util::{self, add_pkg_path, fastfetch_path, get_distro_ascii, get_distro_name, literal_input, ColorAlignment, NEOFETCH_COLORS_AC, NEOFETCH_COLOR_PATTERNS, TEST_ASCII};
|
||||||
use hyfetch::presets::{AssignLightness, Preset};
|
use hyfetch::presets::{AssignLightness, Preset};
|
||||||
use hyfetch::pride_month;
|
use hyfetch::pride_month;
|
||||||
use hyfetch::types::{AnsiMode, Backend, TerminalTheme};
|
use hyfetch::types::{AnsiMode, Backend, TerminalTheme};
|
||||||
@@ -87,7 +89,16 @@ fn main() -> Result<()> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let color_mode = options.mode.unwrap_or(config.mode);
|
let color_mode = options.mode.unwrap_or(config.mode);
|
||||||
let theme = config.light_dark;
|
let auto_detect_light_dark = options
|
||||||
|
.auto_detect_light_dark
|
||||||
|
.unwrap_or_else(|| config.auto_detect_light_dark.unwrap_or(false));
|
||||||
|
let theme = if auto_detect_light_dark {
|
||||||
|
let res = det_bg();
|
||||||
|
res?.map(|bg| bg.theme())
|
||||||
|
.unwrap_or(config.light_dark.unwrap_or_default())
|
||||||
|
} else {
|
||||||
|
config.light_dark.unwrap_or_default()
|
||||||
|
};
|
||||||
|
|
||||||
// Check if it's June (pride month)
|
// Check if it's June (pride month)
|
||||||
let now =
|
let now =
|
||||||
@@ -107,8 +118,6 @@ fn main() -> Result<()> {
|
|||||||
.context("failed to write message to stdout")?;
|
.context("failed to write message to stdout")?;
|
||||||
|
|
||||||
if !june_path.is_file() {
|
if !june_path.is_file() {
|
||||||
fs::create_dir_all(&cache_path)
|
|
||||||
.with_context(|| format!("failed to create cache dir {cache_path:?}"))?;
|
|
||||||
File::create(&june_path)
|
File::create(&june_path)
|
||||||
.with_context(|| format!("failed to create file {june_path:?}"))?;
|
.with_context(|| format!("failed to create file {june_path:?}"))?;
|
||||||
}
|
}
|
||||||
@@ -131,7 +140,12 @@ fn main() -> Result<()> {
|
|||||||
} else if let Some(lightness) = options.lightness {
|
} else if let Some(lightness) = options.lightness {
|
||||||
color_profile.with_lightness(AssignLightness::Replace(lightness))
|
color_profile.with_lightness(AssignLightness::Replace(lightness))
|
||||||
} else {
|
} else {
|
||||||
color_profile.with_lightness_adaptive(config.lightness(), theme)
|
color_profile.with_lightness_adaptive(
|
||||||
|
config
|
||||||
|
.lightness
|
||||||
|
.unwrap_or_else(|| Config::default_lightness(theme)),
|
||||||
|
theme,
|
||||||
|
)
|
||||||
};
|
};
|
||||||
debug!(?color_profile, "lightened color profile");
|
debug!(?color_profile, "lightened color profile");
|
||||||
|
|
||||||
@@ -187,6 +201,22 @@ fn load_config(path: &PathBuf) -> Result<Option<Config>> {
|
|||||||
Ok(Some(config))
|
Ok(Some(config))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn det_bg() -> Result<Option<Srgb<u8>>, terminal_colorsaurus::Error> {
|
||||||
|
if !io::stdout().is_terminal() {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
|
background_color(QueryOptions::default())
|
||||||
|
.map(|terminal_colorsaurus::Color { r, g, b }| Some(Srgb::new(r, g, b).into_format()))
|
||||||
|
.or_else(|err| {
|
||||||
|
if matches!(err, terminal_colorsaurus::Error::UnsupportedTerminal) {
|
||||||
|
Ok(None)
|
||||||
|
} else {
|
||||||
|
Err(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/// Creates config interactively.
|
/// Creates config interactively.
|
||||||
///
|
///
|
||||||
/// The config is automatically stored to file.
|
/// The config is automatically stored to file.
|
||||||
@@ -197,21 +227,10 @@ fn create_config(
|
|||||||
backend: Backend,
|
backend: Backend,
|
||||||
debug_mode: bool,
|
debug_mode: bool,
|
||||||
) -> Result<Config> {
|
) -> Result<Config> {
|
||||||
// Detect terminal environment (doesn't work for all terminal emulators,
|
let det_bg = det_bg()?;
|
||||||
// especially on Windows)
|
|
||||||
let det_bg = if io::stdout().is_terminal() {
|
|
||||||
match background_color(QueryOptions::default()) {
|
|
||||||
Ok(bg) => Some(Srgb::<u16>::new(bg.r, bg.g, bg.b).into_format::<u8>()),
|
|
||||||
Err(terminal_colorsaurus::Error::UnsupportedTerminal) => None,
|
|
||||||
Err(err) => {
|
|
||||||
return Err(err).context("failed to get terminal background color");
|
|
||||||
},
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
debug!(?det_bg, "detected background color");
|
debug!(?det_bg, "detected background color");
|
||||||
let det_ansi = supports_color::on(supports_color::Stream::Stdout).map(|color_level| {
|
let det_ansi = supports_color::on(supports_color::Stream::Stdout).map(|color_level| {
|
||||||
|
#[allow(clippy::if_same_then_else)]
|
||||||
if color_level.has_16m {
|
if color_level.has_16m {
|
||||||
AnsiMode::Rgb
|
AnsiMode::Rgb
|
||||||
} else if color_level.has_256 {
|
} else if color_level.has_256 {
|
||||||
@@ -228,9 +247,10 @@ fn create_config(
|
|||||||
});
|
});
|
||||||
debug!(?det_ansi, "detected color mode");
|
debug!(?det_ansi, "detected color mode");
|
||||||
|
|
||||||
let asc = get_distro_ascii(distro, backend).context("failed to get distro ascii")?;
|
// Try to get ascii from given backend first, if it fails, try neofetch backend
|
||||||
|
let asc = get_distro_ascii(distro, backend).or_else(|_| get_distro_ascii(distro, Backend::Neofetch)).context("failed to get distro ascii from neofetch backend")?;
|
||||||
let asc = asc.to_normalized().context("failed to normalize ascii")?;
|
let asc = asc.to_normalized().context("failed to normalize ascii")?;
|
||||||
let theme = det_bg.map(|bg| bg.theme()).unwrap_or(TerminalTheme::Light);
|
let theme = det_bg.map(|bg| bg.theme()).unwrap_or_default();
|
||||||
let color_mode = det_ansi.unwrap_or(AnsiMode::Ansi256);
|
let color_mode = det_ansi.unwrap_or(AnsiMode::Ansi256);
|
||||||
let mut title = format!(
|
let mut title = format!(
|
||||||
"Welcome to {logo} Let's set up some colors first.",
|
"Welcome to {logo} Let's set up some colors first.",
|
||||||
@@ -272,16 +292,8 @@ fn create_config(
|
|||||||
// 0. Check term size
|
// 0. Check term size
|
||||||
|
|
||||||
{
|
{
|
||||||
let (Width(term_w), Height(term_h)) =
|
let (Width(term_w), Height(term_h)) = terminal_size().context("failed to get terminal size")?;
|
||||||
terminal_size().context("failed to get terminal size")?;
|
let (term_w_min, term_h_min) = ((asc.w as u32 * 2 + 4).clamp(0, u16::MAX.into()) as u16, 30);
|
||||||
let (term_w_min, term_h_min) = (
|
|
||||||
u16::from(asc.w)
|
|
||||||
.checked_mul(2)
|
|
||||||
.unwrap()
|
|
||||||
.checked_add(4)
|
|
||||||
.unwrap(),
|
|
||||||
30,
|
|
||||||
);
|
|
||||||
if term_w < term_w_min || term_h < term_h_min {
|
if term_w < term_w_min || term_h < term_h_min {
|
||||||
printc(
|
printc(
|
||||||
format!(
|
format!(
|
||||||
@@ -483,28 +495,12 @@ fn create_config(
|
|||||||
|
|
||||||
// Calculate flags per row
|
// Calculate flags per row
|
||||||
let (flags_per_row, rows_per_page) = {
|
let (flags_per_row, rows_per_page) = {
|
||||||
let (Width(term_w), Height(term_h)) =
|
let (Width(term_w), Height(term_h)) = terminal_size().context("failed to get term size")?;
|
||||||
terminal_size().context("failed to get terminal size")?;
|
let flags_per_row = (term_w / (spacing as u16 + 2)).clamp(0, u8::MAX.into()) as u8;
|
||||||
let flags_per_row = term_w.div_euclid(u16::from(spacing).checked_add(2).unwrap());
|
let rows_per_page = (term_h.saturating_sub(13) / 5).clamp(1, u8::MAX.into()) as u8;
|
||||||
let flags_per_row: u8 = flags_per_row
|
|
||||||
.try_into()
|
|
||||||
.expect("`flags_per_row` should fit in `u8`");
|
|
||||||
let rows_per_page = cmp::max(1, term_h.saturating_sub(13).div_euclid(5));
|
|
||||||
let rows_per_page: u8 = rows_per_page
|
|
||||||
.try_into()
|
|
||||||
.expect("`rows_per_page` should fit in `u8`");
|
|
||||||
(flags_per_row, rows_per_page)
|
(flags_per_row, rows_per_page)
|
||||||
};
|
};
|
||||||
let num_pages =
|
let num_pages = (Preset::COUNT.div_ceil(flags_per_row as usize * rows_per_page as usize)).clamp(0, u8::MAX.into()) as u8;
|
||||||
u16::from(u8::try_from(Preset::COUNT).expect("`Preset::COUNT` should fit in `u8`"))
|
|
||||||
.div_ceil(
|
|
||||||
u16::from(flags_per_row)
|
|
||||||
.checked_mul(u16::from(rows_per_page))
|
|
||||||
.unwrap(),
|
|
||||||
);
|
|
||||||
let num_pages: u8 = num_pages
|
|
||||||
.try_into()
|
|
||||||
.expect("`num_pages` should fit in `u8`");
|
|
||||||
|
|
||||||
// Create pages
|
// Create pages
|
||||||
let mut pages = Vec::with_capacity(usize::from(num_pages));
|
let mut pages = Vec::with_capacity(usize::from(num_pages));
|
||||||
@@ -650,11 +646,7 @@ fn create_config(
|
|||||||
// Print cats
|
// Print cats
|
||||||
{
|
{
|
||||||
let (Width(term_w), _) = terminal_size().context("failed to get terminal size")?;
|
let (Width(term_w), _) = terminal_size().context("failed to get terminal size")?;
|
||||||
let num_cols = cmp::max(
|
let num_cols = (term_w / (test_ascii.w as u16 + 2)).clamp(1, u8::MAX.into()) as u8;
|
||||||
1,
|
|
||||||
term_w.div_euclid(u16::from(test_ascii.w).checked_add(2).unwrap()),
|
|
||||||
);
|
|
||||||
let num_cols: u8 = num_cols.try_into().expect("`num_cols` should fit in `u8`");
|
|
||||||
const MIN: f32 = 0.15;
|
const MIN: f32 = 0.15;
|
||||||
const MAX: f32 = 0.85;
|
const MAX: f32 = 0.85;
|
||||||
let ratios =
|
let ratios =
|
||||||
@@ -764,33 +756,131 @@ fn create_config(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
// 5. Color arrangement
|
// 5. Choose Default or Small Logo
|
||||||
|
|
||||||
let color_align: ColorAlignment;
|
|
||||||
|
|
||||||
// Calculate amount of row/column that can be displayed on screen
|
// Calculate amount of row/column that can be displayed on screen
|
||||||
let (ascii_per_row, ascii_rows) = {
|
let (ascii_per_row, ascii_rows) = {
|
||||||
let (Width(term_w), Height(term_h)) =
|
let (Width(term_w), Height(term_h)) = terminal_size().context("failed to get terminal size")?;
|
||||||
terminal_size().context("failed to get terminal size")?;
|
let ascii_per_row = (term_w / (asc.w as u16 + 4)).clamp(1, u8::MAX.into()) as u8;
|
||||||
let ascii_per_row = cmp::max(
|
let ascii_rows = (term_h.saturating_sub(8) / (asc.h as u16 + 1)).clamp(1, u8::MAX.into()) as u8;
|
||||||
1,
|
|
||||||
term_w.div_euclid(u16::from(asc.w).checked_add(2).unwrap()),
|
|
||||||
);
|
|
||||||
let ascii_per_row: u8 = ascii_per_row
|
|
||||||
.try_into()
|
|
||||||
.expect("`ascii_per_row` should fit in `u8`");
|
|
||||||
let ascii_rows = cmp::max(
|
|
||||||
1,
|
|
||||||
term_h
|
|
||||||
.saturating_sub(8)
|
|
||||||
.div_euclid(u16::from(asc.h).checked_add(1).unwrap()),
|
|
||||||
);
|
|
||||||
let ascii_rows: u8 = ascii_rows
|
|
||||||
.try_into()
|
|
||||||
.expect("`ascii_rows` should fit in `u8`");
|
|
||||||
(ascii_per_row, ascii_rows)
|
(ascii_per_row, ascii_rows)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// get distro string and convert it into the enum, neofetch friendly format, so we can check for small logos with the {distro}_small neofetch naming scheme.
|
||||||
|
let tmp_dst = get_distro_name(backend).or_else(|_| get_distro_name(Backend::Neofetch)).context("failed to get distro name")?;
|
||||||
|
let detected_dst = Some(distro.map_or_else(
|
||||||
|
|| format!("{:?}", Distro::detect(tmp_dst).unwrap()),
|
||||||
|
|d| d.to_string(),
|
||||||
|
));
|
||||||
|
|
||||||
|
// in case someone specified {distro}_small already in the --distro arg
|
||||||
|
let detected_dst_small_fmt = if !detected_dst.clone().unwrap().ends_with("_small") {
|
||||||
|
format!("{}_small", detected_dst.unwrap()).to_lowercase()
|
||||||
|
} else {
|
||||||
|
detected_dst.unwrap()
|
||||||
|
};
|
||||||
|
|
||||||
|
let running_dst_sml = if Distro::detect(&detected_dst_small_fmt).is_some() {
|
||||||
|
detected_dst_small_fmt
|
||||||
|
} else {
|
||||||
|
"".to_string()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// load ascii
|
||||||
|
let small_asc = get_distro_ascii(Some(&running_dst_sml), backend).context("failed to get distro ascii")?;
|
||||||
|
let small_asc = small_asc.to_normalized().context("failed to normalize ascii")?;
|
||||||
|
|
||||||
|
let mut asc = asc;
|
||||||
|
let mut logo_chosen: Option<String> = distro.cloned();
|
||||||
|
|
||||||
|
if small_asc.lines != asc.lines && running_dst_sml != "" {
|
||||||
|
let ds_arrangements = [
|
||||||
|
("Default", asc.clone()),
|
||||||
|
("Small", small_asc.clone())
|
||||||
|
];
|
||||||
|
|
||||||
|
let arrangements: IndexMap<Cow<str>, NormalizedAsciiArt> =
|
||||||
|
ds_arrangements.map(|(k, a)| (k.into(), a)).into();
|
||||||
|
|
||||||
|
loop {
|
||||||
|
clear_screen(Some(&title), color_mode, debug_mode).context("failed to clear screen")?;
|
||||||
|
|
||||||
|
let asciis: Vec<Vec<String>> = arrangements
|
||||||
|
.iter()
|
||||||
|
.map(|(k, a)| {
|
||||||
|
let mut v: Vec<String> = a
|
||||||
|
.to_recolored(&ColorAlignment::Horizontal, &color_profile, color_mode, theme)
|
||||||
|
.context("failed to recolor ascii")?
|
||||||
|
.lines;
|
||||||
|
if k == "Small" {
|
||||||
|
// vertical center
|
||||||
|
let pad_len = (asc.h as usize - v.len()) / 2;
|
||||||
|
let mut pad_v: Vec<String> = vec![];
|
||||||
|
for _ in 0..pad_len {
|
||||||
|
pad_v.push("".to_string());
|
||||||
|
}
|
||||||
|
v.splice(0..0, pad_v.clone());
|
||||||
|
v.extend(pad_v);
|
||||||
|
|
||||||
|
let pad_diff = asc.h as usize - v.len();
|
||||||
|
v.extend(std::iter::repeat("".to_string()).take(pad_diff));
|
||||||
|
v.push(format!("{k:^asc_width$}", asc_width = usize::from(small_asc.w)));
|
||||||
|
return Ok(v);
|
||||||
|
}
|
||||||
|
v.push(format!("{k:^asc_width$}", asc_width = usize::from(asc.w)));
|
||||||
|
Ok(v)
|
||||||
|
})
|
||||||
|
.collect::<Result<_>>()?;
|
||||||
|
|
||||||
|
// prints small logo w/ big logo
|
||||||
|
for row in &asciis.into_iter().chunks(usize::from(ascii_per_row)) {
|
||||||
|
|
||||||
|
let row: Vec<Vec<String>> = row.collect();
|
||||||
|
|
||||||
|
for i in 0..usize::from(asc.h).checked_add(1).unwrap() {
|
||||||
|
let mut line = Vec::new();
|
||||||
|
for lines in &row {
|
||||||
|
line.push(&*lines[i]);
|
||||||
|
}
|
||||||
|
printc(line.join(" "), color_mode).context("failed to print ascii line")?;
|
||||||
|
}
|
||||||
|
|
||||||
|
writeln!(io::stdout()).context("failed to write to stdout")?;
|
||||||
|
}
|
||||||
|
|
||||||
|
print_title_prompt(
|
||||||
|
option_counter,
|
||||||
|
"Do you want the default logo, or the small logo?",
|
||||||
|
color_mode,
|
||||||
|
)
|
||||||
|
.context("failed to print title prompt")?;
|
||||||
|
let opts: Vec<Cow<str>> = ["default", "small"].map(Into::into).into();
|
||||||
|
let choice = literal_input("Your choice?", &opts[..], "default", true, color_mode)
|
||||||
|
.context("failed to ask for choice input")
|
||||||
|
.context("failed to select logo type").context("failed to ask for choice input")?;
|
||||||
|
|
||||||
|
if choice.to_lowercase() == "small" {
|
||||||
|
logo_chosen = Some(running_dst_sml);
|
||||||
|
asc = small_asc;
|
||||||
|
}
|
||||||
|
|
||||||
|
update_title(
|
||||||
|
&mut title,
|
||||||
|
&mut option_counter,
|
||||||
|
"Selected logo type",
|
||||||
|
choice.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////
|
||||||
|
// 6. Color arrangement
|
||||||
|
|
||||||
|
let color_align: ColorAlignment;
|
||||||
|
|
||||||
// Displays horizontal and vertical arrangements in the first iteration, but
|
// Displays horizontal and vertical arrangements in the first iteration, but
|
||||||
// hide them in later iterations
|
// hide them in later iterations
|
||||||
let hv_arrangements = [
|
let hv_arrangements = [
|
||||||
@@ -821,24 +911,16 @@ fn create_config(
|
|||||||
clear_screen(Some(&title), color_mode, debug_mode).context("failed to clear screen")?;
|
clear_screen(Some(&title), color_mode, debug_mode).context("failed to clear screen")?;
|
||||||
|
|
||||||
// Random color schemes
|
// Random color schemes
|
||||||
let mut preset_indices: Vec<PresetIndexedColor> =
|
let mut preset_indices: Vec<PresetIndexedColor> = (0..color_profile.unique_colors().colors.len()).map(|x| (x as u8).into()).collect();
|
||||||
(0..color_profile.unique_colors().colors.len())
|
|
||||||
.map(|pi| u8::try_from(pi).expect("`pi` should fit in `u8`").into())
|
|
||||||
.collect();
|
|
||||||
while preset_indices.len() < slots.len() {
|
while preset_indices.len() < slots.len() {
|
||||||
preset_indices.extend_from_within(0..);
|
preset_indices.extend_from_within(0..);
|
||||||
}
|
}
|
||||||
let preset_index_permutations: IndexSet<Vec<PresetIndexedColor>> = preset_indices
|
let preset_index_permutations: IndexSet<Vec<PresetIndexedColor>> = preset_indices
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.permutations(slots.len())
|
.permutations(slots.len())
|
||||||
|
.take(1000)
|
||||||
.collect();
|
.collect();
|
||||||
let random_count = u16::from(ascii_per_row)
|
let random_count = (ascii_per_row as usize * ascii_rows as usize).saturating_sub(arrangements.len()).clamp(0, u8::MAX.into()) as u8;
|
||||||
.checked_mul(u16::from(ascii_rows))
|
|
||||||
.unwrap()
|
|
||||||
.saturating_sub(u8::try_from(arrangements.len()).unwrap().into());
|
|
||||||
let random_count: u8 = random_count
|
|
||||||
.try_into()
|
|
||||||
.expect("`random_count` should fit in `u8`");
|
|
||||||
let choices: IndexSet<Vec<PresetIndexedColor>> =
|
let choices: IndexSet<Vec<PresetIndexedColor>> =
|
||||||
if usize::from(random_count) > preset_index_permutations.len() {
|
if usize::from(random_count) > preset_index_permutations.len() {
|
||||||
preset_index_permutations
|
preset_index_permutations
|
||||||
@@ -885,7 +967,7 @@ fn create_config(
|
|||||||
for lines in &row {
|
for lines in &row {
|
||||||
line.push(&*lines[i]);
|
line.push(&*lines[i]);
|
||||||
}
|
}
|
||||||
printc(line.join(" "), color_mode).context("failed to print ascii line")?;
|
printc(line.join(" "), color_mode).context("failed to print ascii line")?;
|
||||||
}
|
}
|
||||||
writeln!(io::stdout()).context("failed to write to stdout")?;
|
writeln!(io::stdout()).context("failed to write to stdout")?;
|
||||||
}
|
}
|
||||||
@@ -936,7 +1018,7 @@ fn create_config(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
// 6. Select *fetch backend
|
// 7. Select *fetch backend
|
||||||
|
|
||||||
let select_backend = || -> Result<Backend> {
|
let select_backend = || -> Result<Backend> {
|
||||||
clear_screen(Some(&title), color_mode, debug_mode).context("failed to clear screen")?;
|
clear_screen(Some(&title), color_mode, debug_mode).context("failed to clear screen")?;
|
||||||
@@ -1001,12 +1083,13 @@ fn create_config(
|
|||||||
let config = Config {
|
let config = Config {
|
||||||
preset,
|
preset,
|
||||||
mode: color_mode,
|
mode: color_mode,
|
||||||
light_dark: theme,
|
light_dark: Some(theme),
|
||||||
|
auto_detect_light_dark: Some(det_bg.is_some()),
|
||||||
lightness: Some(lightness),
|
lightness: Some(lightness),
|
||||||
color_align,
|
color_align,
|
||||||
backend,
|
backend,
|
||||||
args: None,
|
args: None,
|
||||||
distro: distro.cloned(),
|
distro: logo_chosen,
|
||||||
pride_month_disable: false,
|
pride_month_disable: false,
|
||||||
};
|
};
|
||||||
debug!(?config, "created config");
|
debug!(?config, "created config");
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ pub struct Options {
|
|||||||
pub print_font_logo: bool,
|
pub print_font_logo: bool,
|
||||||
pub test_print: bool,
|
pub test_print: bool,
|
||||||
pub ask_exit: bool,
|
pub ask_exit: bool,
|
||||||
|
pub auto_detect_light_dark: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn options() -> OptionParser<Options> {
|
pub fn options() -> OptionParser<Options> {
|
||||||
@@ -170,6 +171,10 @@ BACKEND={{{backends}}}",
|
|||||||
.help("Ask for input before exiting")
|
.help("Ask for input before exiting")
|
||||||
.switch()
|
.switch()
|
||||||
.hide();
|
.hide();
|
||||||
|
let auto_detect_light_dark = long("auto-detect-light-dark")
|
||||||
|
.help("Enables hyfetch to detect light/dark terminal background in runtime")
|
||||||
|
.argument("BOOL")
|
||||||
|
.optional();
|
||||||
|
|
||||||
construct!(Options {
|
construct!(Options {
|
||||||
config,
|
config,
|
||||||
@@ -188,6 +193,7 @@ BACKEND={{{backends}}}",
|
|||||||
// hidden
|
// hidden
|
||||||
test_print,
|
test_print,
|
||||||
ask_exit,
|
ask_exit,
|
||||||
|
auto_detect_light_dark,
|
||||||
})
|
})
|
||||||
.to_options()
|
.to_options()
|
||||||
.header(
|
.header(
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ use crate::types::Backend;
|
|||||||
use crate::utils::get_cache_path;
|
use crate::utils::get_cache_path;
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs::{self, File};
|
use std::fs::{File};
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
|
|
||||||
const FONT_LOGOS: &str = include_str!("../../../hyfetch/data/font_logos.json");
|
const FONT_LOGOS: &str = include_str!(concat!(env!("OUT_DIR"), "/hyfetch/data/font_logos.json"));
|
||||||
|
|
||||||
pub fn get_font_logo(backend: Backend) -> Result<String> {
|
pub fn get_font_logo(backend: Backend) -> Result<String> {
|
||||||
// Check if the cache file exists and return its contents if it does
|
// Check if the cache file exists and return its contents if it does
|
||||||
@@ -34,11 +34,6 @@ pub fn get_font_logo(backend: Backend) -> Result<String> {
|
|||||||
|
|
||||||
let logo = font_logos.get(matched_distro).unwrap();
|
let logo = font_logos.get(matched_distro).unwrap();
|
||||||
|
|
||||||
// Create parent directories for the cache if they don't exist
|
|
||||||
if let Some(parent) = cache_path.parent() {
|
|
||||||
fs::create_dir_all(parent).context("Failed to create cache directory")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write the logo to the cache file
|
// Write the logo to the cache file
|
||||||
let mut cache_file = File::create(cache_path).context("Failed to create cache file")?;
|
let mut cache_file = File::create(cache_path).context("Failed to create cache file")?;
|
||||||
cache_file.write_all(logo.as_bytes()).context("Failed to write logo to cache file")?;
|
cache_file.write_all(logo.as_bytes()).context("Failed to write logo to cache file")?;
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ use crate::types::{AnsiMode, Backend, TerminalTheme};
|
|||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub preset: Preset,
|
pub preset: Preset,
|
||||||
pub mode: AnsiMode,
|
pub mode: AnsiMode,
|
||||||
pub light_dark: TerminalTheme,
|
pub auto_detect_light_dark: Option<bool>,
|
||||||
|
pub light_dark: Option<TerminalTheme>,
|
||||||
pub lightness: Option<Lightness>,
|
pub lightness: Option<Lightness>,
|
||||||
pub color_align: ColorAlignment,
|
pub color_align: ColorAlignment,
|
||||||
pub backend: Backend,
|
pub backend: Backend,
|
||||||
@@ -31,11 +32,6 @@ impl Config {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lightness(&self) -> Lightness {
|
|
||||||
self.lightness
|
|
||||||
.unwrap_or_else(|| Self::default_lightness(self.light_dark))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mod args_serde {
|
mod args_serde {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::ffi::OsStr;
|
|||||||
#[cfg(feature = "macchina")]
|
#[cfg(feature = "macchina")]
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{self, Write as _};
|
use std::io::{self, Write as _};
|
||||||
use std::path::{PathBuf};
|
use std::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use std::{env, fmt};
|
use std::{env, fmt};
|
||||||
@@ -53,7 +53,7 @@ _/\_\_ _/_/\_
|
|||||||
pub const NEOFETCH_COLOR_PATTERNS: [&str; 6] =
|
pub const NEOFETCH_COLOR_PATTERNS: [&str; 6] =
|
||||||
["${c1}", "${c2}", "${c3}", "${c4}", "${c5}", "${c6}"];
|
["${c1}", "${c2}", "${c3}", "${c4}", "${c5}", "${c6}"];
|
||||||
pub static NEOFETCH_COLORS_AC: OnceLock<AhoCorasick> = OnceLock::new();
|
pub static NEOFETCH_COLORS_AC: OnceLock<AhoCorasick> = OnceLock::new();
|
||||||
pub const NEOFETCH_SCRIPT: &str = include_str!("../../../neofetch");
|
pub const NEOFETCH_SCRIPT: &str = include_str!(concat!(env!("OUT_DIR"), "/neofetch"));
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq, Debug, AsRefStr, Deserialize, Serialize)]
|
#[derive(Clone, Eq, PartialEq, Debug, AsRefStr, Deserialize, Serialize)]
|
||||||
#[serde(tag = "mode")]
|
#[serde(tag = "mode")]
|
||||||
@@ -438,6 +438,7 @@ where
|
|||||||
debug!(?ff_path, "fastfetch path");
|
debug!(?ff_path, "fastfetch path");
|
||||||
|
|
||||||
let mut command = Command::new(ff_path);
|
let mut command = Command::new(ff_path);
|
||||||
|
command.env("FFTS_IGNORE_PARENT", "1");
|
||||||
command.args(args);
|
command.args(args);
|
||||||
Ok(command)
|
Ok(command)
|
||||||
}
|
}
|
||||||
@@ -481,20 +482,12 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "debug")]
|
#[tracing::instrument(level = "debug")]
|
||||||
pub(crate) fn get_distro_name(backend: Backend) -> Result<String> {
|
pub fn get_distro_name(backend: Backend) -> Result<String> {
|
||||||
match backend {
|
match backend {
|
||||||
Backend::Neofetch => run_neofetch_command_piped(&["ascii_distro_name"])
|
Backend::Neofetch => run_neofetch_command_piped(&["ascii_distro_name"])
|
||||||
.context("failed to get distro name from neofetch"),
|
.context("failed to get distro name from neofetch"),
|
||||||
Backend::Fastfetch => run_fastfetch_command_piped(&[
|
Backend::Fastfetch => Ok(run_fastfetch_command_piped(&["--logo", "none", "-c", "none", "-s", "OS",])
|
||||||
"--logo",
|
.context("failed to get distro name from fastfetch")?.replace("OS: ", "")),
|
||||||
"none",
|
|
||||||
"-s",
|
|
||||||
"OS",
|
|
||||||
"--disable-linewrap",
|
|
||||||
"--os-key",
|
|
||||||
" ",
|
|
||||||
])
|
|
||||||
.context("failed to get distro name from fastfetch"),
|
|
||||||
#[cfg(feature = "macchina")]
|
#[cfg(feature = "macchina")]
|
||||||
Backend::Macchina => {
|
Backend::Macchina => {
|
||||||
// Write ascii art to temp file
|
// Write ascii art to temp file
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ pub enum Preset {
|
|||||||
|
|
||||||
Aromantic,
|
Aromantic,
|
||||||
|
|
||||||
|
Fictosexual,
|
||||||
|
|
||||||
Aroace1,
|
Aroace1,
|
||||||
|
|
||||||
Aroace2,
|
Aroace2,
|
||||||
@@ -111,6 +113,10 @@ pub enum Preset {
|
|||||||
|
|
||||||
Genderflux,
|
Genderflux,
|
||||||
|
|
||||||
|
Nullflux,
|
||||||
|
|
||||||
|
Hypergender, Hyperboy, Hypergirl, Hyperandrogyne, Hyperneutrois,
|
||||||
|
|
||||||
Finsexual,
|
Finsexual,
|
||||||
|
|
||||||
Unlabeled1,
|
Unlabeled1,
|
||||||
@@ -165,6 +171,8 @@ pub enum Preset {
|
|||||||
|
|
||||||
Twink,
|
Twink,
|
||||||
|
|
||||||
|
Adipophilia,
|
||||||
|
|
||||||
Kenochoric,
|
Kenochoric,
|
||||||
|
|
||||||
Veldian,
|
Veldian,
|
||||||
@@ -203,6 +211,11 @@ pub enum Preset {
|
|||||||
|
|
||||||
Genderqueer,
|
Genderqueer,
|
||||||
|
|
||||||
|
Cisgender,
|
||||||
|
|
||||||
|
/// Colors from Gilbert Baker's original 1978 flag design
|
||||||
|
Baker,
|
||||||
|
|
||||||
/// Meme flag
|
/// Meme flag
|
||||||
Beiyang,
|
Beiyang,
|
||||||
|
|
||||||
@@ -214,8 +227,8 @@ pub enum Preset {
|
|||||||
#[strum(serialize = "throatlozenges")]
|
#[strum(serialize = "throatlozenges")]
|
||||||
ThroatLozenges,
|
ThroatLozenges,
|
||||||
|
|
||||||
/// Colors from Gilbert Baker's original 1978 flag design
|
/// Meme flag
|
||||||
Baker,
|
Band,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||||
@@ -299,6 +312,11 @@ impl Preset {
|
|||||||
"#3BA740", "#A8D47A", "#FFFFFF", "#ABABAB", "#000000",
|
"#3BA740", "#A8D47A", "#FFFFFF", "#ABABAB", "#000000",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
// https://orientation.fandom.com/wiki/Fictosexual
|
||||||
|
Self::Fictosexual => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#000000", "#C4C4C4", "#A349A5", "#C4C4C4", "#000000",
|
||||||
|
]),
|
||||||
|
|
||||||
// sourced from https://flag.library.lgbt/flags/aroace/
|
// sourced from https://flag.library.lgbt/flags/aroace/
|
||||||
Self::Aroace1 => ColorProfile::from_hex_colors(vec![
|
Self::Aroace1 => ColorProfile::from_hex_colors(vec![
|
||||||
"#E28C00", "#ECCD00", "#FFFFFF", "#62AEDC", "#203856",
|
"#E28C00", "#ECCD00", "#FFFFFF", "#62AEDC", "#203856",
|
||||||
@@ -428,6 +446,30 @@ impl Preset {
|
|||||||
"f47694", "f2a2b9", "cecece", "7ce0f7", "3ecdf9", "fff48d",
|
"f47694", "f2a2b9", "cecece", "7ce0f7", "3ecdf9", "fff48d",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
Self::Nullflux => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#0B0C0E", "#A28DB9", "#E1D4EF", "#F0E6DD", "#665858",
|
||||||
|
]),
|
||||||
|
|
||||||
|
Self::Hypergender => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#EFEFEF", "#FFFFFF", "#FBFF75", "#000000", "#FBFF75", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
|
Self::Hyperboy => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#EFEFEF", "#FFFFFF", "#74D7FE", "#000000", "#74D7FE", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
|
Self::Hypergirl => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#EFEFEF", "#FFFFFF", "#FC76D3", "#000000", "#FC76D3", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
|
Self::Hyperandrogyne => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#EFEFEF", "#FFFFFF", "#BB83FF", "#000000", "#BB83FF", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
|
Self::Hyperneutrois => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#EFEFEF", "#FFFFFF", "#BAFA74", "#000000", "#BAFA74", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
// sourced from https://lgbtqia.wiki/wiki/Finsexual
|
// sourced from https://lgbtqia.wiki/wiki/Finsexual
|
||||||
Self::Finsexual => ColorProfile::from_hex_colors(vec![
|
Self::Finsexual => ColorProfile::from_hex_colors(vec![
|
||||||
"#B18EDF", "#D7B1E2", "#F7CDE9", "#F39FCE", "#EA7BB3",
|
"#B18EDF", "#D7B1E2", "#F7CDE9", "#F39FCE", "#EA7BB3",
|
||||||
@@ -538,6 +580,11 @@ impl Preset {
|
|||||||
// colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
// colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
||||||
Self::Twink => ColorProfile::from_hex_colors(vec!["#FFB2FF", "#FFFFFF", "#FFFF81"]),
|
Self::Twink => ColorProfile::from_hex_colors(vec!["#FFB2FF", "#FFFFFF", "#FFFF81"]),
|
||||||
|
|
||||||
|
// https://en.wikipedia.org/wiki/File:FatFetishFlag.png
|
||||||
|
Self::Adipophilia => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#000000", "#E16180", "#FFF9BE", "#603E41", "#000000",
|
||||||
|
]),
|
||||||
|
|
||||||
Self::Kenochoric => {
|
Self::Kenochoric => {
|
||||||
ColorProfile::from_hex_colors(vec!["#000000", "#2E1569", "#824DB7", "#C7A1D6"])
|
ColorProfile::from_hex_colors(vec!["#000000", "#2E1569", "#824DB7", "#C7A1D6"])
|
||||||
},
|
},
|
||||||
@@ -611,9 +658,18 @@ impl Preset {
|
|||||||
"#FFECA0", "#FFFFFF", "#FFECA0", "#38087A", "#BCEC64",
|
"#FFECA0", "#FFFFFF", "#FFECA0", "#38087A", "#BCEC64",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
Self::Genderqueer => {
|
Self::Genderqueer => ColorProfile::from_hex_colors(vec![
|
||||||
ColorProfile::from_hex_colors(vec!["#B57EDC", "#FFFFFF", "#4A8123"])
|
"#B57EDC", "#FFFFFF", "#4A8123"
|
||||||
},
|
]),
|
||||||
|
|
||||||
|
Self::Cisgender => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#D70270", "#0038A7"
|
||||||
|
]),
|
||||||
|
|
||||||
|
// used https://gilbertbaker.com/rainbow-flag-color-meanings/ as source and colorpicked
|
||||||
|
Self::Baker => ColorProfile::from_hex_colors(vec![
|
||||||
|
"#F23D9E", "#F80A24", "#F78022", "#F9E81F", "#1E972E", "#1B86BC", "#243897", "#6F0A82",
|
||||||
|
]),
|
||||||
|
|
||||||
Self::Beiyang => ColorProfile::from_hex_colors(vec![
|
Self::Beiyang => ColorProfile::from_hex_colors(vec![
|
||||||
"#DF1B12", "#FFC600", "#01639D", "#FFFFFF", "#000000",
|
"#DF1B12", "#FFC600", "#01639D", "#FFFFFF", "#000000",
|
||||||
@@ -627,11 +683,10 @@ impl Preset {
|
|||||||
"#2759DA", "#03940D", "#F5F100", "#F59B00", "#B71212",
|
"#2759DA", "#03940D", "#F5F100", "#F59B00", "#B71212",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// used https://gilbertbaker.com/rainbow-flag-color-meanings/ as source and colorpicked
|
Self::Band => ColorProfile::from_hex_colors(vec![
|
||||||
Self::Baker => ColorProfile::from_hex_colors(vec![
|
"#2670C0", "#F5BD00", "#DC0045", "#E0608E"
|
||||||
"#F23D9E", "#F80A24", "#F78022", "#F9E81F", "#1E972E", "#1B86BC", "#243897",
|
|
||||||
"#6F0A82",
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
})
|
})
|
||||||
.expect("preset color profiles should be valid")
|
.expect("preset color profiles should be valid")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,11 +307,13 @@ pub fn start_animation(color_mode: AnsiMode) -> Result<()> {
|
|||||||
let mut frame: Wrapping<usize> = Wrapping(0);
|
let mut frame: Wrapping<usize> = Wrapping(0);
|
||||||
|
|
||||||
const SPEED: u8 = 2;
|
const SPEED: u8 = 2;
|
||||||
let frame_delay = Duration::from_secs_f32(1.0 / 25.0);
|
let frame_delay = Duration::from_secs_f32(2.0 / 25.0);
|
||||||
|
|
||||||
execute!(io::stdout(), EnterAlternateScreen).context("failed to enter alternate screen")?;
|
execute!(io::stdout(), EnterAlternateScreen).context("failed to enter alternate screen")?;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
// Move cursor to the top left corner
|
||||||
|
print!("\x1B[H");
|
||||||
draw_frame(frame.0)?;
|
draw_frame(frame.0)?;
|
||||||
frame += usize::from(SPEED);
|
frame += usize::from(SPEED);
|
||||||
thread::sleep(frame_delay);
|
thread::sleep(frame_delay);
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ pub enum TerminalTheme {
|
|||||||
Dark,
|
Dark,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for TerminalTheme {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::Dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Copy,
|
Copy,
|
||||||
Clone,
|
Clone,
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ pub fn get_cache_path() -> Result<PathBuf> {
|
|||||||
.context("failed to get base dirs")?
|
.context("failed to get base dirs")?
|
||||||
.cache_dir()
|
.cache_dir()
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
||||||
|
// Make sure the cache directory exists
|
||||||
|
if !path.exists() {
|
||||||
|
fs::create_dir_all(&path).with_context(|| format!("failed to create cache dir {path:?}"))?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(path)
|
Ok(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+38
-37
@@ -1,78 +1,79 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH VERSION "1" "October 2024" "Version is 1.99.0" "User Commands"
|
.TH VERSION: "1" "September 2025" "Version: 2.0.2" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Version \- manual page for Version is 1.99.0
|
Version: \- manual page for Version: 2.0.2
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B hyfetch
|
||||||
|
[\fI\,-c\/\fR] [\fI\,-C=CONFIG_FILE\/\fR] [\fI\,-p=PRESET\/\fR] [\fI\,-m=MODE\/\fR] [\fI\,-b=BACKEND\/\fR] [\fI\,--args=ARGS\/\fR] [\fI\,--c-scale=\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
usage: hyfetch [\-h] [\-c] [\-C CONFIG_FILE]
|
SCALE] [\-\-c\-set\-l=LIGHTNESS] [\-\-june] [\-\-debug] ([\-\-distro=DISTRO] | [\-\-test\-distro=DISTRO]) [
|
||||||
.IP
|
\fB\-\-ascii\-file\fR=\fI\,ASCII_FILE]\/\fR [\-\-print\-font\-logo] [\-\-auto\-detect\-light\-dark=BOOL]
|
||||||
[\-p {rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,girlflux,genderflux,finsexual,unlabeled1,unlabeled2,pangender,pangender.contrast,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,plural,fraysexual,bear,butch,leather,otter,twink,kenochoric,veldian,solian,lunian,polyam,sapphic,androgyne,interprogress,progress,intersex,old\-polyam,equal\-rights,drag,pronounfluid,pronounflux,exipronoun,neopronoun,neofluid,genderqueer,beiyang,burger,baker,caninekin,random}]
|
|
||||||
[\-m {8bit,rgb}]
|
|
||||||
[\-b {qwqfetch,neofetch,fastfetch,fastfetch\-old}] [\-\-args ARGS]
|
|
||||||
[\-\-c\-scale SCALE] [\-\-c\-set\-l LIGHT] [\-\-c\-overlay] [\-V] [\-\-june]
|
|
||||||
[\-\-debug] [\-\-distro DISTRO] [\-\-ascii\-file ASCII_FILE]
|
|
||||||
[\-\-print\-font\-logo]
|
|
||||||
.PP
|
.PP
|
||||||
[1m[38;5;14mhyfetch[39m[22m \- neofetch with flags <3
|
[1m[38;5;14mhyfetch[39m[22m \- neofetch with flags <3
|
||||||
.SS "options:"
|
.SS "Available options:"
|
||||||
.TP
|
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
|
||||||
show this help message and exit
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-c\fR, \fB\-\-config\fR
|
\fB\-c\fR, \fB\-\-config\fR
|
||||||
Configure hyfetch
|
Configure hyfetch
|
||||||
.TP
|
.TP
|
||||||
\fB\-C\fR CONFIG_FILE, \fB\-\-config\-file\fR CONFIG_FILE
|
\fB\-C\fR, \fB\-\-config\-file\fR=\fI\,CONFIG_FILE\/\fR
|
||||||
Use another config file
|
Use another config file
|
||||||
|
[default: "/home/azalea/.config/hyfetch.json"]
|
||||||
.TP
|
.TP
|
||||||
\fB\-p\fR {rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,girlflux,genderflux,finsexual,unlabeled1,unlabeled2,pangender,pangender.contrast,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,plural,fraysexual,bear,butch,leather,otter,twink,kenochoric,veldian,solian,lunian,polyam,sapphic,androgyne,interprogress,progress,intersex,old\-polyam,equal\-rights,drag,pronounfluid,pronounflux,exipronoun,neopronoun,neofluid,genderqueer,beiyang,burger,baker,caninekin,random}, \fB\-\-preset\fR {rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,autoromantic,boyflux2,girlflux,genderflux,finsexual,unlabeled1,unlabeled2,pangender,pangender.contrast,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,plural,fraysexual,bear,butch,leather,otter,twink,kenochoric,veldian,solian,lunian,polyam,sapphic,androgyne,interprogress,progress,intersex,old\-polyam,equal\-rights,drag,pronounfluid,pronounflux,exipronoun,neopronoun,neofluid,genderqueer,beiyang,burger,baker,caninekin,random}
|
\fB\-p\fR, \fB\-\-preset\fR=\fI\,PRESET\/\fR
|
||||||
Use preset
|
Use preset
|
||||||
|
PRESET={rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,fictosexual,aroace1,aroace2,aroace3,greysexual,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,autoromantic,boyflux2,girlflux,genderflux,nullflux,hypergender,hyperboy,hypergirl,hyperandrogyne,hyperneutrois,finsexual,unlabeled1,unlabeled2,pangender,pangender.contrast,gendernonconforming1,gendernonconforming2,femboy,tomboy,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,caninekin,plural,fraysexual,bear,butch,leather,otter,twink,adipophilia,kenochoric,veldian,solian,lunian,polyam,sapphic,androgyne,interprogress,progress,intersex,old\-polyam,equal\-rights,drag,pronounfluid,pronounflux,exipronoun,neopronoun,neofluid,genderqueer,cisgender,baker,beiyang,burger,throatlozenges,band,random}
|
||||||
.TP
|
.TP
|
||||||
\fB\-m\fR {8bit,rgb}, \fB\-\-mode\fR {8bit,rgb}
|
\fB\-m\fR, \fB\-\-mode\fR=\fI\,MODE\/\fR
|
||||||
Color mode
|
Color mode MODE={8bit,rgb}
|
||||||
.TP
|
.TP
|
||||||
\fB\-b\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}, \fB\-\-backend\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}
|
\fB\-b\fR, \fB\-\-backend\fR=\fI\,BACKEND\/\fR
|
||||||
Choose a *fetch backend
|
Choose a *fetch backend BACKEND={neofetch,fastfetch,macchina}
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-args\fR ARGS
|
\fB\-\-args\fR=\fI\,ARGS\/\fR
|
||||||
Additional arguments pass\-through to backend
|
Additional arguments pass\-through to backend
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-c\-scale\fR SCALE
|
\fB\-\-c\-scale\fR=\fI\,SCALE\/\fR
|
||||||
Lighten colors by a multiplier
|
Lighten colors by a multiplier
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-c\-set\-l\fR LIGHT
|
\fB\-\-c\-set\-l\fR=\fI\,LIGHTNESS\/\fR
|
||||||
Set lightness value of the colors
|
Set lightness value of the colors
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-c\-overlay\fR
|
|
||||||
Use experimental overlay color adjusting instead of
|
|
||||||
HSL lightness
|
|
||||||
.TP
|
|
||||||
\fB\-V\fR, \fB\-\-version\fR
|
|
||||||
Check version
|
|
||||||
.TP
|
|
||||||
\fB\-\-june\fR
|
\fB\-\-june\fR
|
||||||
Show pride month easter egg
|
Show pride month easter egg
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-debug\fR
|
\fB\-\-debug\fR
|
||||||
Debug mode
|
Debug mode
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-distro\fR DISTRO, \fB\-\-test\-distro\fR DISTRO
|
\fB\-\-distro\fR=\fI\,DISTRO\/\fR
|
||||||
Test for a specific distro
|
Test for a specific distro
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-ascii\-file\fR ASCII_FILE
|
\fB\-\-test\-distro\fR=\fI\,DISTRO\/\fR
|
||||||
|
Test for a specific distro
|
||||||
|
.TP
|
||||||
|
\fB\-\-ascii\-file\fR=\fI\,ASCII_FILE\/\fR
|
||||||
Use a specific file for the ascii art
|
Use a specific file for the ascii art
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-print\-font\-logo\fR
|
\fB\-\-print\-font\-logo\fR
|
||||||
Print the Font Logo / Nerd Font icon of your distro
|
Print the Font Logo / Nerd Font icon of your distro and exit
|
||||||
and exit
|
.TP
|
||||||
|
\fB\-\-auto\-detect\-light\-dark\fR=\fI\,BOOL\/\fR
|
||||||
|
Enables hyfetch to detect light/dark terminal background in
|
||||||
|
runtime
|
||||||
|
.TP
|
||||||
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
|
Prints help information
|
||||||
|
.TP
|
||||||
|
\fB\-V\fR, \fB\-\-version\fR
|
||||||
|
Prints version information
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
The full documentation for
|
The full documentation for
|
||||||
.B Version
|
.B Version:
|
||||||
is maintained as a Texinfo manual. If the
|
is maintained as a Texinfo manual. If the
|
||||||
.B info
|
.B info
|
||||||
and
|
and
|
||||||
.B Version
|
.B Version:
|
||||||
programs are properly installed at your site, the command
|
programs are properly installed at your site, the command
|
||||||
.IP
|
.IP
|
||||||
.B info Version
|
.B info Version:
|
||||||
.PP
|
.PP
|
||||||
should give you access to the complete manual.
|
should give you access to the complete manual.
|
||||||
|
|||||||
+38
-39
@@ -1,7 +1,7 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH NEOFETCH "1" "October 2024" "Neofetch 7.98.0" "User Commands"
|
.TH NEOFETCH "1" "September 2025" "Neofetch 8.0.2" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Neofetch \- manual page for Neofetch 7.98.0
|
Neofetch \- manual page for Neofetch 8.0.2
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B neofetch
|
.B neofetch
|
||||||
\fI\,func_name --option "value" --option "value"\/\fR
|
\fI\,func_name --option "value" --option "value"\/\fR
|
||||||
@@ -321,12 +321,12 @@ Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS, Aperio
|
|||||||
GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
||||||
archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike,
|
archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike,
|
||||||
ArcoLinux, Arkane, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS,
|
ArcoLinux, Arkane, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS,
|
||||||
Astra Linux, Athena, azos, Bedrock, BigLinux, BigLinux_large,
|
Astra Linux, Athena, azos, Bazzite, Bedrock, BigLinux,
|
||||||
Bitrig, BlackArch, BlackMesa, blackPanther, BLAG, BlankOn,
|
BigLinux_large, Bitrig, BlackArch, BlackMesa, blackPanther, BLAG,
|
||||||
BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate,
|
BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS,
|
||||||
CalinixOS, Carbs, CBL\-Mariner, CelOS, Center, CentOS, Chakra,
|
Calculate, CalinixOS, Carbs, CBL\-Mariner, CelOS, Center, CentOS,
|
||||||
ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro, Clear
|
Chakra, ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro,
|
||||||
Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
Clear Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
||||||
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
||||||
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
||||||
digital UNIX, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
digital UNIX, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
||||||
@@ -335,37 +335,36 @@ EvolutionOS, eweOS, Exherbo, Exodia Predator OS, Fedora, Fedora
|
|||||||
Kinoite, Fedora Sericea, Fedora Silverblue, Fedora_unicode,
|
Kinoite, Fedora Sericea, Fedora Silverblue, Fedora_unicode,
|
||||||
FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware,
|
FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware,
|
||||||
Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||||
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
Gloire, gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang,
|
||||||
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||||
Hyperbola, iglunix, instantOS, Interix, IRIX, Ironclad, Itc,
|
Hyperbola, iglunix, instantOS, Interix, IRIX, Itc, januslinux,
|
||||||
januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux,
|
||||||
KrassOS, KSLinux, Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE,
|
Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire,
|
||||||
LibreELEC, Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old,
|
Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch,
|
||||||
LinuxFromScratch, Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS,
|
Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix,
|
||||||
Mageia, Magix, MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS,
|
MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui,
|
||||||
MatuusOS, Maui, Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib,
|
Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune,
|
||||||
NekOS, Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful,
|
NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD,
|
||||||
Nobara, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open
|
Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media
|
||||||
Source Media Center, OpenBSD, openEuler, OpenIndiana, openKylin,
|
Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba,
|
||||||
openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE Leap,
|
OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
||||||
openSUSE Tumbleweed, OPNsense, Oracle, orchid, OS Elbrus, PacBSD,
|
Tumbleweed, openSUSE Tumbleweed\-Slowroll, OPNsense, Oracle, orchid,
|
||||||
Panwah, Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS,
|
OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, Parrot, Parsix,
|
||||||
pearOS, Pengwin, Pentoo, Peppermint, Peropesis, phyOS, PikaOS, Pisi,
|
PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Peropesis,
|
||||||
PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX,
|
phyOS, PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS,
|
||||||
Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix,
|
Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes,
|
||||||
Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted
|
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||||
Devuan, Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage,
|
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
||||||
Sailfish, SalentOS, Salient OS, Salix, Sasanqua, Scientific, semc,
|
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
||||||
Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel,
|
OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
||||||
Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star,
|
ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS,
|
||||||
SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra,
|
Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin,
|
||||||
TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie,
|
SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore, Trisquel,
|
||||||
Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu
|
Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin,
|
||||||
Sway, Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux,
|
Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu\-GNOME,
|
||||||
unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla,
|
ubuntu_old02, Ultramarine Linux, unicodearch, Univalent, Univention,
|
||||||
Venom, VNux, Void, VzLinux, wii\-linux\-ngx, Windows, Windows 10,
|
Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii\-linuxngx, Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2,
|
||||||
Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS,
|
XFerience, Xray_OS, Xubuntu, yiffOS, Zorin have ascii logos.
|
||||||
Xubuntu, yiffOS, Zorin have ascii logos.
|
|
||||||
.TP
|
.TP
|
||||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||||
have 'old' logo variants, use {distro}_old to use them.
|
have 'old' logo variants, use {distro}_old to use them.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
VERSION = '1.99.0'
|
VERSION = '2.0.2'
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
"Alpine": "",
|
"Alpine": "",
|
||||||
"AOSC OS": "",
|
"AOSC OS": "",
|
||||||
"Apple": "",
|
"Apple": "",
|
||||||
|
"macOS": "",
|
||||||
|
"iOS": "",
|
||||||
"Archcraft": "",
|
"Archcraft": "",
|
||||||
"ArchLabs": "",
|
"ArchLabs": "",
|
||||||
"Arch": "",
|
"Arch": "",
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
bazzite = AsciiArt(match=r'''"Bazzite"*''', color='5 5', ascii=r"""
|
||||||
|
${c1} %%%%%%====%%%%%%%%%%
|
||||||
|
%%%%%%%% %%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%%%###
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%######
|
||||||
|
== =======######
|
||||||
|
== =========#####
|
||||||
|
%%%%%%%%% %%%%%%%####======#####
|
||||||
|
%%%%%%%%% %%%%%#######=====#####
|
||||||
|
%%%%%%%%% %%%#########=====#####
|
||||||
|
%%%%%%%%% %%##########=====#####
|
||||||
|
%%%%%%%%%====###########=====######
|
||||||
|
%%%%%%%%====#########======######
|
||||||
|
%%%%%%%=====#####========######
|
||||||
|
%%%%###===============#######
|
||||||
|
%#######==========#########
|
||||||
|
#######################
|
||||||
|
###################
|
||||||
|
###########
|
||||||
|
""")
|
||||||
|
|
||||||
@@ -208,6 +208,10 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .bedrock import bedrock
|
from .bedrock import bedrock
|
||||||
return bedrock
|
return bedrock
|
||||||
|
|
||||||
|
if name.startswith('bazzite'):
|
||||||
|
from .bazzite import bazzite
|
||||||
|
return bazzite
|
||||||
|
|
||||||
if name.startswith('biglinux_large'):
|
if name.startswith('biglinux_large'):
|
||||||
from .biglinux_large import biglinux_large
|
from .biglinux_large import biglinux_large
|
||||||
return biglinux_large
|
return biglinux_large
|
||||||
@@ -664,9 +668,9 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .interix import interix
|
from .interix import interix
|
||||||
return interix
|
return interix
|
||||||
|
|
||||||
if name.startswith('ironclad'):
|
if name.startswith('gloire'):
|
||||||
from .ironclad import ironclad
|
from .gloire import gloire
|
||||||
return ironclad
|
return gloire
|
||||||
|
|
||||||
if name.startswith('januslinux') or name.startswith('janus') or name.startswith('ataraxia linux') or name.startswith('ataraxia'):
|
if name.startswith('januslinux') or name.startswith('janus') or name.startswith('ataraxia linux') or name.startswith('ataraxia'):
|
||||||
from .januslinux import januslinux
|
from .januslinux import januslinux
|
||||||
@@ -1180,6 +1184,10 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .rhaymos import rhaymos
|
from .rhaymos import rhaymos
|
||||||
return rhaymos
|
return rhaymos
|
||||||
|
|
||||||
|
if name.startswith('rhino linux'):
|
||||||
|
from .rhino_linux import rhino_linux
|
||||||
|
return rhino_linux
|
||||||
|
|
||||||
if name.startswith('rocky_small'):
|
if name.startswith('rocky_small'):
|
||||||
from .rocky_small import rocky_small
|
from .rocky_small import rocky_small
|
||||||
return rocky_small
|
return rocky_small
|
||||||
@@ -1312,6 +1320,10 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .t2 import t2
|
from .t2 import t2
|
||||||
return t2
|
return t2
|
||||||
|
|
||||||
|
if name.startswith('opensuse tumbleweed-slowroll') or name.startswith('opensuse_slowroll'):
|
||||||
|
from .opensuse_tumbleweed_slowroll import opensuse_tumbleweed_slowroll
|
||||||
|
return opensuse_tumbleweed_slowroll
|
||||||
|
|
||||||
if name.startswith('opensuse tumbleweed') or name.startswith('opensuse_tumbleweed'):
|
if name.startswith('opensuse tumbleweed') or name.startswith('opensuse_tumbleweed'):
|
||||||
from .opensuse_tumbleweed import opensuse_tumbleweed
|
from .opensuse_tumbleweed import opensuse_tumbleweed
|
||||||
return opensuse_tumbleweed
|
return opensuse_tumbleweed
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
gloire = AsciiArt(match=r'''"Gloire"*''', color='5 7 0', ascii=r"""
|
||||||
|
${c3}
|
||||||
|
&#BGPPPPPG#&
|
||||||
|
B5?77!!?YJJ7!7YBB&
|
||||||
|
&G5YJ77!7JYYYYYBPJ&PY#
|
||||||
|
#PYYYYYY?!?YYYYY7?7JP5JJ
|
||||||
|
B?YYYYYY7!!7JYYYYJ!!?JJJ5
|
||||||
|
&& B7?J?77?7!!!!!77777!7Y5YYBBPGGG&
|
||||||
|
G77?YBB!!!!!!!!!!!!!JYJ??7JYJJY# PYPPG&
|
||||||
|
J777JB?!7JJ???!!!7?JYYYYYPJ!7JB
|
||||||
|
GYYG #JJJJJ??7!!!JYYY5PGB&GB&
|
||||||
|
#Y!?GB5YYJY5PG###&
|
||||||
|
GJJP
|
||||||
|
""")
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
from . import AsciiArt
|
from . import AsciiArt
|
||||||
|
|
||||||
nixos_small = AsciiArt(match=r'''"nixos_small"''', color='4 6', ascii=r"""
|
nixos_small = AsciiArt(match=r'''"nixos_small"''', color='4 6', ascii=r"""
|
||||||
${c1} \\ \\ //
|
${c1} \\ \\ //
|
||||||
==\\__\\/ //
|
==\\__\\/ //
|
||||||
// \\//
|
// \\//
|
||||||
==// //==
|
==// //==
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
opensuse_tumbleweed_slowroll = AsciiArt(match=r'''"openSUSE Tumbleweed-Slowroll"* | "openSUSE_Slowroll"*''', color='2 7', ascii=r"""
|
||||||
|
${c2} _aaaymQQmwaaa,
|
||||||
|
,wWQQQD????????$QQQQa,.
|
||||||
|
_wQQB?" ??QQQa,
|
||||||
|
sQQD^ ?QQ6\
|
||||||
|
yWW' 4QQg
|
||||||
|
,QQD .aaaaaaaa ^4Q6
|
||||||
|
,mQP _wWQW?????YWWQa, 4Qm
|
||||||
|
jQ@ wWW?' ^4QQc ^$QL
|
||||||
|
,QQ' jWW' )QW\ ]QQ
|
||||||
|
|QQ ,QW' ]QQ ^QQ|
|
||||||
|
|QQ |QQ ]QQ QQ|
|
||||||
|
|QQ 4Qg ]QQ .QQ|
|
||||||
|
'QQ6 '$WQac. _QQ( jQQ
|
||||||
|
]QQw "?QWQQf _mQP ,QQ(
|
||||||
|
4QQga wQQP ,mQ?
|
||||||
|
4QQQga, saQWP' jQQf
|
||||||
|
?QQQQQQwaaaaaaaayWWW?' _mQ@'
|
||||||
|
?WQQQP?9VWUV???^ _amQP^
|
||||||
|
"4QQQaa, ,awQQQ?^
|
||||||
|
"?VQQQQQQQQQQQQQQP?'
|
||||||
|
""")
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
rhino_linux = AsciiArt(match=r'''"Rhino Linux"*''', color='5 4', ascii=r"""
|
||||||
|
${c1}
|
||||||
|
${c1} ..','.. l.
|
||||||
|
.,coooooooooc,..ool
|
||||||
|
;oooooooooooooooooooo.,coo.
|
||||||
|
;oooooooooooooooooooooooooo ,
|
||||||
|
.ooooooooooooooooooooooooooo . ,o
|
||||||
|
oollcccccccccllloooooooooooolcoo..oo
|
||||||
|
ll;':::::::::::::::ccloooooooooooooo:
|
||||||
|
.;''';::::::::::::::::::ccloooooooooo
|
||||||
|
''''',:::::::::::::::::::::::cclllllc
|
||||||
|
'''''';::::::::::::::::::::::::::::::
|
||||||
|
${c1}.'''''';::::::::::::::::${c2}ll${c1}:::::::::::
|
||||||
|
${c1} ''''''';:::::::::::::::${c2}d0${c1}::
|
||||||
|
${c1}.''''''',;:::::::${c2}cc${c1}::::${c2}0N:'
|
||||||
|
${c1}''''''''',,;::::${c2}cK${c1}:::${c2}dMX,
|
||||||
|
${c1}'''''''''''',,,${c2}dMccOMM${c1}:
|
||||||
|
${c1}.''''''''''''${c2}cWM0WMM${c1}.
|
||||||
|
${c1}'''''''':${c2}kMMMMM${c1}.
|
||||||
|
${c2}odxONMMMM
|
||||||
|
;Kl
|
||||||
|
""")
|
||||||
|
|
||||||
+7
-6
@@ -7,7 +7,7 @@ import importlib.util
|
|||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import traceback
|
import traceback
|
||||||
from itertools import permutations
|
from itertools import permutations, islice
|
||||||
from math import ceil
|
from math import ceil
|
||||||
|
|
||||||
from . import termenv, neofetch_util, pride_month
|
from . import termenv, neofetch_util, pride_month
|
||||||
@@ -251,7 +251,7 @@ def create_config() -> Config:
|
|||||||
slots = list(set(map(int, re.findall('(?<=\\${c)[0-9](?=})', asc))))
|
slots = list(set(map(int, re.findall('(?<=\\${c)[0-9](?=})', asc))))
|
||||||
while len(pis) < len(slots):
|
while len(pis) < len(slots):
|
||||||
pis += pis
|
pis += pis
|
||||||
perm = {p[:len(slots)] for p in permutations(pis)}
|
perm = {p[:len(slots)] for p in islice(permutations(pis), 1000)}
|
||||||
random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
|
random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
|
||||||
if random_count > len(perm):
|
if random_count > len(perm):
|
||||||
choices = perm
|
choices = perm
|
||||||
@@ -382,7 +382,7 @@ def run():
|
|||||||
GLOBAL_CFG.use_overlay = args.overlay
|
GLOBAL_CFG.use_overlay = args.overlay
|
||||||
|
|
||||||
if args.version:
|
if args.version:
|
||||||
print(f'Version is {VERSION}')
|
print(f'Version is 1.99.∞\n(python hyfetch legacy mode)')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Ensure git bash for windows
|
# Ensure git bash for windows
|
||||||
@@ -414,17 +414,18 @@ def run():
|
|||||||
# Check if it's June (pride month)
|
# Check if it's June (pride month)
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
june_path = CACHE_PATH / f'animation-displayed-{now.year}'
|
june_path = CACHE_PATH / f'animation-displayed-{now.year}'
|
||||||
|
show_for_june = False
|
||||||
if now.month == 6 and now.year not in config.pride_month_shown and not june_path.is_file() and os.isatty(sys.stdout.fileno()):
|
if now.month == 6 and now.year not in config.pride_month_shown and not june_path.is_file() and os.isatty(sys.stdout.fileno()):
|
||||||
args.june = True
|
show_for_june = True
|
||||||
|
|
||||||
if args.june and not config.pride_month_disable:
|
if (args.june or show_for_june) and not config.pride_month_disable:
|
||||||
pride_month.start_animation()
|
pride_month.start_animation()
|
||||||
print()
|
print()
|
||||||
print("Happy pride month!")
|
print("Happy pride month!")
|
||||||
print("(You can always view the animation again with `hyfetch --june`)")
|
print("(You can always view the animation again with `hyfetch --june`)")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if not june_path.is_file():
|
if not june_path.is_file() and not args.june: # If --june wasn't explicitly specified...
|
||||||
june_path.parent.mkdir(parents=True, exist_ok=True)
|
june_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
june_path.touch()
|
june_path.touch()
|
||||||
|
|
||||||
|
|||||||
@@ -390,6 +390,8 @@ def run_fastfetch(asc: str, args: str = '', legacy: bool = False):
|
|||||||
path = tmp_dir / 'ascii.txt'
|
path = tmp_dir / 'ascii.txt'
|
||||||
path.write_text(asc, 'utf-8')
|
path.write_text(asc, 'utf-8')
|
||||||
|
|
||||||
|
os.environ['FFTS_IGNORE_PARENT'] = '1'
|
||||||
|
|
||||||
# Call fastfetch with the temp file
|
# Call fastfetch with the temp file
|
||||||
proc = subprocess.run([str(ff_path), '--raw' if legacy else '--file-raw',
|
proc = subprocess.run([str(ff_path), '--raw' if legacy else '--file-raw',
|
||||||
str(path.absolute()), *shlex.split(args)])
|
str(path.absolute()), *shlex.split(args)])
|
||||||
|
|||||||
+91
-52
@@ -301,6 +301,9 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
'#000000'
|
'#000000'
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
# https://orientation.fandom.com/wiki/Fictosexual
|
||||||
|
'fictosexual': ColorProfile(["#000000", "#C4C4C4", "#A349A5", "#C4C4C4", "#000000"]),
|
||||||
|
|
||||||
# aroace1 sourced from https://flag.library.lgbt/flags/aroace/
|
# aroace1 sourced from https://flag.library.lgbt/flags/aroace/
|
||||||
'aroace1': ColorProfile([
|
'aroace1': ColorProfile([
|
||||||
'#E28C00',
|
'#E28C00',
|
||||||
@@ -551,6 +554,27 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
"fff48d",
|
"fff48d",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
# https://lgbtqia.wiki/wiki/Gendernull
|
||||||
|
'nullflux': ColorProfile([
|
||||||
|
'#0B0C0E', '#A28DB9', '#E1D4EF', '#F0E6DD', '#665858',
|
||||||
|
]),
|
||||||
|
|
||||||
|
'hypergender': ColorProfile([
|
||||||
|
"#EFEFEF", "#FFFFFF", "#FBFF75", "#000000", "#FBFF75", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
'hyperboy': ColorProfile([
|
||||||
|
"#EFEFEF", "#FFFFFF", "#74D7FE", "#000000", "#74D7FE", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
'hypergirl': ColorProfile([
|
||||||
|
"#EFEFEF", "#FFFFFF", "#FC76D3", "#000000", "#FC76D3", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
'hyperandrogyne': ColorProfile([
|
||||||
|
"#EFEFEF", "#FFFFFF", "#BB83FF", "#000000", "#BB83FF", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
'hyperneutrois': ColorProfile([
|
||||||
|
"#EFEFEF", "#FFFFFF", "#BAFA74", "#000000", "#BAFA74", "#FFFFFF", "#EFEFEF",
|
||||||
|
]),
|
||||||
|
|
||||||
"finsexual": ColorProfile([
|
"finsexual": ColorProfile([
|
||||||
"#B18EDF",
|
"#B18EDF",
|
||||||
"#D7B1E2",
|
"#D7B1E2",
|
||||||
@@ -704,54 +728,57 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
# sourced from https://commons.wikimedia.org/wiki/File:Bear_Brotherhood_flag.svg
|
# sourced from https://commons.wikimedia.org/wiki/File:Bear_Brotherhood_flag.svg
|
||||||
'bear': ColorProfile([
|
'bear': ColorProfile([
|
||||||
'#623804',
|
'#623804',
|
||||||
'#D56300',
|
'#D56300',
|
||||||
'#FEDD63',
|
'#FEDD63',
|
||||||
'#FEE6B8',
|
'#FEE6B8',
|
||||||
'#FFFFFF',
|
'#FFFFFF',
|
||||||
'#555555',
|
'#555555',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Butch_Flag.png
|
# colorpicked from https://commons.wikimedia.org/wiki/File:Butch_Flag.png
|
||||||
'butch': ColorProfile([
|
'butch': ColorProfile([
|
||||||
'#D72800',
|
'#D72800',
|
||||||
'#F17623',
|
'#F17623',
|
||||||
'#FF9C56',
|
'#FF9C56',
|
||||||
'#FFFDF6',
|
'#FFFDF6',
|
||||||
'#FFCE89',
|
'#FFCE89',
|
||||||
'#FEAF02',
|
'#FEAF02',
|
||||||
'#A37000',
|
'#A37000',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Leather,_Latex,_and_BDSM_pride_-_Light.svg
|
# colorpicked from https://commons.wikimedia.org/wiki/File:Leather,_Latex,_and_BDSM_pride_-_Light.svg
|
||||||
'leather': ColorProfile([
|
'leather': ColorProfile([
|
||||||
'#000000',
|
'#000000',
|
||||||
'#252580',
|
'#252580',
|
||||||
'#000000',
|
'#000000',
|
||||||
'#252580',
|
'#252580',
|
||||||
'#FFFFFF',
|
'#FFFFFF',
|
||||||
'#252580',
|
'#252580',
|
||||||
'#000000',
|
'#000000',
|
||||||
'#252580',
|
'#252580',
|
||||||
'#000000',
|
'#000000',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Official_Otter_Pride_Flag_by_Bearbackgear.jpg
|
# colorpicked from https://commons.wikimedia.org/wiki/File:Official_Otter_Pride_Flag_by_Bearbackgear.jpg
|
||||||
'otter': ColorProfile([
|
'otter': ColorProfile([
|
||||||
'#263881',
|
'#263881',
|
||||||
'#5C9DC9',
|
'#5C9DC9',
|
||||||
'#FFFFFF',
|
'#FFFFFF',
|
||||||
'#3A291D',
|
'#3A291D',
|
||||||
'#5C9DC9',
|
'#5C9DC9',
|
||||||
'#263881',
|
'#263881',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
# colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
||||||
'twink': ColorProfile([
|
'twink': ColorProfile([
|
||||||
'#FFB2FF',
|
'#FFB2FF',
|
||||||
'#FFFFFF',
|
'#FFFFFF',
|
||||||
'#FFFF81',
|
'#FFFF81',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
# https://en.wikipedia.org/wiki/File:FatFetishFlag.png
|
||||||
|
'adipophilia': ColorProfile(["#000000", "#E16180", "#FFF9BE", "#603E41", "#000000"]),
|
||||||
|
|
||||||
'kenochoric': ColorProfile([
|
'kenochoric': ColorProfile([
|
||||||
'#000000',
|
'#000000',
|
||||||
'#2E1569',
|
'#2E1569',
|
||||||
@@ -924,6 +951,35 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
"#4a8123"
|
"#4a8123"
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
'cisgender': ColorProfile([
|
||||||
|
"#D70270",
|
||||||
|
"#0038A7"
|
||||||
|
]),
|
||||||
|
|
||||||
|
# colors from Gilbert Baker's original 1978 flag design
|
||||||
|
# used https://gilbertbaker.com/rainbow-flag-color-meanings/ as source and colorpicked
|
||||||
|
'baker': ColorProfile([
|
||||||
|
'#F23D9E',
|
||||||
|
'#F80A24',
|
||||||
|
'#F78022',
|
||||||
|
'#F9E81F',
|
||||||
|
'#1E972E',
|
||||||
|
'#1B86BC',
|
||||||
|
'#243897',
|
||||||
|
'#6F0A82',
|
||||||
|
]),
|
||||||
|
|
||||||
|
# this is 4 all the dogs, from zombpawcoins on tumblr!
|
||||||
|
'caninekin': ColorProfile([
|
||||||
|
'#2d2822',
|
||||||
|
'#543d25',
|
||||||
|
'#9c754d',
|
||||||
|
'#e8dac2',
|
||||||
|
'#cfad8c',
|
||||||
|
'#b77b55',
|
||||||
|
'#954e31'
|
||||||
|
]),
|
||||||
|
|
||||||
# Meme flags
|
# Meme flags
|
||||||
'beiyang': ColorProfile([
|
'beiyang': ColorProfile([
|
||||||
'#DF1B12',
|
'#DF1B12',
|
||||||
@@ -949,27 +1005,10 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
"#B71212"
|
"#B71212"
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# colors from Gilbert Baker's original 1978 flag design
|
'band': ColorProfile([
|
||||||
# used https://gilbertbaker.com/rainbow-flag-color-meanings/ as source and colorpicked
|
"#2670c0",
|
||||||
'baker': ColorProfile([
|
"#f5bd00",
|
||||||
'#F23D9E',
|
"#dc0045",
|
||||||
'#F80A24',
|
"#e0608e"
|
||||||
'#F78022',
|
|
||||||
'#F9E81F',
|
|
||||||
'#1E972E',
|
|
||||||
'#1B86BC',
|
|
||||||
'#243897',
|
|
||||||
'#6F0A82',
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# this is 4 all the dogs, from zombpawcoins on tumblr!
|
|
||||||
'caninekin': ColorProfile([
|
|
||||||
'#2d2822',
|
|
||||||
'#543d25',
|
|
||||||
'#9c754d',
|
|
||||||
'#e8dac2',
|
|
||||||
'#cfad8c',
|
|
||||||
'#b77b55',
|
|
||||||
'#954e31'
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ def start_animation():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
# Clear the screen
|
# Move cursor to the top left corner
|
||||||
print("\033[2J\033[H", end="")
|
print("\033[H", end="")
|
||||||
draw_frame()
|
draw_frame()
|
||||||
frame += speed
|
frame += speed
|
||||||
sleep(frame_delay)
|
sleep(frame_delay)
|
||||||
|
|||||||
+4
-1
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -12,7 +13,9 @@ def run_rust():
|
|||||||
pd = Path(__file__).parent.joinpath('rust')
|
pd = Path(__file__).parent.joinpath('rust')
|
||||||
pd = pd.joinpath('hyfetch.exe' if platform.system() == 'Windows' else 'hyfetch')
|
pd = pd.joinpath('hyfetch.exe' if platform.system() == 'Windows' else 'hyfetch')
|
||||||
if not pd.exists():
|
if not pd.exists():
|
||||||
printc('&cThe rust executable is not found, falling back to python...')
|
if 'HYFETCH_DONT_WARN_RUST' not in os.environ:
|
||||||
|
printc('&cThe executable for hyfetch v2 (rust) is not found, falling back to legacy v1.99.∞ (python).\n'
|
||||||
|
'You can add environment variable HYFETCH_DONT_WARN_RUST=1 to suppress this warning.\n')
|
||||||
run_py()
|
run_py()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
version=7.98.0
|
version=8.0.2
|
||||||
|
|
||||||
# Fallback to a value of '5' for shells which support bash
|
# Fallback to a value of '5' for shells which support bash
|
||||||
# but do not set the 'BASH_' shell variables (osh).
|
# but do not set the 'BASH_' shell variables (osh).
|
||||||
@@ -868,7 +868,7 @@ image_source="auto"
|
|||||||
# NOTE: Adélie, aerOS, Afterglow, AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android,
|
# NOTE: Adélie, aerOS, Afterglow, AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android,
|
||||||
# Antergos, antiX, AOSC OS, Aperio GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
# Antergos, antiX, AOSC OS, Aperio GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
||||||
# archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, Arkane, ArseLinux,
|
# archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, Arkane, ArseLinux,
|
||||||
# Artix, Arya, Asahi, AsteroidOS, astOS, Astra Linux, Athena, azos, Bedrock, BigLinux,
|
# Artix, Arya, Asahi, AsteroidOS, astOS, Astra Linux, Athena, azos, Bazzite, Bedrock, BigLinux,
|
||||||
# BigLinux_large, Bitrig, BlackArch, BlackMesa, blackPanther, BLAG, BlankOn, BlueLight, Bodhi,
|
# BigLinux_large, Bitrig, BlackArch, BlackMesa, blackPanther, BLAG, BlankOn, BlueLight, Bodhi,
|
||||||
# bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS,
|
# bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS,
|
||||||
# Chakra, ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS,
|
# Chakra, ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS,
|
||||||
@@ -877,28 +877,29 @@ image_source="auto"
|
|||||||
# DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS, Endless, Enso,
|
# DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS, Endless, Enso,
|
||||||
# EuroLinux, EvolutionOS, eweOS, Exherbo, Exodia Predator OS, Fedora, Fedora Kinoite, Fedora
|
# EuroLinux, EvolutionOS, eweOS, Exherbo, Exodia Predator OS, Fedora, Fedora Kinoite, Fedora
|
||||||
# Sericea, Fedora Silverblue, Fedora_unicode, FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT,
|
# Sericea, Fedora Silverblue, Fedora_unicode, FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT,
|
||||||
# Frugalware, Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
# Frugalware, Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, Gloire, gNewSense,
|
||||||
# GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
# GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra,
|
||||||
# Hyperbola, iglunix, instantOS, Interix, IRIX, Ironclad, Itc, januslinux, Kaisen, Kali, KaOS, KDE,
|
# Hybrid, HydroOS, Hyperbola, iglunix, instantOS, Interix, IRIX, Itc, januslinux, Kaisen, Kali,
|
||||||
# Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE,
|
# KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LainOS, LangitKetujuh, LaxerOS,
|
||||||
# LibreELEC, Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch, Live Raizo,
|
# LEDE, LibreELEC, Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch, Live
|
||||||
# LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix, MagpieOS, MainsailOS, Mandriva, Manjaro,
|
# Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix, MagpieOS, MainsailOS, Mandriva,
|
||||||
# MassOS, MatuusOS, Maui, Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune,
|
# Manjaro, MassOS, MatuusOS, Maui, Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS,
|
||||||
# NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD, Nurunner, NuTyX, Obarun,
|
# Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD, Nurunner, NuTyX,
|
||||||
# OBRevenge, OmniOS, Open Source Media Center, OpenBSD, openEuler, OpenIndiana, openKylin,
|
# Obarun, OBRevenge, OmniOS, Open Source Media Center, OpenBSD, openEuler, OpenIndiana, openKylin,
|
||||||
# openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE Tumbleweed, OPNsense,
|
# openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE Tumbleweed, openSUSE
|
||||||
# Oracle, orchid, OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, Parrot, Parsix, PCBSD,
|
# Tumbleweed-Slowroll, OPNsense, Oracle, orchid, OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus,
|
||||||
# PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Peropesis, phyOS, PikaOS, Pisi, PNM Linux,
|
# Parrot, Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Peropesis, phyOS, PikaOS,
|
||||||
# Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes,
|
# Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy,
|
||||||
# Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted Devuan,
|
# PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore,
|
||||||
# Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient OS, Salix,
|
# Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino Linux, rocky, Rosa, Sabayon, sabotage,
|
||||||
# Sasanqua, Scientific, semc, Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel,
|
# Sailfish, SalentOS, Salient OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
||||||
# Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin,
|
# ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage,
|
||||||
# SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie,
|
# Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore,
|
||||||
# Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-
|
# Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu
|
||||||
# GNOME, ubuntu_old02, Ultramarine Linux, unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu,
|
# Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux, unicodearch,
|
||||||
# Vanilla, Venom, VNux, Void, VzLinux, wii-linux-ngx, Windows, Windows 10, Windows 11, Windows95,
|
# Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii-linux-ngx,
|
||||||
# Wrt, Xenia, Xenia2, XFerience, Xray_OS, Xubuntu, yiffOS, Zorin have ascii logos.
|
# Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS, Xubuntu,
|
||||||
|
# yiffOS, Zorin have ascii logos.
|
||||||
|
|
||||||
# NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu have 'old' logo variants, use
|
# NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu have 'old' logo variants, use
|
||||||
# {distro}_old to use them.
|
# {distro}_old to use them.
|
||||||
@@ -1070,8 +1071,7 @@ get_distro() {
|
|||||||
[[ $distro ]] && return
|
[[ $distro ]] && return
|
||||||
|
|
||||||
case $os in
|
case $os in
|
||||||
Ironclad) distro=Ironclad ;;
|
Linux|BSD|MINIX|Ironclad)
|
||||||
Linux|BSD|MINIX)
|
|
||||||
if [[ -f /bedrock/etc/bedrock-release && -z $BEDROCK_RESTRICT ]]; then
|
if [[ -f /bedrock/etc/bedrock-release && -z $BEDROCK_RESTRICT ]]; then
|
||||||
case $distro_shorthand in
|
case $distro_shorthand in
|
||||||
on|tiny) distro="Bedrock Linux" ;;
|
on|tiny) distro="Bedrock Linux" ;;
|
||||||
@@ -1199,7 +1199,15 @@ get_distro() {
|
|||||||
elif type -p lsb_release >/dev/null; then
|
elif type -p lsb_release >/dev/null; then
|
||||||
# Debian does not include .x versions in /etc/os-version, but does in debian_version
|
# Debian does not include .x versions in /etc/os-version, but does in debian_version
|
||||||
# So if that file exists, and we are not *buntu, build name from there
|
# So if that file exists, and we are not *buntu, build name from there
|
||||||
if [[ -f /etc/debian_version ]] && [[ $(lsb_release -si) != *"buntu"* ]] && [[ $(lsb_release -si) != *"neon"* ]]; then
|
if [[ $(lsb_release -si) = *"KSLinux"* ]]
|
||||||
|
then
|
||||||
|
. /etc/os-release
|
||||||
|
case $distro_shorthand in
|
||||||
|
on) distro=${NAME} ;;
|
||||||
|
tiny) distro=${NAME} ;;
|
||||||
|
*) distro="${NAME} ${VERSION}" ;;
|
||||||
|
esac
|
||||||
|
elif [[ -f /etc/debian_version ]] && [[ $(lsb_release -si) != *"buntu"* ]] && [[ $(lsb_release -si) != *"neon"* ]]; then
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
case $distro_shorthand in
|
case $distro_shorthand in
|
||||||
on) distro="${NAME}" ;;
|
on) distro="${NAME}" ;;
|
||||||
@@ -1258,10 +1266,6 @@ get_distro() {
|
|||||||
elif type -p tazpkg >/dev/null; then
|
elif type -p tazpkg >/dev/null; then
|
||||||
distro="SliTaz $(< /etc/slitaz-release)"
|
distro="SliTaz $(< /etc/slitaz-release)"
|
||||||
|
|
||||||
elif type -p kpt >/dev/null && \
|
|
||||||
type -p kpm >/dev/null; then
|
|
||||||
distro=KSLinux
|
|
||||||
|
|
||||||
elif [[ -d /system/app/ && -d /system/priv-app ]]; then
|
elif [[ -d /system/app/ && -d /system/priv-app ]]; then
|
||||||
distro="Android $(getprop ro.build.version.release)"
|
distro="Android $(getprop ro.build.version.release)"
|
||||||
|
|
||||||
@@ -1957,9 +1961,6 @@ get_kernel() {
|
|||||||
get_uptime() {
|
get_uptime() {
|
||||||
# Get uptime in seconds.
|
# Get uptime in seconds.
|
||||||
case $os in
|
case $os in
|
||||||
Ironclad)
|
|
||||||
s=$(uptime -s)
|
|
||||||
;;
|
|
||||||
Linux|Windows|MINIX)
|
Linux|Windows|MINIX)
|
||||||
if [[ -r /proc/uptime ]]; then
|
if [[ -r /proc/uptime ]]; then
|
||||||
s=$(< /proc/uptime)
|
s=$(< /proc/uptime)
|
||||||
@@ -1988,7 +1989,7 @@ get_uptime() {
|
|||||||
s=$((now - boot))
|
s=$((now - boot))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
AIX|IRIX)
|
AIX|IRIX|Ironclad)
|
||||||
t=$(LC_ALL=POSIX ps -o etime= -p 1)
|
t=$(LC_ALL=POSIX ps -o etime= -p 1)
|
||||||
|
|
||||||
[[ $t == *-* ]] && { d=${t%%-*}; t=${t#*-}; }
|
[[ $t == *-* ]] && { d=${t%%-*}; t=${t#*-}; }
|
||||||
@@ -2183,7 +2184,7 @@ get_packages() {
|
|||||||
has evox && tot cat /var/evox/packages/DB
|
has evox && tot cat /var/evox/packages/DB
|
||||||
has squirrel && tot ls -w 1 /var/packages
|
has squirrel && tot ls -w 1 /var/packages
|
||||||
has anise && tot anise s --installed
|
has anise && tot anise s --installed
|
||||||
has am && pac "$(am -f --less)"
|
has am && pac "$(am -f --less | awk '{ SUM += $1} END { print SUM }')"
|
||||||
# Bonsai refers to the now archived repo https://github.com/mitchweaver/bonsai
|
# Bonsai refers to the now archived repo https://github.com/mitchweaver/bonsai
|
||||||
has bonsai && tot bonsai list
|
has bonsai && tot bonsai list
|
||||||
# Rad refers to https://github.com/glaucuslinux/rad
|
# Rad refers to https://github.com/glaucuslinux/rad
|
||||||
@@ -2241,7 +2242,6 @@ get_packages() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Other (Needs complex command)
|
# Other (Needs complex command)
|
||||||
has kpm-pkg && ((packages+=$(kpm --get-selections | grep -cv deinstall$)))
|
|
||||||
|
|
||||||
nix-user-pkgs() {
|
nix-user-pkgs() {
|
||||||
if [ -d ~/.nix-profile ]; then
|
if [ -d ~/.nix-profile ]; then
|
||||||
@@ -3175,19 +3175,10 @@ END
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X"|"macOS")
|
"Mac OS X"|"macOS")
|
||||||
if [[ $osx_version == 10.[4-5]* ]]; then
|
cpu="$(sysctl -n machdep.cpu.brand_string 2>/dev/null)"
|
||||||
cpu="$(system_profiler SPHardwareDataType | grep CPU\ Type)"
|
if [ -z "$cpu" ]; then
|
||||||
cpu="${cpu/CPU\ Type\:/}"
|
cpu="$(system_profiler SPHardwareDataType | grep Processor\ Name)"
|
||||||
|
cpu="${cpu/Processor\ Name\:/}"
|
||||||
speed="$(system_profiler SPHardwareDataType | grep CPU\ Speed)"
|
|
||||||
speed="${speed/CPU\ Speed\:/}"
|
|
||||||
speed="${speed/ MHz/}"
|
|
||||||
speed="${speed/ GHz/}"
|
|
||||||
|
|
||||||
cores="$(system_profiler SPHardwareDataType | grep Number\ Of\ CPUs)"
|
|
||||||
cores="${cores/Number\ Of\ CPUs\:/}"
|
|
||||||
else
|
|
||||||
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
@@ -3374,7 +3365,6 @@ END
|
|||||||
cpu="${cpu//[1-9][0-9]-Core}"
|
cpu="${cpu//[1-9][0-9]-Core}"
|
||||||
cpu="${cpu//[0-9]-Core}"
|
cpu="${cpu//[0-9]-Core}"
|
||||||
cpu="${cpu//, * Compute Cores}"
|
cpu="${cpu//, * Compute Cores}"
|
||||||
cpu="${cpu//Core / }"
|
|
||||||
cpu="${cpu//(\"AuthenticAMD\"*)}"
|
cpu="${cpu//(\"AuthenticAMD\"*)}"
|
||||||
cpu="${cpu//with Radeon*Graphics}"
|
cpu="${cpu//with Radeon*Graphics}"
|
||||||
cpu="${cpu//, altivec supported}"
|
cpu="${cpu//, altivec supported}"
|
||||||
@@ -3663,13 +3653,19 @@ get_memory() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X" | "macOS" | "iPhone OS")
|
"Mac OS X" | "macOS" | "iPhone OS")
|
||||||
hw_pagesize="$(sysctl -n hw.pagesize)"
|
pageable="$(sysctl -n vm.page_pageable_internal_count)"
|
||||||
mem_total="$(($(sysctl -n hw.memsize) / 1024))"
|
purgeable="$(sysctl -n vm.page_purgeable_count)"
|
||||||
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
|
if [ -n "$pageable" ] && [ -n "$purgeable" ] && type -p vm_stat &>/dev/null; then
|
||||||
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
|
hw_pagesize="$(sysctl -n hw.pagesize)"
|
||||||
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
|
mem_total="$(($(sysctl -n hw.memsize) / 1024))"
|
||||||
pages_compressed="${pages_compressed:-0}"
|
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
|
||||||
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024))"
|
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
|
||||||
|
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
|
||||||
|
pages_compressed="${pages_compressed:-0}"
|
||||||
|
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024))"
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"BSD" | "MINIX" | "ravynOS")
|
"BSD" | "MINIX" | "ravynOS")
|
||||||
@@ -4587,7 +4583,7 @@ get_python_ver() {
|
|||||||
if command -v python &> /dev/null; then
|
if command -v python &> /dev/null; then
|
||||||
python_ver=$(python -VVV)
|
python_ver=$(python -VVV)
|
||||||
python_ver=${python_ver//$'\n'/}
|
python_ver=${python_ver//$'\n'/}
|
||||||
python_ver=${python_ver//\(+([^\)])\)}
|
python_ver=${python_ver//+([[:space:]])\(+([^\)])\)}
|
||||||
python_ver=$(echo "$python_ver" | awk '$1=$1')
|
python_ver=$(echo "$python_ver" | awk '$1=$1')
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -5305,6 +5301,16 @@ get_local_ip() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_public_ip() {
|
get_public_ip() {
|
||||||
|
if [[ -z "$public_ip_host" ]] && type -p dig >/dev/null; then
|
||||||
|
public_ip="$(dig +time=1 +tries=1 +short TXT ch whoami.cloudflare @1.1.1.1 | tr -d '"')"
|
||||||
|
[[ "$public_ip" =~ ^\; ]] && unset public_ip
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$public_ip_host" ]] && [[ -z "$public_ip" ]] && type -p drill >/dev/null; then
|
||||||
|
public_ip="$(drill whoami.cloudflare TXT CH @1.1.1.1 | awk '/^whoami\./ && $3 == "CH" {print $5}' | tr -d '"')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback
|
||||||
if [[ -z "$public_ip_host" ]] && type -p dig >/dev/null; then
|
if [[ -z "$public_ip_host" ]] && type -p dig >/dev/null; then
|
||||||
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
|
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
|
||||||
[[ "$public_ip" =~ ^\; ]] && unset public_ip
|
[[ "$public_ip" =~ ^\; ]] && unset public_ip
|
||||||
@@ -6620,12 +6626,12 @@ ASCII:
|
|||||||
GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft,
|
||||||
archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike,
|
archcraft_ascii, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike,
|
||||||
ArcoLinux, Arkane, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS,
|
ArcoLinux, Arkane, ArseLinux, Artix, Arya, Asahi, AsteroidOS, astOS,
|
||||||
Astra Linux, Athena, azos, Bedrock, BigLinux, BigLinux_large,
|
Astra Linux, Athena, azos, Bazzite, Bedrock, BigLinux,
|
||||||
Bitrig, BlackArch, BlackMesa, blackPanther, BLAG, BlankOn,
|
BigLinux_large, Bitrig, BlackArch, BlackMesa, blackPanther, BLAG,
|
||||||
BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate,
|
BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS,
|
||||||
CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS, Chakra,
|
Calculate, CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS,
|
||||||
ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro, Clear
|
Chakra, ChaletOS, Chapeau, Chimera, ChonkySealOS, Chrom, Cleanjaro,
|
||||||
Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
Clear Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
||||||
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
||||||
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
||||||
digital UNIX, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
digital UNIX, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
||||||
@@ -6634,37 +6640,37 @@ ASCII:
|
|||||||
Kinoite, Fedora Sericea, Fedora Silverblue, Fedora_unicode,
|
Kinoite, Fedora Sericea, Fedora Silverblue, Fedora_unicode,
|
||||||
FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware,
|
FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware,
|
||||||
Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
Funtoo, Furreto, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||||
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
Gloire, gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang,
|
||||||
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||||
Hyperbola, iglunix, instantOS, Interix, IRIX, Ironclad, Itc,
|
Hyperbola, iglunix, instantOS, Interix, IRIX, Itc, januslinux,
|
||||||
januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux,
|
||||||
KrassOS, KSLinux, Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE,
|
Kubuntu, LainOS, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire,
|
||||||
LibreELEC, Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old,
|
Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch,
|
||||||
LinuxFromScratch, Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS,
|
Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix,
|
||||||
Mageia, Magix, MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS,
|
MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui,
|
||||||
MatuusOS, Maui, Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib,
|
Mauna, Meowix, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune,
|
||||||
NekOS, Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful,
|
NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD,
|
||||||
Nobara, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open
|
Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media
|
||||||
Source Media Center, OpenBSD, openEuler, OpenIndiana, openKylin,
|
Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba,
|
||||||
openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE Leap,
|
OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
||||||
openSUSE Tumbleweed, OPNsense, Oracle, orchid, OS Elbrus, PacBSD,
|
Tumbleweed, openSUSE Tumbleweed-Slowroll, OPNsense, Oracle, orchid,
|
||||||
Panwah, Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS,
|
OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, Parrot, Parsix,
|
||||||
pearOS, Pengwin, Pentoo, Peppermint, Peropesis, phyOS, PikaOS, Pisi,
|
PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Peropesis,
|
||||||
PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX,
|
phyOS, PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS,
|
||||||
Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix,
|
Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes,
|
||||||
Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted
|
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||||
Devuan, Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage,
|
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
||||||
Sailfish, SalentOS, Salient OS, Salix, Sasanqua, Scientific, semc,
|
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
||||||
Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel,
|
OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
||||||
Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star,
|
ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS,
|
||||||
SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra,
|
Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin,
|
||||||
TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie,
|
SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore, Trisquel,
|
||||||
Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu
|
Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin,
|
||||||
Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux,
|
Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME,
|
||||||
unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla,
|
ubuntu_old02, Ultramarine Linux, unicodearch, Univalent, Univention,
|
||||||
Venom, VNux, Void, VzLinux, wii-linux-ngx, Windows, Windows 10,
|
Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii-linux-
|
||||||
Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS,
|
ngx, Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2,
|
||||||
Xubuntu, yiffOS, Zorin have ascii logos.
|
XFerience, Xray_OS, Xubuntu, yiffOS, Zorin have ascii logos.
|
||||||
|
|
||||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||||
have 'old' logo variants, use {distro}_old to use them.
|
have 'old' logo variants, use {distro}_old to use them.
|
||||||
@@ -8229,6 +8235,31 @@ ${c1}--------------------------------------
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Bazzite"*)
|
||||||
|
set_colors 5 5
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} %%%%%%====%%%%%%%%%%
|
||||||
|
%%%%%%%% %%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%%%###
|
||||||
|
%%%%%%%%% %%%%%%%%%%%%%######
|
||||||
|
== =======######
|
||||||
|
== =========#####
|
||||||
|
%%%%%%%%% %%%%%%%####======#####
|
||||||
|
%%%%%%%%% %%%%%#######=====#####
|
||||||
|
%%%%%%%%% %%%#########=====#####
|
||||||
|
%%%%%%%%% %%##########=====#####
|
||||||
|
%%%%%%%%%====###########=====######
|
||||||
|
%%%%%%%%====#########======######
|
||||||
|
%%%%%%%=====#####========######
|
||||||
|
%%%%###===============#######
|
||||||
|
%#######==========#########
|
||||||
|
#######################
|
||||||
|
###################
|
||||||
|
###########
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"BigLinux_large"*)
|
"BigLinux_large"*)
|
||||||
set_colors 2 3 4 7
|
set_colors 2 3 4 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -8746,6 +8777,8 @@ ${c1} .
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"CelOS"*)
|
"CelOS"*)
|
||||||
set_colors 4 6 0 5
|
set_colors 4 6 0 5
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -10769,7 +10802,7 @@ ${c2}~!!7JY5PGGBBBBBBBBGGGGGGGBGGGGGP5YJ?7~~~
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Ironclad"*)
|
"Gloire"*)
|
||||||
set_colors 5 7 0
|
set_colors 5 7 0
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
${c3}
|
${c3}
|
||||||
@@ -12093,7 +12126,7 @@ EOF
|
|||||||
"nixos_small")
|
"nixos_small")
|
||||||
set_colors 4 6
|
set_colors 4 6
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
${c1} \\\\ \\\\ //
|
${c1} \\\\ \\\\ //
|
||||||
==\\\\__\\\\/ //
|
==\\\\__\\\\/ //
|
||||||
// \\\\//
|
// \\\\//
|
||||||
==// //==
|
==// //==
|
||||||
@@ -13708,6 +13741,33 @@ ${c1}
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Rhino Linux"*)
|
||||||
|
set_colors 5 4
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1}
|
||||||
|
${c1} ..','.. l.
|
||||||
|
.,coooooooooc,..ool
|
||||||
|
;oooooooooooooooooooo.,coo.
|
||||||
|
;oooooooooooooooooooooooooo ,
|
||||||
|
.ooooooooooooooooooooooooooo . ,o
|
||||||
|
oollcccccccccllloooooooooooolcoo..oo
|
||||||
|
ll;':::::::::::::::ccloooooooooooooo:
|
||||||
|
.;''';::::::::::::::::::ccloooooooooo
|
||||||
|
''''',:::::::::::::::::::::::cclllllc
|
||||||
|
'''''';::::::::::::::::::::::::::::::
|
||||||
|
${c1}.'''''';::::::::::::::::${c2}ll${c1}:::::::::::
|
||||||
|
${c1} ''''''';:::::::::::::::${c2}d0${c1}::
|
||||||
|
${c1}.''''''',;:::::::${c2}cc${c1}::::${c2}0N:'
|
||||||
|
${c1}''''''''',,;::::${c2}cK${c1}:::${c2}dMX,
|
||||||
|
${c1}'''''''''''',,,${c2}dMccOMM${c1}:
|
||||||
|
${c1}.''''''''''''${c2}cWM0WMM${c1}.
|
||||||
|
${c1}'''''''':${c2}kMMMMM${c1}.
|
||||||
|
${c2}odxONMMMM
|
||||||
|
;Kl
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
"rocky_small"*)
|
"rocky_small"*)
|
||||||
set_colors 2
|
set_colors 2
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "neowofetch",
|
"name": "neowofetch",
|
||||||
"version": "1.99.0",
|
"version": "2.0.2",
|
||||||
"description": "Updated neofetch",
|
"description": "Updated neofetch",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# This script does some file path magic to make cargo publish work without having
|
||||||
|
# to have neofetch & font logos in the cargo root.
|
||||||
|
# ...okay basically it copies these files over before publishing.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Get the directory of SRC root which is ../ from this script
|
||||||
|
SRC_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
CARGO_ROOT="$SRC_ROOT/crates/hyfetch"
|
||||||
|
|
||||||
|
# Copy neofetch from here to cargo root
|
||||||
|
cp "$SRC_ROOT/neofetch" "$CARGO_ROOT/"
|
||||||
|
mkdir -p "$CARGO_ROOT/hyfetch"
|
||||||
|
cp -r "$SRC_ROOT/hyfetch/data" "$CARGO_ROOT/hyfetch/"
|
||||||
|
|
||||||
|
# Build the crate
|
||||||
|
cargo publish -p hyfetch --allow-dirty "$@"
|
||||||
|
|
||||||
|
# Delete the copied files
|
||||||
|
rm "$CARGO_ROOT/neofetch"
|
||||||
|
rm -rf "$CARGO_ROOT/hyfetch"
|
||||||
|
|
||||||
|
echo "Done!"
|
||||||
+20
-4
@@ -52,7 +52,14 @@ def edit_versions(version: str):
|
|||||||
content = [f"VERSION = '{version}'" if l.startswith('VERSION = ') else l for l in path.read_text().split('\n')]
|
content = [f"VERSION = '{version}'" if l.startswith('VERSION = ') else l for l in path.read_text().split('\n')]
|
||||||
path.write_text('\n'.join(content))
|
path.write_text('\n'.join(content))
|
||||||
|
|
||||||
# 3. README.md
|
# 3. Cargo.toml
|
||||||
|
print('Editing Cargo.toml...')
|
||||||
|
path = Path('Cargo.toml')
|
||||||
|
content = path.read_text()
|
||||||
|
content = re.sub(r'(?<=^version = ")[^"]+(?="$)', version, content, flags=re.MULTILINE)
|
||||||
|
path.write_text(content)
|
||||||
|
|
||||||
|
# 4. README.md
|
||||||
print('Editing README.md...')
|
print('Editing README.md...')
|
||||||
path = Path('README.md')
|
path = Path('README.md')
|
||||||
content = path.read_text()
|
content = path.read_text()
|
||||||
@@ -61,7 +68,7 @@ def edit_versions(version: str):
|
|||||||
content = content[:changelog_i] + f'\n\n### {version}' + content[changelog_i:]
|
content = content[:changelog_i] + f'\n\n### {version}' + content[changelog_i:]
|
||||||
path.write_text(content)
|
path.write_text(content)
|
||||||
|
|
||||||
# 4. neofetch script
|
# 5. neofetch script
|
||||||
print('Editing neofetch...')
|
print('Editing neofetch...')
|
||||||
path = Path('neofetch')
|
path = Path('neofetch')
|
||||||
lines = path.read_text().replace("\t", " ").split('\n')
|
lines = path.read_text().replace("\t", " ").split('\n')
|
||||||
@@ -93,7 +100,7 @@ def finalize_neofetch():
|
|||||||
# 2. Regenerate man page
|
# 2. Regenerate man page
|
||||||
print('Regenerating neofetch man page...')
|
print('Regenerating neofetch man page...')
|
||||||
Path('docs/neofetch.1').write_text(subprocess.check_output(['help2man', './neofetch']).decode())
|
Path('docs/neofetch.1').write_text(subprocess.check_output(['help2man', './neofetch']).decode())
|
||||||
Path('docs/hyfetch.1').write_text(subprocess.check_output(['help2man', 'python3 -m hyfetch']).decode())
|
Path('docs/hyfetch.1').write_text(subprocess.check_output(['help2man', 'cargo run --']).decode())
|
||||||
|
|
||||||
# 3. Reformat readme links
|
# 3. Reformat readme links
|
||||||
print('Reformatting readme links...')
|
print('Reformatting readme links...')
|
||||||
@@ -125,7 +132,12 @@ def create_release(v: str):
|
|||||||
subprocess.check_call(['git', 'tag', f'neofetch-{NEOFETCH_NEW_VERSION}'])
|
subprocess.check_call(['git', 'tag', f'neofetch-{NEOFETCH_NEW_VERSION}'])
|
||||||
|
|
||||||
i = input('Please check the commit is correct. Press y to continue or any other key to cancel.')
|
i = input('Please check the commit is correct. Press y to continue or any other key to cancel.')
|
||||||
assert i == 'y'
|
if i.lower() != 'y':
|
||||||
|
print('Aborting...')
|
||||||
|
subprocess.check_call(['git', 'reset', '--hard', 'HEAD~1'])
|
||||||
|
subprocess.check_call(['git', 'tag', '-d', v])
|
||||||
|
subprocess.check_call(['git', 'tag', '-d', f'neofetch-{NEOFETCH_NEW_VERSION}'])
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# 4. Push
|
# 4. Push
|
||||||
print('Pushing commits...')
|
print('Pushing commits...')
|
||||||
@@ -141,6 +153,10 @@ def deploy():
|
|||||||
subprocess.check_call(['bash', 'tools/deploy.sh'])
|
subprocess.check_call(['bash', 'tools/deploy.sh'])
|
||||||
print('Done!')
|
print('Done!')
|
||||||
|
|
||||||
|
print('Deploying to crates.io...')
|
||||||
|
subprocess.check_call(['bash', 'tools/deploy-crate.sh'])
|
||||||
|
print('Done!')
|
||||||
|
|
||||||
print('Deploying to npm...')
|
print('Deploying to npm...')
|
||||||
otp = input('Please provide 2FA OTP for NPM: ')
|
otp = input('Please provide 2FA OTP for NPM: ')
|
||||||
subprocess.check_call(['npm', 'publish', '--otp', otp])
|
subprocess.check_call(['npm', 'publish', '--otp', otp])
|
||||||
|
|||||||
Reference in New Issue
Block a user