Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62fdc22c00 | |||
| 1fdcfa66b8 | |||
| d08a0745a5 | |||
| 4ee5344209 | |||
| 26030b0628 | |||
| 9b376f97c0 | |||
| 2dc18050ca | |||
| e816235637 | |||
| 8046e9bab3 | |||
| e03cda1475 | |||
| 20e5fb3f89 | |||
| e253a75924 | |||
| 2252fc36e7 | |||
| 4e23243384 | |||
| f6dc68d7dc | |||
| f947373a23 | |||
| 5b745cde01 | |||
| 1afbd66355 | |||
| 2fe21deea8 | |||
| 37a19901bb | |||
| 063679b72d | |||
| 264cf11690 | |||
| 6280d370bc | |||
| 6cfc337d83 | |||
| 533de96e80 | |||
| dee984f931 | |||
| 959d42ee9c | |||
| eb349aa1aa | |||
| d5751e06af | |||
| 981602b690 | |||
| a8d752aa9f | |||
| c57e8a4a49 | |||
| 67ae918ae8 | |||
| e788f93c2b | |||
| 75a2e9d8d3 | |||
| 23888c0e3e | |||
| e5ad9e564d | |||
| 328381b336 | |||
| 28a181d97b | |||
| bb514f8fd9 | |||
| b585ee1e26 | |||
| de2141347e | |||
| ba88581ed4 | |||
| 932042b62c | |||
| f5c5e31691 |
Generated
+2
-1
@@ -269,7 +269,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyfetch"
|
name = "hyfetch"
|
||||||
version = "2.0.2"
|
version = "2.0.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"ansi_colours",
|
"ansi_colours",
|
||||||
@@ -283,6 +283,7 @@ dependencies = [
|
|||||||
"enterpolation",
|
"enterpolation",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"fs_extra",
|
"fs_extra",
|
||||||
|
"heck",
|
||||||
"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.2"
|
version = "2.0.5"
|
||||||
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"
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
include hyfetch/scripts/*
|
|
||||||
|
|
||||||
recursive-exclude tools *
|
|
||||||
recursive-exclude .github *
|
|
||||||
recursive-exclude .vscode *
|
|
||||||
exclude .gitignore
|
|
||||||
exclude .gitattributes
|
|
||||||
exclude package.json
|
|
||||||
exclude CONTRIBUTING.md
|
|
||||||
@@ -129,6 +129,66 @@ cargo install --git https://github.com/hykilpikonna/hyfetch
|
|||||||
|
|
||||||
<!-- CHANGELOG STARTS HERE --->
|
<!-- CHANGELOG STARTS HERE --->
|
||||||
|
|
||||||
|
### 2.0.5
|
||||||
|
|
||||||
|
**✨ Features & Enhancements**
|
||||||
|
|
||||||
|
* Added support for Secureblue ([#434](https://github.com/hykilpikonna/hyfetch/pull/434)).
|
||||||
|
* Added `void_old` logo variant ([#457](https://github.com/hykilpikonna/hyfetch/pull/457)).
|
||||||
|
* Added Femme flag ([#456](https://github.com/hykilpikonna/hyfetch/pull/456)).
|
||||||
|
|
||||||
|
**🐛 Bug Fixes**
|
||||||
|
|
||||||
|
* Fixed a panic when entering an invalid alignment option after rolling ([#460](https://github.com/hykilpikonna/hyfetch/issues/460)).
|
||||||
|
* Fixed Traceback printing on KeyboardInterrupt ([#462](https://github.com/hykilpikonna/hyfetch/issues/462)).
|
||||||
|
* Restored flags lost during Python/Rust presets merge ([#466](https://github.com/hykilpikonna/hyfetch/pull/466)).
|
||||||
|
* Fixed a panic with file metadata access ([#465](https://github.com/hykilpikonna/hyfetch/issues/465)).
|
||||||
|
|
||||||
|
### 2.0.4
|
||||||
|
|
||||||
|
**🔧 Building Pipeline Refactoring**
|
||||||
|
|
||||||
|
* Modernize Python building toolchain from `setup.py` to `pyproject.toml`
|
||||||
|
* Fixed a bug where Windows binaries are mistakenly built into Unix packages.
|
||||||
|
* Fixed a bug where `presets.json` was not being included in the built package.
|
||||||
|
|
||||||
|
### 2.0.3
|
||||||
|
|
||||||
|
(changelog is generated by Gemini from commit history)
|
||||||
|
|
||||||
|
This update brings a significant internal refactor to how color presets are managed, along with a new batch of pride flags and several important bug fixes.
|
||||||
|
|
||||||
|
**✨ Features & Enhancements**
|
||||||
|
|
||||||
|
* **Custom ASCII Art**: You can now specify a file path for custom ASCII art ([#429](https://github.com/hykilpikonna/hyfetch/pull/429)).
|
||||||
|
* **Hex Color Presets**: Added the ability to pass a custom comma-separated hex color string list (e.g., `#RRGGBB,#RRGGBB`) directly as a preset ([#435](https://github.com/hykilpikonna/hyfetch/pull/435)).
|
||||||
|
|
||||||
|
**🏳️🌈 New Flags**
|
||||||
|
|
||||||
|
* Added Transbian flag ([#449](https://github.com/hykilpikonna/hyfetch/pull/449))
|
||||||
|
* Added Autism Pride flag ([#450](https://github.com/hykilpikonna/hyfetch/pull/450))
|
||||||
|
* Added Transneutral & Cenelian flags ([#452](https://github.com/hykilpikonna/hyfetch/pull/452))
|
||||||
|
* Added Fluidflux flags ([#437](https://github.com/hykilpikonna/hyfetch/pull/437))
|
||||||
|
* Added Libragender flags ([#433](https://github.com/hykilpikonna/hyfetch/pull/433))
|
||||||
|
|
||||||
|
**🐛 Bug Fixes**
|
||||||
|
|
||||||
|
* **Crash Fix**: Fixed a panic that could occur if hyfetch was run on a distro with no defined ASCII art ([#455](https://github.com/hykilpikonna/hyfetch/pull/455)).
|
||||||
|
* **OS Support**: Added support for iOS 1.x ([#444](https://github.com/hykilpikonna/hyfetch/pull/444)) and old Apple TV models ([#438](https://github.com/hykilpikonna/hyfetch/pull/438)).
|
||||||
|
* **Python**:
|
||||||
|
* Fixed a bug where 3-length hex codes (e.g., `#FFF`) does not work properly ([#443](https://github.com/hykilpikonna/hyfetch/pull/443)).
|
||||||
|
* Fixed a string formatting issue for python 3.11 and earlier versions ([#442](https://github.com/hykilpikonna/hyfetch/pull/442)).
|
||||||
|
* Fixed a bug where extra top padding would appear above output ascii art ([#428](https://github.com/hykilpikonna/hyfetch/pull/428)).
|
||||||
|
* **Rust**:
|
||||||
|
* Fixed the logic for the pride month easter egg so it only marks itself as "displayed" during June ([#430](https://github.com/hykilpikonna/hyfetch/pull/430)).
|
||||||
|
* Fixed a build issue on Windows ([#439](https://github.com/hykilpikonna/hyfetch/pull/439)).
|
||||||
|
|
||||||
|
**🔧 Maintenance & Refactoring**
|
||||||
|
|
||||||
|
* **Preset Refactor**: Color presets are now stored in a central `presets.json` file. ([#451](https://github.com/hykilpikonna/hyfetch/issues/451)).
|
||||||
|
* **Dependency Updates**: Upgraded various Rust crates and other dependencies to their latest versions.
|
||||||
|
* **Code Cleanup**: General code shortening and readability improvements.
|
||||||
|
|
||||||
### 2.0.2
|
### 2.0.2
|
||||||
|
|
||||||
This is a small patch release that adds more flags and fixes some bugs from the recent Rust rewrite.
|
This is a small patch release that adds more flags and fixes some bugs from the recent Rust rewrite.
|
||||||
|
|||||||
@@ -41,10 +41,14 @@ unicode-segmentation = { workspace = true, features = [] }
|
|||||||
which = { workspace = true, features = [] }
|
which = { workspace = true, features = [] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
indexmap = { workspace = true, features = ["std"] }
|
indexmap = { workspace = true, features = ["std", "serde"] }
|
||||||
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"
|
fs_extra = "1.3.0"
|
||||||
|
serde = { workspace = true, features = ["derive", "std"] }
|
||||||
|
serde_json = { workspace = true, features = ["std"] }
|
||||||
|
anyhow = { workspace = true, features = ["std"] }
|
||||||
|
heck = "0.5.0"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
enable-ansi-support = { workspace = true, features = [] }
|
enable-ansi-support = { workspace = true, features = [] }
|
||||||
|
|||||||
+98
-50
@@ -1,11 +1,14 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt::Write as _;
|
use std::fmt::Write as _;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
use std::io::{BufWriter, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use anyhow::{Context, Result};
|
||||||
use fs_extra::dir::{CopyOptions};
|
use fs_extra::dir::CopyOptions;
|
||||||
|
use heck::ToUpperCamelCase;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
use serde::Deserialize;
|
||||||
use unicode_normalization::UnicodeNormalization as _;
|
use unicode_normalization::UnicodeNormalization as _;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -29,7 +32,7 @@ fn anything_that_exist(paths: &[&Path]) -> Option<PathBuf> {
|
|||||||
paths.iter().copied().find(|p| p.exists()).map(Path::to_path_buf)
|
paths.iter().copied().find(|p| p.exists()).map(Path::to_path_buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() -> Result<()> {
|
||||||
// Path hack to make file paths work in both workspace and manifest directory
|
// 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 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());
|
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
@@ -38,7 +41,7 @@ fn main() {
|
|||||||
let src = anything_that_exist(&[
|
let src = anything_that_exist(&[
|
||||||
&dir.join(file),
|
&dir.join(file),
|
||||||
&dir.join("../../").join(file),
|
&dir.join("../../").join(file),
|
||||||
]).expect("couldn't find neofetch");
|
]).context("couldn't find neofetch")?;
|
||||||
let dst = o.join(file);
|
let dst = o.join(file);
|
||||||
println!("cargo:rerun-if-changed={}", src.display());
|
println!("cargo:rerun-if-changed={}", src.display());
|
||||||
|
|
||||||
@@ -46,19 +49,19 @@ fn main() {
|
|||||||
if src.is_dir() {
|
if src.is_dir() {
|
||||||
let opt = CopyOptions { overwrite: true, copy_inside: true, ..CopyOptions::default() };
|
let opt = CopyOptions { overwrite: true, copy_inside: true, ..CopyOptions::default() };
|
||||||
println!("copying {} to {}", src.display(), dst.display());
|
println!("copying {} to {}", src.display(), dst.display());
|
||||||
fs_extra::dir::copy(&src, &dst, &opt).expect("Failed to copy directory to OUT_DIR");
|
fs_extra::dir::copy(&src, &dst, &opt)?;
|
||||||
}
|
}
|
||||||
else { fs::copy(&src, &dst).expect("Failed to copy file to OUT_DIR"); }
|
else { fs::copy(&src, &dst)?; }
|
||||||
}
|
}
|
||||||
|
|
||||||
export_distros(&o.join("neofetch"), &o);
|
preset_codegen(&o.join("hyfetch/data/presets.json"), &o.join("presets.rs"))?;
|
||||||
|
export_distros(&o.join("neofetch"), &o)?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn export_distros<P>(neofetch_path: P, out_path: &Path)
|
fn export_distros(neofetch_path: &Path, out_path: &Path) -> Result<()>
|
||||||
where
|
|
||||||
P: AsRef<Path>,
|
|
||||||
{
|
{
|
||||||
let distros = parse_ascii_distros(neofetch_path);
|
let distros = parse_ascii_distros(neofetch_path)?;
|
||||||
let mut variants = IndexMap::with_capacity(distros.len());
|
let mut variants = IndexMap::with_capacity(distros.len());
|
||||||
|
|
||||||
for distro in &distros {
|
for distro in &distros {
|
||||||
@@ -81,18 +84,13 @@ where
|
|||||||
let mut buf = r###"
|
let mut buf = r###"
|
||||||
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
|
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
|
||||||
pub enum Distro {
|
pub enum Distro {
|
||||||
"###
|
"###.to_string();
|
||||||
.to_owned();
|
|
||||||
|
|
||||||
for (variant, AsciiDistro { pattern, .. }) in &variants {
|
for (variant, AsciiDistro { pattern, .. }) in &variants {
|
||||||
write!(
|
write!(buf, r###"
|
||||||
buf,
|
|
||||||
r###"
|
|
||||||
// {pattern})
|
// {pattern})
|
||||||
{variant},
|
{variant},
|
||||||
"###,
|
"###)?;
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.push_str(
|
buf.push_str(
|
||||||
@@ -154,15 +152,11 @@ impl Distro {
|
|||||||
|
|
||||||
let condition = conds.join(" || ");
|
let condition = conds.join(" || ");
|
||||||
|
|
||||||
write!(
|
write!(buf, r###"
|
||||||
buf,
|
|
||||||
r###"
|
|
||||||
if {condition} {{
|
if {condition} {{
|
||||||
return Some(Self::{variant});
|
return Some(Self::{variant});
|
||||||
}}
|
}}
|
||||||
"###
|
"###)?;
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.push_str(
|
buf.push_str(
|
||||||
@@ -177,15 +171,11 @@ impl Distro {
|
|||||||
|
|
||||||
let quotes = "#".repeat(80);
|
let quotes = "#".repeat(80);
|
||||||
for (variant, AsciiDistro { art, .. }) in &variants {
|
for (variant, AsciiDistro { art, .. }) in &variants {
|
||||||
write!(
|
write!(buf, r###"
|
||||||
buf,
|
|
||||||
r###"
|
|
||||||
Self::{variant} => r{quotes}"
|
Self::{variant} => r{quotes}"
|
||||||
{art}
|
{art}
|
||||||
"{quotes},
|
"{quotes},
|
||||||
"###,
|
"###)?;
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.push_str(
|
buf.push_str(
|
||||||
@@ -197,26 +187,23 @@ impl Distro {
|
|||||||
"###,
|
"###,
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::write(out_path.join("distros.rs"), buf).expect("couldn't write distros.rs");
|
fs::write(out_path.join("distros.rs"), buf)?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses ascii distros from neofetch script.
|
/// Parses ascii distros from neofetch script.
|
||||||
fn parse_ascii_distros<P>(neofetch_path: P) -> Vec<AsciiDistro>
|
fn parse_ascii_distros(neofetch_path: &Path) -> Result<Vec<AsciiDistro>>
|
||||||
where
|
|
||||||
P: AsRef<Path>,
|
|
||||||
{
|
{
|
||||||
let neofetch_path = neofetch_path.as_ref();
|
|
||||||
|
|
||||||
let nf = {
|
let nf = {
|
||||||
let nf = fs::read_to_string(neofetch_path).expect("couldn't read neofetch script");
|
let nf = fs::read_to_string(neofetch_path)?;
|
||||||
|
|
||||||
// Get the content of "get_distro_ascii" function
|
// Get the content of "get_distro_ascii" function
|
||||||
let (_, nf) = nf
|
let (_, nf) = nf
|
||||||
.split_once("get_distro_ascii() {\n")
|
.split_once("get_distro_ascii() {\n")
|
||||||
.expect("couldn't find get_distro_ascii function");
|
.context("couldn't find get_distro_ascii function")?;
|
||||||
let (nf, _) = nf
|
let (nf, _) = nf
|
||||||
.split_once("\n}\n")
|
.split_once("\n}\n")
|
||||||
.expect("couldn't find end of get_distro_ascii function");
|
.context("couldn't find end of get_distro_ascii function")?;
|
||||||
|
|
||||||
let mut nf = nf.replace('\t', &" ".repeat(4));
|
let mut nf = nf.replace('\t', &" ".repeat(4));
|
||||||
|
|
||||||
@@ -227,8 +214,8 @@ where
|
|||||||
nf
|
nf
|
||||||
};
|
};
|
||||||
|
|
||||||
let case_re = Regex::new(r"case .*? in\n").expect("couldn't compile case regex");
|
let case_re = Regex::new(r"case .*? in\n")?;
|
||||||
let eof_re = Regex::new(r"EOF[ \n]*?;;").expect("couldn't compile eof regex");
|
let eof_re = Regex::new(r"EOF[ \n]*?;;")?;
|
||||||
|
|
||||||
// Split by blocks
|
// Split by blocks
|
||||||
let mut blocks = Vec::new();
|
let mut blocks = Vec::new();
|
||||||
@@ -262,13 +249,74 @@ where
|
|||||||
// for printf
|
// for printf
|
||||||
let art = art.replace(r"\\", r"\");
|
let art = art.replace(r"\\", r"\");
|
||||||
|
|
||||||
Some(AsciiDistro {
|
Some(AsciiDistro { pattern: pattern.to_owned(), art })
|
||||||
pattern: pattern.to_owned(),
|
|
||||||
art,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
blocks
|
Ok(blocks.iter().filter_map(|block| parse_block(block)).collect())
|
||||||
.iter()
|
}
|
||||||
.filter_map(|block| parse_block(block))
|
|
||||||
.collect()
|
// Preset parsing
|
||||||
|
#[derive(Deserialize, Debug)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
enum PresetEntry {
|
||||||
|
Simple(Vec<String>),
|
||||||
|
Complex { colors: Vec<String>, weights: Option<Vec<u32>> },
|
||||||
|
}
|
||||||
|
|
||||||
|
type PresetMap = IndexMap<String, PresetEntry>;
|
||||||
|
|
||||||
|
fn preset_codegen(json_path: &Path, out_path: &Path) -> Result<()> {
|
||||||
|
// 1. Read and parse the JSON file
|
||||||
|
let json_str = fs::read_to_string(json_path)?;
|
||||||
|
let map: PresetMap = serde_json::from_str(&json_str)?;
|
||||||
|
let mut f = BufWriter::new(fs::File::create(&out_path)?);
|
||||||
|
|
||||||
|
// 2. Build the code string
|
||||||
|
let mut code_decl = String::new();
|
||||||
|
let mut code_match = String::new();
|
||||||
|
for (key, data) in map.iter() {
|
||||||
|
let colors = match data {
|
||||||
|
PresetEntry::Simple(c) => c,
|
||||||
|
PresetEntry::Complex { colors, .. } => colors,
|
||||||
|
};
|
||||||
|
let colors = colors.iter().map(|s| format!("\"{}\"", s)).collect::<Vec<_>>().join(", ");
|
||||||
|
let uck = key.to_upper_camel_case();
|
||||||
|
|
||||||
|
code_decl += &format!(r#"
|
||||||
|
#[serde(rename = "{key}")]
|
||||||
|
#[strum(serialize = "{key}")]
|
||||||
|
{uck},
|
||||||
|
"#);
|
||||||
|
|
||||||
|
let w = if let PresetEntry::Complex { weights: Some(w), .. } = data {
|
||||||
|
format!(".and_then(|c| c.with_weights(vec![{}]))", w.iter().map(|n| n.to_string()).collect::<Vec<_>>().join(", "))
|
||||||
|
} else { "".to_string() };
|
||||||
|
|
||||||
|
code_match += &format!(r#"
|
||||||
|
Preset::{uck} => ColorProfile::from_hex_colors(vec![{colors}]){w},
|
||||||
|
"#);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Write the static map to the generated file
|
||||||
|
writeln!(f, r#"
|
||||||
|
pub use crate::color_profile::ColorProfile;
|
||||||
|
use serde::{{Deserialize, Serialize}};
|
||||||
|
use strum::{{AsRefStr, EnumCount, EnumString, VariantArray, VariantNames}};
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Hash, Debug, AsRefStr, Deserialize, EnumCount, EnumString, Serialize, VariantArray, VariantNames)]
|
||||||
|
pub enum Preset {{
|
||||||
|
{code_decl}
|
||||||
|
}}
|
||||||
|
|
||||||
|
impl Preset {{
|
||||||
|
pub fn color_profile(&self) -> ColorProfile {{
|
||||||
|
(match self {{
|
||||||
|
{code_match}
|
||||||
|
}})
|
||||||
|
.expect("preset color profiles should be valid")
|
||||||
|
}}
|
||||||
|
}}"#)?;
|
||||||
|
|
||||||
|
f.flush()?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ 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, get_distro_name, 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, ColorProfile, Preset};
|
use hyfetch::color_profile::{AssignLightness, ColorProfile};
|
||||||
|
use hyfetch::presets::{Preset};
|
||||||
use hyfetch::{pride_month, printc};
|
use hyfetch::{pride_month, printc};
|
||||||
use hyfetch::types::{AnsiMode, Backend, TerminalTheme};
|
use hyfetch::types::{AnsiMode, Backend, TerminalTheme};
|
||||||
use hyfetch::utils::{get_cache_path, input};
|
use hyfetch::utils::{get_cache_path, input};
|
||||||
@@ -722,8 +723,11 @@ fn create_config(
|
|||||||
// 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.
|
// 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 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(
|
let detected_dst = Some(distro.map_or_else(
|
||||||
|| format!("{:?}", Distro::detect(tmp_dst).unwrap()),
|
|| {
|
||||||
|d| d.to_string(),
|
Distro::detect(&tmp_dst)
|
||||||
|
.map_or("".to_string(), |d| format!("{:?}", d).to_lowercase())
|
||||||
|
},
|
||||||
|
|d| d.to_string().to_lowercase(),
|
||||||
));
|
));
|
||||||
|
|
||||||
// in case someone specified {distro}_small already in the --distro arg
|
// in case someone specified {distro}_small already in the --distro arg
|
||||||
@@ -934,16 +938,19 @@ fn create_config(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save choice
|
// Save choice
|
||||||
color_align = arrangements
|
color_align = if choice == "horizontal" { ColorAlignment::Horizontal }
|
||||||
.into_iter()
|
else if choice == "vertical" { ColorAlignment::Vertical }
|
||||||
.find_map(|(k, ca)| {
|
else {
|
||||||
if k.to_lowercase() == choice {
|
arrangements.into_iter()
|
||||||
Some(ca)
|
.find_map(|(k, ca)| {
|
||||||
} else {
|
if k.to_lowercase() == choice {
|
||||||
None
|
Some(ca)
|
||||||
}
|
} else {
|
||||||
})
|
None
|
||||||
.expect("selected color alignment should be valid");
|
}
|
||||||
|
})
|
||||||
|
.expect("selected color alignment is not valid") // TODO: it sould ask the user to retry instead of panicking
|
||||||
|
};
|
||||||
debug!(?color_align, "selected color alignment");
|
debug!(?color_align, "selected color alignment");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,232 @@
|
|||||||
|
use std::iter;
|
||||||
|
use std::num::{NonZeroU8, NonZeroUsize};
|
||||||
|
|
||||||
|
use anyhow::{anyhow, Result, Context as _};
|
||||||
|
use indexmap::IndexSet;
|
||||||
|
use palette::num::ClampAssign as _;
|
||||||
|
use palette::{IntoColorMut as _, LinSrgb, Okhsl, Srgb};
|
||||||
|
use tracing::debug;
|
||||||
|
use unicode_segmentation::UnicodeSegmentation as _;
|
||||||
|
|
||||||
|
use crate::color_util::{ForegroundBackground, Lightness, ToAnsiString as _};
|
||||||
|
use crate::types::{AnsiMode, TerminalTheme};
|
||||||
|
|
||||||
|
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||||
|
pub struct ColorProfile {
|
||||||
|
pub colors: Vec<Srgb<u8>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq, Debug)]
|
||||||
|
pub enum AssignLightness {
|
||||||
|
Replace(Lightness),
|
||||||
|
ClampMax(Lightness),
|
||||||
|
ClampMin(Lightness),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ColorProfile {
|
||||||
|
pub fn new(colors: Vec<Srgb<u8>>) -> Self {
|
||||||
|
Self { colors }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_hex_colors<S>(hex_colors: Vec<S>) -> Result<Self>
|
||||||
|
where
|
||||||
|
S: AsRef<str>,
|
||||||
|
{
|
||||||
|
let colors = hex_colors
|
||||||
|
.into_iter()
|
||||||
|
.map(|s| s.as_ref().parse())
|
||||||
|
.collect::<Result<_, _>>()
|
||||||
|
.context("failed to parse hex colors")?;
|
||||||
|
Ok(Self::new(colors))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Maps colors based on weights.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `weights` - Weights of each color (`weights[i]` = how many times
|
||||||
|
/// `colors[i]` appears)
|
||||||
|
pub fn with_weights(&self, weights: Vec<u8>) -> Result<Self> {
|
||||||
|
if weights.len() != self.colors.len() {
|
||||||
|
debug!(?weights, ?self.colors, "length mismatch between `weights` and `colors`");
|
||||||
|
return Err(anyhow!(
|
||||||
|
"`weights` should have the same number of elements as `colors`"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut weighted_colors = Vec::new();
|
||||||
|
|
||||||
|
for (i, w) in weights.into_iter().enumerate() {
|
||||||
|
weighted_colors.extend(iter::repeat(self.colors[i]).take(usize::from(w)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(Self::new(weighted_colors))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates a new color profile, with the colors spread to the specified
|
||||||
|
/// length.
|
||||||
|
pub fn with_length(&self, length: NonZeroU8) -> Result<Self> {
|
||||||
|
let orig_len = self.colors.len();
|
||||||
|
let orig_len: NonZeroUsize = orig_len.try_into().expect("`colors` should not be empty");
|
||||||
|
let orig_len: NonZeroU8 = orig_len
|
||||||
|
.try_into()
|
||||||
|
.expect("`colors` should not have more than 255 elements");
|
||||||
|
// TODO: I believe weird things can happen because of this...
|
||||||
|
// if length < orig_len {
|
||||||
|
// unimplemented!("compressing length of color profile not implemented");
|
||||||
|
// }
|
||||||
|
let center_i = usize::from(orig_len.get() / 2);
|
||||||
|
|
||||||
|
// How many copies of each color should be displayed at least?
|
||||||
|
let repeats = length.get().div_euclid(orig_len.get());
|
||||||
|
let mut weights = vec![repeats; NonZeroUsize::from(orig_len).get()];
|
||||||
|
|
||||||
|
// How many extra spaces left?
|
||||||
|
let mut extras = length.get().rem_euclid(orig_len.get());
|
||||||
|
|
||||||
|
// If there is an odd space left, extend the center by one space
|
||||||
|
if extras % 2 == 1 {
|
||||||
|
weights[center_i] = weights[center_i].checked_add(1).unwrap();
|
||||||
|
extras = extras.checked_sub(1).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add weight to border until there's no space left (extras must be even at this
|
||||||
|
// point)
|
||||||
|
let weights_len = weights.len();
|
||||||
|
for border_i in 0..usize::from(extras / 2) {
|
||||||
|
weights[border_i] = weights[border_i].checked_add(1).unwrap();
|
||||||
|
let border_opp = weights_len
|
||||||
|
.checked_sub(border_i)
|
||||||
|
.unwrap()
|
||||||
|
.checked_sub(1)
|
||||||
|
.unwrap();
|
||||||
|
weights[border_opp] = weights[border_opp].checked_add(1).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
self.with_weights(weights)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Colors a text.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `foreground_background` - Whether the color is shown on the foreground
|
||||||
|
/// text or the background block
|
||||||
|
/// * `space_only` - Whether to only color spaces
|
||||||
|
pub fn color_text<S>(
|
||||||
|
&self,
|
||||||
|
txt: S,
|
||||||
|
color_mode: AnsiMode,
|
||||||
|
foreground_background: ForegroundBackground,
|
||||||
|
space_only: bool,
|
||||||
|
) -> Result<String>
|
||||||
|
where
|
||||||
|
S: AsRef<str>,
|
||||||
|
{
|
||||||
|
let txt = txt.as_ref();
|
||||||
|
|
||||||
|
let txt: Vec<&str> = txt.graphemes(true).collect();
|
||||||
|
|
||||||
|
let ColorProfile { colors } = {
|
||||||
|
let length = txt.len();
|
||||||
|
let length: NonZeroUsize = length.try_into().context("`txt` should not be empty")?;
|
||||||
|
let length: NonZeroU8 = length.try_into().with_context(|| {
|
||||||
|
format!(
|
||||||
|
"`txt` should not have more than {limit} characters",
|
||||||
|
limit = u8::MAX
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
self.with_length(length)
|
||||||
|
.with_context(|| format!("failed to spread color profile to length {length}"))?
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut buf = String::new();
|
||||||
|
for (i, &gr) in txt.iter().enumerate() {
|
||||||
|
if space_only && gr != " " {
|
||||||
|
if i > 0 && txt[i.checked_sub(1).unwrap()] == " " {
|
||||||
|
buf.push_str("\x1b[39;49m");
|
||||||
|
}
|
||||||
|
buf.push_str(gr);
|
||||||
|
} else {
|
||||||
|
buf.push_str(&colors[i].to_ansi_string(color_mode, foreground_background));
|
||||||
|
buf.push_str(gr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.push_str("\x1b[39;49m");
|
||||||
|
Ok(buf)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates a new color profile, with the colors lightened by a multiplier.
|
||||||
|
pub fn lighten(&self, multiplier: f32) -> Self {
|
||||||
|
let mut rgb_f32_colors: Vec<LinSrgb> =
|
||||||
|
self.colors.iter().map(|c| c.into_linear()).collect();
|
||||||
|
|
||||||
|
{
|
||||||
|
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
||||||
|
|
||||||
|
for okhsl_f32_color in okhsl_f32_colors {
|
||||||
|
okhsl_f32_color.lightness *= multiplier;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let rgb_u8_colors: Vec<_> = rgb_f32_colors
|
||||||
|
.into_iter()
|
||||||
|
.map(Srgb::<u8>::from_linear)
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
Self {
|
||||||
|
colors: rgb_u8_colors,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates a new color profile, with the colors set to the specified
|
||||||
|
/// [`Okhsl`] lightness value.
|
||||||
|
pub fn with_lightness(&self, assign_lightness: AssignLightness) -> Self {
|
||||||
|
let mut rgb_f32_colors: Vec<LinSrgb> =
|
||||||
|
self.colors.iter().map(|c| c.into_linear()).collect();
|
||||||
|
|
||||||
|
{
|
||||||
|
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
||||||
|
|
||||||
|
for okhsl_f32_color in okhsl_f32_colors {
|
||||||
|
match assign_lightness {
|
||||||
|
AssignLightness::Replace(lightness) => {
|
||||||
|
okhsl_f32_color.lightness = lightness.into();
|
||||||
|
},
|
||||||
|
AssignLightness::ClampMax(lightness) => {
|
||||||
|
okhsl_f32_color.lightness.clamp_max_assign(lightness.into());
|
||||||
|
},
|
||||||
|
AssignLightness::ClampMin(lightness) => {
|
||||||
|
okhsl_f32_color.lightness.clamp_min_assign(lightness.into());
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let rgb_u8_colors: Vec<Srgb<u8>> = rgb_f32_colors
|
||||||
|
.into_iter()
|
||||||
|
.map(Srgb::<u8>::from_linear)
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
Self {
|
||||||
|
colors: rgb_u8_colors,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates a new color profile, with the colors set to the specified
|
||||||
|
/// [`Okhsl`] lightness value, adapted to the terminal theme.
|
||||||
|
pub fn with_lightness_adaptive(&self, lightness: Lightness, theme: TerminalTheme) -> Self {
|
||||||
|
match theme {
|
||||||
|
TerminalTheme::Dark => self.with_lightness(AssignLightness::ClampMin(lightness)),
|
||||||
|
TerminalTheme::Light => self.with_lightness(AssignLightness::ClampMax(lightness)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates another color profile with only the unique colors.
|
||||||
|
pub fn unique_colors(&self) -> Self {
|
||||||
|
let unique_colors: IndexSet<[u8; 3]> = self.colors.iter().map(|&c| c.into()).collect();
|
||||||
|
let unique_colors: Vec<Srgb<u8>> = unique_colors.into_iter().map(|c| c.into()).collect();
|
||||||
|
Self::new(unique_colors)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,3 +9,4 @@ pub mod presets;
|
|||||||
pub mod pride_month;
|
pub mod pride_month;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
pub mod color_profile;
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ use std::borrow::Cow;
|
|||||||
use std::ffi::OsStr;
|
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::{Write as _};
|
||||||
|
#[cfg(windows)]
|
||||||
|
use std::io::{self};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
|
|||||||
@@ -1,932 +1,3 @@
|
|||||||
use std::iter;
|
#![allow(non_camel_case_types)]
|
||||||
use std::num::{NonZeroU8, NonZeroUsize};
|
|
||||||
|
|
||||||
use anyhow::{anyhow, Context as _, Result};
|
include!(concat!(env!("OUT_DIR"), "/presets.rs"));
|
||||||
use indexmap::IndexSet;
|
|
||||||
use palette::num::ClampAssign as _;
|
|
||||||
use palette::{IntoColorMut as _, LinSrgb, Okhsl, Srgb};
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use strum::{AsRefStr, EnumCount, EnumString, VariantArray, VariantNames};
|
|
||||||
use tracing::debug;
|
|
||||||
use unicode_segmentation::UnicodeSegmentation as _;
|
|
||||||
|
|
||||||
use crate::color_util::{ForegroundBackground, Lightness, ToAnsiString as _};
|
|
||||||
use crate::types::{AnsiMode, TerminalTheme};
|
|
||||||
|
|
||||||
#[derive(
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
AsRefStr,
|
|
||||||
Deserialize,
|
|
||||||
EnumCount,
|
|
||||||
EnumString,
|
|
||||||
Serialize,
|
|
||||||
VariantArray,
|
|
||||||
VariantNames,
|
|
||||||
)]
|
|
||||||
#[serde(rename_all = "kebab-case")]
|
|
||||||
#[strum(serialize_all = "kebab-case")]
|
|
||||||
pub enum Preset {
|
|
||||||
Rainbow,
|
|
||||||
|
|
||||||
Transgender,
|
|
||||||
|
|
||||||
Nonbinary,
|
|
||||||
|
|
||||||
Xenogender,
|
|
||||||
|
|
||||||
Agender,
|
|
||||||
|
|
||||||
Queer,
|
|
||||||
|
|
||||||
Genderfluid,
|
|
||||||
|
|
||||||
Bisexual,
|
|
||||||
|
|
||||||
Pansexual,
|
|
||||||
|
|
||||||
Polysexual,
|
|
||||||
|
|
||||||
Omnisexual,
|
|
||||||
|
|
||||||
Omniromantic,
|
|
||||||
|
|
||||||
GayMen,
|
|
||||||
|
|
||||||
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,
|
|
||||||
|
|
||||||
/// High-contrast version of pangender flag
|
|
||||||
#[serde(rename = "pangender.contrast")]
|
|
||||||
#[strum(serialize = "pangender.contrast")]
|
|
||||||
PangenderContrast,
|
|
||||||
|
|
||||||
#[serde(rename = "gendernonconforming1")]
|
|
||||||
#[strum(serialize = "gendernonconforming1")]
|
|
||||||
GenderNonconforming1,
|
|
||||||
|
|
||||||
#[serde(rename = "gendernonconforming2")]
|
|
||||||
#[strum(serialize = "gendernonconforming2")]
|
|
||||||
GenderNonconforming2,
|
|
||||||
|
|
||||||
Femboy,
|
|
||||||
|
|
||||||
Tomboy,
|
|
||||||
|
|
||||||
Gynesexual,
|
|
||||||
|
|
||||||
Androsexual,
|
|
||||||
|
|
||||||
Gendervoid,
|
|
||||||
|
|
||||||
Voidgirl,
|
|
||||||
|
|
||||||
Voidboy,
|
|
||||||
|
|
||||||
NonhumanUnity,
|
|
||||||
|
|
||||||
/// For all the dogs
|
|
||||||
Caninekin,
|
|
||||||
|
|
||||||
Plural,
|
|
||||||
|
|
||||||
Fraysexual,
|
|
||||||
|
|
||||||
Bear,
|
|
||||||
|
|
||||||
Butch,
|
|
||||||
|
|
||||||
Leather,
|
|
||||||
|
|
||||||
Otter,
|
|
||||||
|
|
||||||
Twink,
|
|
||||||
|
|
||||||
Adipophilia,
|
|
||||||
|
|
||||||
Kenochoric,
|
|
||||||
|
|
||||||
Veldian,
|
|
||||||
|
|
||||||
Solian,
|
|
||||||
|
|
||||||
Lunian,
|
|
||||||
|
|
||||||
Polyam,
|
|
||||||
|
|
||||||
Sapphic,
|
|
||||||
|
|
||||||
Androgyne,
|
|
||||||
|
|
||||||
Interprogress,
|
|
||||||
|
|
||||||
Progress,
|
|
||||||
|
|
||||||
Intersex,
|
|
||||||
|
|
||||||
OldPolyam,
|
|
||||||
|
|
||||||
EqualRights,
|
|
||||||
|
|
||||||
Drag,
|
|
||||||
|
|
||||||
Pronounfluid,
|
|
||||||
|
|
||||||
Pronounflux,
|
|
||||||
|
|
||||||
Exipronoun,
|
|
||||||
|
|
||||||
Neopronoun,
|
|
||||||
|
|
||||||
Neofluid,
|
|
||||||
|
|
||||||
Genderqueer,
|
|
||||||
|
|
||||||
Cisgender,
|
|
||||||
|
|
||||||
/// Colors from Gilbert Baker's original 1978 flag design
|
|
||||||
Baker,
|
|
||||||
|
|
||||||
/// Meme flag
|
|
||||||
Beiyang,
|
|
||||||
|
|
||||||
/// Meme flag
|
|
||||||
Burger,
|
|
||||||
|
|
||||||
/// Meme flag
|
|
||||||
#[serde(rename = "throatlozenges")]
|
|
||||||
#[strum(serialize = "throatlozenges")]
|
|
||||||
ThroatLozenges,
|
|
||||||
|
|
||||||
/// Meme flag
|
|
||||||
Band,
|
|
||||||
|
|
||||||
Libragender, Librafeminine, Libramasculine, Libraandrogyne, Libranonbinary,
|
|
||||||
|
|
||||||
Fluidfluxa, Fluidfluxb,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
|
||||||
pub struct ColorProfile {
|
|
||||||
pub colors: Vec<Srgb<u8>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Debug)]
|
|
||||||
pub enum AssignLightness {
|
|
||||||
Replace(Lightness),
|
|
||||||
ClampMax(Lightness),
|
|
||||||
ClampMin(Lightness),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Preset {
|
|
||||||
pub fn color_profile(&self) -> ColorProfile {
|
|
||||||
(match self {
|
|
||||||
Self::Rainbow => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#E50000", "#FF8D00", "#FFEE00", "#028121", "#004CFF", "#770088",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Transgender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#55CDFD", "#F6AAB7", "#FFFFFF", "#F6AAB7", "#55CDFD",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Nonbinary => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#FCF431", "#FCFCFC", "#9D59D2", "#282828"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://commons.wikimedia.org/wiki/File:Xenogender_pride_flag.svg
|
|
||||||
Self::Xenogender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FF6692", "#FF9A98", "#FFB883", "#FBFFA8", "#85BCFF", "#9D85FF", "#A510FF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Agender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#BABABA", "#FFFFFF", "#BAF484", "#FFFFFF", "#BABABA", "#000000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Queer => ColorProfile::from_hex_colors(vec!["#B57FDD", "#FFFFFF", "#49821E"]),
|
|
||||||
|
|
||||||
Self::Genderfluid => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FE76A2", "#FFFFFF", "#BF12D7", "#000000", "#303CBE",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Bisexual => ColorProfile::from_hex_colors(vec!["#D60270", "#9B4F96", "#0038A8"]),
|
|
||||||
|
|
||||||
Self::Pansexual => ColorProfile::from_hex_colors(vec!["#FF1C8D", "#FFD700", "#1AB3FF"]),
|
|
||||||
|
|
||||||
Self::Polysexual => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#F714BA", "#01D66A", "#1594F6"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/omnisexual
|
|
||||||
Self::Omnisexual => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FE9ACE", "#FF53BF", "#200044", "#6760FE", "#8EA6FF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Omniromantic => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FEC8E4", "#FDA1DB", "#89739A", "#ABA7FE", "#BFCEFF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/gay-men
|
|
||||||
Self::GayMen => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#078D70", "#98E8C1", "#FFFFFF", "#7BADE2", "#3D1A78",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Lesbian => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#D62800", "#FF9B56", "#FFFFFF", "#D462A6", "#A40062",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// used colorpicker to source from https://fyeahaltpride.tumblr.com/post/151704251345/could-you-guys-possibly-make-an-abrosexual-pride
|
|
||||||
Self::Abrosexual => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#46D294", "#A3E9CA", "#FFFFFF", "#F78BB3", "#EE1766",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Asexual => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#000000", "#A4A4A4", "#FFFFFF", "#810081"])
|
|
||||||
},
|
|
||||||
|
|
||||||
Self::Aromantic => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#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/
|
|
||||||
Self::Aroace1 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#E28C00", "#ECCD00", "#FFFFFF", "#62AEDC", "#203856",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://flag.library.lgbt/flags/aroace/
|
|
||||||
Self::Aroace2 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#810081", "#A4A4A4", "#FFFFFF", "#A8D47A", "#3BA740",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://flag.library.lgbt/flags/aroace/
|
|
||||||
Self::Aroace3 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#3BA740", "#A8D47A", "#FFFFFF", "#ABABAB", "#000000", "#A4A4A4", "#FFFFFF",
|
|
||||||
"#810081",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/greysexual
|
|
||||||
Self::Greysexual => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#740194", "#AEB1AA", "#FFFFFF", "#AEB1AA", "#740194",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/autosexual
|
|
||||||
Self::Autosexual => ColorProfile::from_hex_colors(vec!["#99D9EA", "#7F7F7F"]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/intergender
|
|
||||||
Self::Intergender => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#900DC2", "#FFE54F", "#900DC2"])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 1, 2]))
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/greygender
|
|
||||||
Self::Greygender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#B3B3B3", "#FFFFFF", "#062383", "#FFFFFF", "#535353",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 1, 2, 1, 2])),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/akiosexual
|
|
||||||
Self::Akiosexual => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#F9485E", "#FEA06A", "#FEF44C", "#FFFFFF", "#000000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/bigender
|
|
||||||
Self::Bigender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#C479A2", "#EDA5CD", "#D6C7E8", "#FFFFFF", "#D6C7E8", "#9AC7E8", "#6D82D1",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// yellow sourced from https://lgbtqia.fandom.com/f/p/4400000000000041031
|
|
||||||
// other colors sourced from demiboy and demigirl flags
|
|
||||||
Self::Demigender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#7F7F7F", "#C4C4C4", "#FBFF75", "#FFFFFF", "#FBFF75", "#C4C4C4", "#7F7F7F",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/demiboy
|
|
||||||
Self::Demiboy => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#7F7F7F", "#C4C4C4", "#9DD7EA", "#FFFFFF", "#9DD7EA", "#C4C4C4", "#7F7F7F",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/demigirl
|
|
||||||
Self::Demigirl => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#7F7F7F", "#C4C4C4", "#FDADC8", "#FFFFFF", "#FDADC8", "#C4C4C4", "#7F7F7F",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/transmasculine
|
|
||||||
Self::Transmasculine => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FF8ABD", "#CDF5FE", "#9AEBFF", "#74DFFF", "#9AEBFF", "#CDF5FE", "#FF8ABD",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// used colorpicker to source from https://www.deviantart.com/pride-flags/art/Trans-Woman-Transfeminine-1-543925985
|
|
||||||
// linked from https://gender.fandom.com/wiki/Transfeminine
|
|
||||||
Self::Transfeminine => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#73DEFF", "#FFE2EE", "#FFB5D6", "#FF8DC0", "#FFB5D6", "#FFE2EE", "#73DEFF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/genderfaun
|
|
||||||
Self::Genderfaun => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FCD689", "#FFF09B", "#FAF9CD", "#FFFFFF", "#8EDED9", "#8CACDE", "#9782EC",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/demifaun
|
|
||||||
Self::Demifaun => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#7F7F7F", "#C6C6C6", "#FCC688", "#FFF19C", "#FFFFFF", "#8DE0D5", "#9682EC",
|
|
||||||
"#C6C6C6", "#7F7F7F",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 2, 1, 1, 1, 1, 1, 2, 2])),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/genderfae
|
|
||||||
Self::Genderfae => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#97C3A5", "#C3DEAE", "#F9FACD", "#FFFFFF", "#FCA2C4", "#DB8AE4", "#A97EDD",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// used colorpicker to source form https://www.deviantart.com/pride-flags/art/Demifae-870194777
|
|
||||||
Self::Demifae => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#7F7F7F", "#C5C5C5", "#97C3A4", "#C4DEAE", "#FFFFFF", "#FCA2C5", "#AB7EDF",
|
|
||||||
"#C5C5C5", "#7F7F7F",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 2, 1, 1, 1, 1, 1, 2, 2])),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/neutrois
|
|
||||||
Self::Neutrois => ColorProfile::from_hex_colors(vec!["#FFFFFF", "#1F9F00", "#000000"]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/biromantic-alternate-2
|
|
||||||
Self::Biromantic1 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#8869A5", "#D8A7D8", "#FFFFFF", "#FDB18D", "#151638",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/autoromantic
|
|
||||||
Self::Autoromantic => ColorProfile::from_hex_colors(
|
|
||||||
// symbol interpreted
|
|
||||||
vec!["#99D9EA", "#3DA542", "#7F7F7F"],
|
|
||||||
)
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 1, 2])),
|
|
||||||
|
|
||||||
// sourced from https://www.flagcolorcodes.com/boyflux-alternate-2
|
|
||||||
Self::Boyflux2 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#E48AE4", "#9A81B4", "#55BFAB", "#FFFFFF", "#A8A8A8", "#81D5EF", "#69ABE5",
|
|
||||||
"#5276D4",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![1, 1, 1, 1, 1, 5, 5, 5])),
|
|
||||||
|
|
||||||
// sourced from https://commons.wikimedia.org/wiki/File:Girlflux_Pride_Flag.jpg
|
|
||||||
Self::Girlflux => ColorProfile::from_hex_colors(vec![
|
|
||||||
"f9e6d7", "f2526c", "bf0311", "e9c587", "bf0311", "f2526c", "f9e6d7",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://www.deviantart.com/pride-flags/art/Genderflux-1-543925589
|
|
||||||
Self::Genderflux => ColorProfile::from_hex_colors(vec![
|
|
||||||
"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
|
|
||||||
Self::Finsexual => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#B18EDF", "#D7B1E2", "#F7CDE9", "#F39FCE", "#EA7BB3",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://web.archive.org/web/20221002181913/https://unlabeledinfo.carrd.co/#flags
|
|
||||||
Self::Unlabeled1 => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#EAF8E4", "#FDFDFB", "#E1EFF7", "#F4E2C4"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://web.archive.org/web/20221002181913/https://unlabeledinfo.carrd.co/#flags
|
|
||||||
Self::Unlabeled2 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#250548", "#FFFFFF", "#F7DCDA", "#EC9BEE", "#9541FA", "#7D2557",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Pangender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFF798", "#FEDDCD", "#FFEBFB", "#FFFFFF", "#FFEBFB", "#FEDDCD", "#FFF798",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// high-contrast version of pangender flag
|
|
||||||
Self::PangenderContrast => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#ffe87f", "#fcbaa6", "#fbc9f3", "#FFFFFF", "#fbc9f3", "#fcbaa6", "#ffe87f",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::GenderNonconforming1 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#50284d", "#96467b", "#5c96f7", "#ffe6f7", "#5c96f7", "#96467b", "#50284d",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![4, 1, 1, 1, 1, 1, 4])),
|
|
||||||
|
|
||||||
Self::GenderNonconforming2 => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#50284d", "#96467b", "#5c96f7", "#ffe6f7", "#5c96f7", "#96467b", "#50284d",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Femboy => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#d260a5", "#e4afcd", "#fefefe", "#57cef8", "#fefefe", "#e4afcd", "#d260a5",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Tomboy => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2f3fb9", "#613a03", "#fefefe", "#f1a9b7", "#fefefe", "#613a03", "#2f3fb9",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from https://lgbtqia.fandom.com/wiki/Gynesexual
|
|
||||||
Self::Gynesexual => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#F4A9B7", "#903F2B", "#5B953B"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://lgbtqia.fandom.com/wiki/Androsexual
|
|
||||||
Self::Androsexual => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#01CCFF", "#603524", "#B799DE"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from: https://gender.fandom.com/wiki/Gendervoid
|
|
||||||
Self::Gendervoid => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#081149", "#4B484B", "#000000", "#4B484B", "#081149",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from: https://gender.fandom.com/wiki/Gendervoid
|
|
||||||
Self::Voidgirl => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#180827", "#7A5A8B", "#E09BED", "#7A5A8B", "#180827",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sourced from: https://gender.fandom.com/wiki/Gendervoid
|
|
||||||
Self::Voidboy => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#0B130C", "#547655", "#66B969", "#547655", "#0B130C",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// used https://twitter.com/foxbrained/status/1667621855518236674/photo/1 as source and colorpicked
|
|
||||||
Self::NonhumanUnity => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#177B49", "#FFFFFF", "#593C90"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// used https://www.tumblr.com/zombpawcoins/745062851267493888/caninekin-canine-therian-flag
|
|
||||||
Self::Caninekin => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2d2822", "#543d25", "#9c754d", "#e8dac2", "#cfad8c", "#b77b55", "#954e31",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// used https://pluralpedia.org/w/Plurality#/media/File:Plural-Flag-1.jpg as source and colorpicked
|
|
||||||
Self::Plural => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2D0625", "#543475", "#7675C3", "#89C7B0", "#F3EDBD",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// sampled from https://es.m.wikipedia.org/wiki/Archivo:Fraysexual_flag.jpg
|
|
||||||
Self::Fraysexual => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#226CB5", "#94E7DD", "#FFFFFF", "#636363"])
|
|
||||||
},
|
|
||||||
|
|
||||||
// sourced from https://commons.wikimedia.org/wiki/File:Bear_Brotherhood_flag.svg
|
|
||||||
Self::Bear => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#623804", "#D56300", "#FEDD63", "#FEE6B8", "#FFFFFF", "#555555",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// colorpicked from https://commons.wikimedia.org/wiki/File:Butch_Flag.png
|
|
||||||
Self::Butch => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#D72800", "#F17623", "#FF9C56", "#FFFDF6", "#FFCE89", "#FEAF02", "#A37000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// colorpicked from https://commons.wikimedia.org/wiki/File:Leather,_Latex,_and_BDSM_pride_-_Light.svg
|
|
||||||
Self::Leather => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#252580", "#000000", "#252580", "#FFFFFF", "#252580", "#000000",
|
|
||||||
"#252580", "#000000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// colorpicked from https://commons.wikimedia.org/wiki/File:Official_Otter_Pride_Flag_by_Bearbackgear.jpg
|
|
||||||
Self::Otter => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#263881", "#5C9DC9", "#FFFFFF", "#3A291D", "#5C9DC9", "#263881",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
|
||||||
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 => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#000000", "#2E1569", "#824DB7", "#C7A1D6"])
|
|
||||||
},
|
|
||||||
|
|
||||||
Self::Veldian => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#D182A8", "#FAF6E0", "#69ACBE", "#5D448F", "#3A113E",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Solian => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFF8ED", "#FFE7A8", "#F1B870", "#A56058", "#46281E",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Lunian => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2F0E62", "#6F41B1", "#889FDF", "#7DDFD5", "#D2F2E2",
|
|
||||||
]),
|
|
||||||
|
|
||||||
// pulled from https://polyamproud.com/flag
|
|
||||||
Self::Polyam => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFFFFF", "#FCBF00", "#009FE3", "#E50051", "#340C46",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Sapphic => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FD8BA8", "#FBF2FF", "#C76BC5", "#FDD768", "#C76BC5", "#FBF2FF", "#FD8BA8",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Androgyne => ColorProfile::from_hex_colors(vec!["#FE007F", "#9832FF", "#00B8E7"]),
|
|
||||||
|
|
||||||
Self::Interprogress => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFD800", "#7902AA", "#FFFFFF", "#FFAFC8", "#74D7EE", "#613915", "#000000",
|
|
||||||
"#E50000", "#FF8D00", "#FFEE00", "#028121", "#004CFF", "#770088",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Progress => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFFFFF", "#FFAFC8", "#74D7EE", "#613915", "#000000", "#E50000", "#FF8D00",
|
|
||||||
"#FFEE00", "#028121", "#004CFF", "#770088",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Intersex => ColorProfile::from_hex_colors(vec!["#FFD800", "#7902AA", "#FFD800"])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 1, 2])),
|
|
||||||
|
|
||||||
Self::OldPolyam => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#0000FF", "#FF0000", "#FFFF00", "#FF0000", "#000000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::EqualRights => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#0000FF", "#FFFF00", "#0000FF", "#FFFF00", "#0000FF",
|
|
||||||
])
|
|
||||||
.and_then(|c| c.with_weights(vec![2, 1, 2, 1, 2])),
|
|
||||||
|
|
||||||
Self::Drag => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#CC67FF", "#FFFFFF", "#FFA3E3", "#FFFFFF", "#3366FF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Pronounfluid => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFB3F9", "#FFFFFF", "#D1FDCB", "#C7B0FF", "#000000", "#B8CCFF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Pronounflux => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FDB3F8", "#B6CCFA", "#18DDD3", "#64FF89", "#FF7690", "#FFFFFF",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Exipronoun => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#1C3D34", "#FFFFFF", "#321848", "#000000"])
|
|
||||||
},
|
|
||||||
|
|
||||||
Self::Neopronoun => {
|
|
||||||
ColorProfile::from_hex_colors(vec!["#BCEC64", "#FFFFFF", "#38077A"])
|
|
||||||
},
|
|
||||||
|
|
||||||
Self::Neofluid => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#FFECA0", "#FFFFFF", "#FFECA0", "#38087A", "#BCEC64",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Genderqueer => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#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![
|
|
||||||
"#DF1B12", "#FFC600", "#01639D", "#FFFFFF", "#000000",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Burger => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#F3A26A", "#498701", "#FD1C13", "#7D3829", "#F3A26A",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::ThroatLozenges => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2759DA", "#03940D", "#F5F100", "#F59B00", "#B71212",
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Band => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#2670C0", "#F5BD00", "#DC0045", "#E0608E"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Libragender => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#808080", "#92D8E9", "#FFF544", "#FFB0CA", "#808080", "#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Librafeminine => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#A3A3A3", "#FFFFFF", "#C6568F", "#FFFFFF", "#A3A3A3", "#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Libramasculine => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#A3A3A3", "#FFFFFF", "#56C5C5", "#FFFFFF", "#A3A3A3", "#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Libraandrogyne => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#A3A3A3", "#FFFFFF", "#9186B1", "#FFFFFF", "#A3A3A3", "#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Libranonbinary => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#000000", "#A3A3A3", "#FFFFFF", "#FFF987", "#FFFFFF", "#A3A3A3", "#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Fluidfluxa => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#ff115f", "#a34aa3", "#00a4e7", "#ffdf00", "#000000", "#ffed71", "#85daff", "#dbadda", "#fe8db1"
|
|
||||||
]),
|
|
||||||
|
|
||||||
Self::Fluidfluxb => ColorProfile::from_hex_colors(vec![
|
|
||||||
"#c6d1d2", "#f47b9d", "#f09f9b", "#e3f09e", "#75eeea", "#52d2ed", "#c6d1d2"
|
|
||||||
]),
|
|
||||||
})
|
|
||||||
.expect("preset color profiles should be valid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ColorProfile {
|
|
||||||
pub fn new(colors: Vec<Srgb<u8>>) -> Self {
|
|
||||||
Self { colors }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn from_hex_colors<S>(hex_colors: Vec<S>) -> Result<Self>
|
|
||||||
where
|
|
||||||
S: AsRef<str>,
|
|
||||||
{
|
|
||||||
let colors = hex_colors
|
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.as_ref().parse())
|
|
||||||
.collect::<Result<_, _>>()
|
|
||||||
.context("failed to parse hex colors")?;
|
|
||||||
Ok(Self::new(colors))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Maps colors based on weights.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
///
|
|
||||||
/// * `weights` - Weights of each color (`weights[i]` = how many times
|
|
||||||
/// `colors[i]` appears)
|
|
||||||
pub fn with_weights(&self, weights: Vec<u8>) -> Result<Self> {
|
|
||||||
if weights.len() != self.colors.len() {
|
|
||||||
debug!(?weights, ?self.colors, "length mismatch between `weights` and `colors`");
|
|
||||||
return Err(anyhow!(
|
|
||||||
"`weights` should have the same number of elements as `colors`"
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut weighted_colors = Vec::new();
|
|
||||||
|
|
||||||
for (i, w) in weights.into_iter().enumerate() {
|
|
||||||
weighted_colors.extend(iter::repeat(self.colors[i]).take(usize::from(w)));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(Self::new(weighted_colors))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new color profile, with the colors spread to the specified
|
|
||||||
/// length.
|
|
||||||
pub fn with_length(&self, length: NonZeroU8) -> Result<Self> {
|
|
||||||
let orig_len = self.colors.len();
|
|
||||||
let orig_len: NonZeroUsize = orig_len.try_into().expect("`colors` should not be empty");
|
|
||||||
let orig_len: NonZeroU8 = orig_len
|
|
||||||
.try_into()
|
|
||||||
.expect("`colors` should not have more than 255 elements");
|
|
||||||
// TODO: I believe weird things can happen because of this...
|
|
||||||
// if length < orig_len {
|
|
||||||
// unimplemented!("compressing length of color profile not implemented");
|
|
||||||
// }
|
|
||||||
let center_i = usize::from(orig_len.get() / 2);
|
|
||||||
|
|
||||||
// How many copies of each color should be displayed at least?
|
|
||||||
let repeats = length.get().div_euclid(orig_len.get());
|
|
||||||
let mut weights = vec![repeats; NonZeroUsize::from(orig_len).get()];
|
|
||||||
|
|
||||||
// How many extra spaces left?
|
|
||||||
let mut extras = length.get().rem_euclid(orig_len.get());
|
|
||||||
|
|
||||||
// If there is an odd space left, extend the center by one space
|
|
||||||
if extras % 2 == 1 {
|
|
||||||
weights[center_i] = weights[center_i].checked_add(1).unwrap();
|
|
||||||
extras = extras.checked_sub(1).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add weight to border until there's no space left (extras must be even at this
|
|
||||||
// point)
|
|
||||||
let weights_len = weights.len();
|
|
||||||
for border_i in 0..usize::from(extras / 2) {
|
|
||||||
weights[border_i] = weights[border_i].checked_add(1).unwrap();
|
|
||||||
let border_opp = weights_len
|
|
||||||
.checked_sub(border_i)
|
|
||||||
.unwrap()
|
|
||||||
.checked_sub(1)
|
|
||||||
.unwrap();
|
|
||||||
weights[border_opp] = weights[border_opp].checked_add(1).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
self.with_weights(weights)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Colors a text.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
///
|
|
||||||
/// * `foreground_background` - Whether the color is shown on the foreground
|
|
||||||
/// text or the background block
|
|
||||||
/// * `space_only` - Whether to only color spaces
|
|
||||||
pub fn color_text<S>(
|
|
||||||
&self,
|
|
||||||
txt: S,
|
|
||||||
color_mode: AnsiMode,
|
|
||||||
foreground_background: ForegroundBackground,
|
|
||||||
space_only: bool,
|
|
||||||
) -> Result<String>
|
|
||||||
where
|
|
||||||
S: AsRef<str>,
|
|
||||||
{
|
|
||||||
let txt = txt.as_ref();
|
|
||||||
|
|
||||||
let txt: Vec<&str> = txt.graphemes(true).collect();
|
|
||||||
|
|
||||||
let ColorProfile { colors } = {
|
|
||||||
let length = txt.len();
|
|
||||||
let length: NonZeroUsize = length.try_into().context("`txt` should not be empty")?;
|
|
||||||
let length: NonZeroU8 = length.try_into().with_context(|| {
|
|
||||||
format!(
|
|
||||||
"`txt` should not have more than {limit} characters",
|
|
||||||
limit = u8::MAX
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
self.with_length(length)
|
|
||||||
.with_context(|| format!("failed to spread color profile to length {length}"))?
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut buf = String::new();
|
|
||||||
for (i, &gr) in txt.iter().enumerate() {
|
|
||||||
if space_only && gr != " " {
|
|
||||||
if i > 0 && txt[i.checked_sub(1).unwrap()] == " " {
|
|
||||||
buf.push_str("\x1b[39;49m");
|
|
||||||
}
|
|
||||||
buf.push_str(gr);
|
|
||||||
} else {
|
|
||||||
buf.push_str(&colors[i].to_ansi_string(color_mode, foreground_background));
|
|
||||||
buf.push_str(gr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buf.push_str("\x1b[39;49m");
|
|
||||||
Ok(buf)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new color profile, with the colors lightened by a multiplier.
|
|
||||||
pub fn lighten(&self, multiplier: f32) -> Self {
|
|
||||||
let mut rgb_f32_colors: Vec<LinSrgb> =
|
|
||||||
self.colors.iter().map(|c| c.into_linear()).collect();
|
|
||||||
|
|
||||||
{
|
|
||||||
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
|
||||||
|
|
||||||
for okhsl_f32_color in okhsl_f32_colors {
|
|
||||||
okhsl_f32_color.lightness *= multiplier;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let rgb_u8_colors: Vec<_> = rgb_f32_colors
|
|
||||||
.into_iter()
|
|
||||||
.map(Srgb::<u8>::from_linear)
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
Self {
|
|
||||||
colors: rgb_u8_colors,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new color profile, with the colors set to the specified
|
|
||||||
/// [`Okhsl`] lightness value.
|
|
||||||
pub fn with_lightness(&self, assign_lightness: AssignLightness) -> Self {
|
|
||||||
let mut rgb_f32_colors: Vec<LinSrgb> =
|
|
||||||
self.colors.iter().map(|c| c.into_linear()).collect();
|
|
||||||
|
|
||||||
{
|
|
||||||
let okhsl_f32_colors: &mut [Okhsl] = &mut rgb_f32_colors.into_color_mut();
|
|
||||||
|
|
||||||
for okhsl_f32_color in okhsl_f32_colors {
|
|
||||||
match assign_lightness {
|
|
||||||
AssignLightness::Replace(lightness) => {
|
|
||||||
okhsl_f32_color.lightness = lightness.into();
|
|
||||||
},
|
|
||||||
AssignLightness::ClampMax(lightness) => {
|
|
||||||
okhsl_f32_color.lightness.clamp_max_assign(lightness.into());
|
|
||||||
},
|
|
||||||
AssignLightness::ClampMin(lightness) => {
|
|
||||||
okhsl_f32_color.lightness.clamp_min_assign(lightness.into());
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let rgb_u8_colors: Vec<Srgb<u8>> = rgb_f32_colors
|
|
||||||
.into_iter()
|
|
||||||
.map(Srgb::<u8>::from_linear)
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
Self {
|
|
||||||
colors: rgb_u8_colors,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new color profile, with the colors set to the specified
|
|
||||||
/// [`Okhsl`] lightness value, adapted to the terminal theme.
|
|
||||||
pub fn with_lightness_adaptive(&self, lightness: Lightness, theme: TerminalTheme) -> Self {
|
|
||||||
match theme {
|
|
||||||
TerminalTheme::Dark => self.with_lightness(AssignLightness::ClampMin(lightness)),
|
|
||||||
TerminalTheme::Light => self.with_lightness(AssignLightness::ClampMax(lightness)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates another color profile with only the unique colors.
|
|
||||||
pub fn unique_colors(&self) -> Self {
|
|
||||||
let unique_colors: IndexSet<[u8; 3]> = self.colors.iter().map(|&c| c.into()).collect();
|
|
||||||
let unique_colors: Vec<Srgb<u8>> = unique_colors.into_iter().map(|c| c.into()).collect();
|
|
||||||
Self::new(unique_colors)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -85,12 +85,7 @@ where
|
|||||||
|
|
||||||
let metadata = match fs::metadata(path) {
|
let metadata = match fs::metadata(path) {
|
||||||
Ok(metadata) => metadata,
|
Ok(metadata) => metadata,
|
||||||
Err(err) if err.kind() == io::ErrorKind::NotFound => {
|
Err(_) => return Ok(None)
|
||||||
return Ok(None);
|
|
||||||
},
|
|
||||||
Err(err) => {
|
|
||||||
return Err(err).with_context(|| format!("failed to get metadata for {path:?}"));
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if !metadata.is_file() {
|
if !metadata.is_file() {
|
||||||
|
|||||||
+5
-4
@@ -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 VERSION: "1" "September 2025" "Version: 2.0.2" "User Commands"
|
.TH VERSION: "1" "November 2025" "Version: 2.0.5" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Version: \- manual page for Version: 2.0.2
|
Version: \- manual page for Version: 2.0.5
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B hyfetch
|
.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
|
[\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
|
||||||
@@ -20,8 +20,9 @@ Use another config file
|
|||||||
[default: "/home/azalea/.config/hyfetch.json"]
|
[default: "/home/azalea/.config/hyfetch.json"]
|
||||||
.TP
|
.TP
|
||||||
\fB\-p\fR, \fB\-\-preset\fR=\fI\,PRESET\/\fR
|
\fB\-p\fR, \fB\-\-preset\fR=\fI\,PRESET\/\fR
|
||||||
Use preset
|
Use preset or comma\-separated color list or comma\-separated hex colors
|
||||||
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}
|
(e.g., "#ff0000,#00ff00,#0000ff")
|
||||||
|
PRESET={rainbow,transgender,nonbinary,xenogender,agender,queer,genderfluid,bisexual,pansexual,polysexual,omnisexual,omniromantic,gay\-men,lesbian,abrosexual,asexual,aromantic,fictosexual,aroace1,aroace2,aroace3,autosexual,intergender,greygender,akiosexual,bigender,demigender,demiboy,demigirl,transmasculine,transfeminine,genderfaun,demifaun,genderfae,demifae,neutrois,biromantic1,biromantic2,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,plural,fraysexual,bear,butch,femme,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,caninekin,libragender,librafeminine,libramasculine,libraandrogyne,libranonbinary,fluidflux1,fluidflux2,transbian,autism,cenelian,transneutral,beiyang,burger,throatlozenges,band,random}
|
||||||
.TP
|
.TP
|
||||||
\fB\-m\fR, \fB\-\-mode\fR=\fI\,MODE\/\fR
|
\fB\-m\fR, \fB\-\-mode\fR=\fI\,MODE\/\fR
|
||||||
Color mode MODE={8bit,rgb}
|
Color mode MODE={8bit,rgb}
|
||||||
|
|||||||
+15
-13
@@ -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" "September 2025" "Neofetch 8.0.2" "User Commands"
|
.TH NEOFETCH "1" "November 2025" "Neofetch 8.0.5" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Neofetch \- manual page for Neofetch 8.0.2
|
Neofetch \- manual page for Neofetch 8.0.5
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B neofetch
|
.B neofetch
|
||||||
\fI\,func_name --option "value" --option "value"\/\fR
|
\fI\,func_name --option "value" --option "value"\/\fR
|
||||||
@@ -356,18 +356,20 @@ Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes,
|
|||||||
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||||
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
||||||
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
||||||
OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
OS, Salix, Sasanqua, Scientific, secureblue, semc, Septor, Serene,
|
||||||
ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS,
|
SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel, Slackware,
|
||||||
Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin,
|
SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS,
|
||||||
SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore, Trisquel,
|
Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch,
|
||||||
Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin,
|
TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||||
Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu\-GNOME,
|
Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
||||||
ubuntu_old02, Ultramarine Linux, unicodearch, Univalent, Univention,
|
Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||||
Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii\-linuxngx, Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2,
|
unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla,
|
||||||
XFerience, Xray_OS, Xubuntu, yiffOS, Zorin have ascii logos.
|
Venom, VNux, Void, VzLinux, wii\-linux\-ngx, Windows, Windows 10,
|
||||||
|
Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS,
|
||||||
|
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.
|
void have 'old' logo variants, use {distro}_old to use them.
|
||||||
.TP
|
.TP
|
||||||
NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos,
|
NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos,
|
||||||
cleanjaro, crux, debian, dragonfly, elementary, endeavouros, fedora,
|
cleanjaro, crux, debian, dragonfly, elementary, endeavouros, fedora,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .py import run_py
|
from .py import run_py
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
VERSION = '2.0.2'
|
from __future__ import annotations
|
||||||
|
|
||||||
|
VERSION = '2.0.5'
|
||||||
|
|||||||
@@ -141,9 +141,9 @@ class RGB:
|
|||||||
g = int(hex[2:4], 16)
|
g = int(hex[2:4], 16)
|
||||||
b = int(hex[4:6], 16)
|
b = int(hex[4:6], 16)
|
||||||
elif len(hex) == 3:
|
elif len(hex) == 3:
|
||||||
r = int(hex[0], 16)
|
r = int(hex[0] * 2, 16)
|
||||||
g = int(hex[1], 16)
|
g = int(hex[1] * 2, 16)
|
||||||
b = int(hex[2], 16)
|
b = int(hex[2] * 2, 16)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Error: invalid hex length")
|
raise ValueError(f"Error: invalid hex length")
|
||||||
return cls(r, g, b)
|
return cls(r, g, b)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from .types import LightDark
|
|||||||
from .__version__ import VERSION
|
from .__version__ import VERSION
|
||||||
|
|
||||||
CONFIG_PATH = Path.home() / '.config/hyfetch.json'
|
CONFIG_PATH = Path.home() / '.config/hyfetch.json'
|
||||||
|
SRC = Path(__file__).parent
|
||||||
|
|
||||||
|
|
||||||
TEST_ASCII = r"""
|
TEST_ASCII = r"""
|
||||||
|
|||||||
@@ -0,0 +1,235 @@
|
|||||||
|
{
|
||||||
|
"rainbow": ["#E50000", "#FF8D00", "#FFEE00", "#028121", "#004CFF", "#770088"],
|
||||||
|
"transgender": ["#55CDFD", "#F6AAB7", "#FFFFFF", "#F6AAB7", "#55CDFD"],
|
||||||
|
"nonbinary": ["#FCF431", "#FCFCFC", "#9D59D2", "#282828"],
|
||||||
|
"xenogender": {
|
||||||
|
"colors": ["#FF6692", "#FF9A98", "#FFB883", "#FBFFA8", "#85BCFF", "#9D85FF", "#A510FF"],
|
||||||
|
"comment": "xenogender sourced from https://commons.wikimedia.org/wiki/File:Xenogender_pride_flag.svg"
|
||||||
|
},
|
||||||
|
"agender": ["#000000", "#BABABA", "#FFFFFF", "#BAF484", "#FFFFFF", "#BABABA", "#000000"],
|
||||||
|
"queer": ["#B57FDD", "#FFFFFF", "#49821E"],
|
||||||
|
"genderfluid": ["#FE76A2", "#FFFFFF", "#BF12D7", "#000000", "#303CBE"],
|
||||||
|
"bisexual": ["#D60270", "#9B4F96", "#0038A8"],
|
||||||
|
"pansexual": ["#FF1C8D", "#FFD700", "#1AB3FF"],
|
||||||
|
"polysexual": ["#F714BA", "#01D66A", "#1594F6"],
|
||||||
|
"omnisexual": {
|
||||||
|
"colors": ["#FE9ACE", "#FF53BF", "#200044", "#6760FE", "#8EA6FF"],
|
||||||
|
"comment": "omnisexual sorced from https://www.flagcolorcodes.com/omnisexual"
|
||||||
|
},
|
||||||
|
"omniromantic": ["#FEC8E4", "#FDA1DB", "#89739A", "#ABA7FE", "#BFCEFF"],
|
||||||
|
"gay-men": {
|
||||||
|
"colors": ["#078D70", "#98E8C1", "#FFFFFF", "#7BADE2", "#3D1A78"],
|
||||||
|
"comment": "gay men sourced from https://www.flagcolorcodes.com/gay-men"
|
||||||
|
},
|
||||||
|
"lesbian": ["#D62800", "#FF9B56", "#FFFFFF", "#D462A6", "#A40062"],
|
||||||
|
"abrosexual": {
|
||||||
|
"colors": ["#46D294", "#A3E9CA", "#FFFFFF", "#F78BB3", "#EE1766"],
|
||||||
|
"comment": "abrosexual used colorpicker to source from https://fyeahaltpride.tumblr.com/post/151704251345/could-you-guys-possibly-make-an-abrosexual-pride"
|
||||||
|
},
|
||||||
|
"asexual": ["#000000", "#A4A4A4", "#FFFFFF", "#810081"],
|
||||||
|
"aromantic": ["#3BA740", "#A8D47A", "#FFFFFF", "#ABABAB", "#000000"],
|
||||||
|
"fictosexual": {
|
||||||
|
"colors": ["#000000", "#C4C4C4", "#A349A5", "#C4C4C4", "#000000"],
|
||||||
|
"comment": "https://orientation.fandom.com/wiki/Fictosexual"
|
||||||
|
},
|
||||||
|
"aroace1": {
|
||||||
|
"colors": ["#E28C00", "#ECCD00", "#FFFFFF", "#62AEDC", "#203856"],
|
||||||
|
"comment": "aroace1 sourced from https://flag.library.lgbt/flags/aroace/"
|
||||||
|
},
|
||||||
|
"aroace2": ["#000000", "#810081", "#A4A4A4", "#FFFFFF", "#A8D47A", "#3BA740"],
|
||||||
|
"aroace3": ["#3BA740", "#A8D47A", "#FFFFFF", "#ABABAB", "#000000", "#A4A4A4", "#FFFFFF", "#810081"],
|
||||||
|
"autosexual": ["#99D9EA", "#7F7F7F"],
|
||||||
|
"intergender": {
|
||||||
|
"colors": ["#900DC2", "#900DC2", "#FFE54F", "#900DC2", "#900DC2"],
|
||||||
|
"comment": "todo: use weighted spacing"
|
||||||
|
},
|
||||||
|
"greygender": ["#B3B3B3", "#B3B3B3", "#FFFFFF", "#062383", "#062383", "#FFFFFF", "#535353", "#535353"],
|
||||||
|
"akiosexual": ["#F9485E", "#FEA06A", "#FEF44C", "#FFFFFF", "#000000"],
|
||||||
|
"bigender": {
|
||||||
|
"colors": ["#C479A2", "#EDA5CD", "#D6C7E8", "#FFFFFF", "#D6C7E8", "#9AC7E8", "#6D82D1"],
|
||||||
|
"comment": "bigender sourced from https://www.flagcolorcodes.com/bigender"
|
||||||
|
},
|
||||||
|
"demigender": {
|
||||||
|
"colors": ["#7F7F7F", "#C4C4C4", "#FBFF75", "#FFFFFF", "#FBFF75", "#C4C4C4", "#7F7F7F"],
|
||||||
|
"comment": "demigender yellow sourced from https://lgbtqia.fandom.com/f/p/4400000000000041031 other colors sourced from demiboy and demigirl flags"
|
||||||
|
},
|
||||||
|
"demiboy": {
|
||||||
|
"colors": ["#7F7F7F", "#C4C4C4", "#9DD7EA", "#FFFFFF", "#9DD7EA", "#C4C4C4", "#7F7F7F"],
|
||||||
|
"comment": "demiboy sourced from https://www.flagcolorcodes.com/demiboy"
|
||||||
|
},
|
||||||
|
"demigirl": {
|
||||||
|
"colors": ["#7F7F7F", "#C4C4C4", "#FDADC8", "#FFFFFF", "#FDADC8", "#C4C4C4", "#7F7F7F"],
|
||||||
|
"comment": "demigirl sourced from https://www.flagcolorcodes.com/demigirl"
|
||||||
|
},
|
||||||
|
"transmasculine": ["#FF8ABD", "#CDF5FE", "#9AEBFF", "#74DFFF", "#9AEBFF", "#CDF5FE", "#FF8ABD"],
|
||||||
|
"transfeminine": {
|
||||||
|
"colors": ["#73DEFF", "#FFE2EE", "#FFB5D6", "#FF8DC0", "#FFB5D6", "#FFE2EE", "#73DEFF"],
|
||||||
|
"comment": "transfeminine used colorpicker to source from https://www.deviantart.com/pride-flags/art/Trans-Woman-Transfeminine-1-543925985 linked from https://gender.fandom.com/wiki/Transfeminine"
|
||||||
|
},
|
||||||
|
"genderfaun": {
|
||||||
|
"colors": ["#FCD689", "#FFF09B", "#FAF9CD", "#FFFFFF", "#8EDED9", "#8CACDE", "#9782EC"],
|
||||||
|
"comment": "genderfaun sourced from https://www.flagcolorcodes.com/genderfaun"
|
||||||
|
},
|
||||||
|
"demifaun": ["#7F7F7F", "#7F7F7F", "#C6C6C6", "#C6C6C6", "#FCC688", "#FFF19C", "#FFFFFF", "#8DE0D5", "#9682EC", "#C6C6C6", "#C6C6C6", "#7F7F7F", "#7F7F7F"],
|
||||||
|
"genderfae": {
|
||||||
|
"colors": ["#97C3A5", "#C3DEAE", "#F9FACD", "#FFFFFF", "#FCA2C4", "#DB8AE4", "#A97EDD"],
|
||||||
|
"comment": "genderfae sourced from https://www.flagcolorcodes.com/genderfae"
|
||||||
|
},
|
||||||
|
"demifae": {
|
||||||
|
"colors": ["#7F7F7F", "#7F7F7F", "#C5C5C5", "#C5C5C5", "#97C3A4", "#C4DEAE", "#FFFFFF", "#FCA2C5", "#AB7EDF", "#C5C5C5", "#C5C5C5", "#7F7F7F", "#7F7F7F"],
|
||||||
|
"comment": "demifae used colorpicker to source form https://www.deviantart.com/pride-flags/art/Demifae-870194777"
|
||||||
|
},
|
||||||
|
"neutrois": ["#FFFFFF", "#1F9F00", "#000000"],
|
||||||
|
"biromantic1": ["#8869A5", "#D8A7D8", "#FFFFFF", "#FDB18D", "#151638"],
|
||||||
|
"biromantic2": ["#740194", "#AEB1AA", "#FFFFFF", "#AEB1AA", "#740194"],
|
||||||
|
"autoromantic": {
|
||||||
|
"colors": ["#99D9EA", "#99D9EA", "#3DA542", "#7F7F7F", "#7F7F7F"],
|
||||||
|
"comment": "symbol interpreted"
|
||||||
|
},
|
||||||
|
"boyflux2": {
|
||||||
|
"colors": ["#E48AE4", "#9A81B4", "#55BFAB", "#FFFFFF", "#A8A8A8", "#81D5EF", "#69ABE5", "#5276D4"],
|
||||||
|
"weights": [1, 1, 1, 1, 1, 5, 5, 5]
|
||||||
|
},
|
||||||
|
"girlflux": {
|
||||||
|
"colors": ["#F9E6D7", "#F2526C", "#BF0311", "#E9C587", "#BF0311", "#F2526C", "#F9E6D7"],
|
||||||
|
"comment": "sourced from https://commons.wikimedia.org/wiki/File:Girlflux_Pride_Flag.jpg"
|
||||||
|
},
|
||||||
|
"genderflux": {
|
||||||
|
"colors": ["#F47694", "#F2A2B9", "#CECECE", "#7CE0F7", "#3ECDF9", "#FFF48D"],
|
||||||
|
"comment": "sourced from https://www.deviantart.com/pride-flags/art/Genderflux-1-543925589"
|
||||||
|
},
|
||||||
|
"nullflux": {
|
||||||
|
"colors": ["#0B0C0E", "#A28DB9", "#E1D4EF", "#F0E6DD", "#665858"],
|
||||||
|
"comment": "https://lgbtqia.wiki/wiki/Gendernull"
|
||||||
|
},
|
||||||
|
"hypergender": ["#EFEFEF", "#FFFFFF", "#FBFF75", "#000000", "#FBFF75", "#FFFFFF", "#EFEFEF"],
|
||||||
|
"hyperboy": ["#EFEFEF", "#FFFFFF", "#74D7FE", "#000000", "#74D7FE", "#FFFFFF", "#EFEFEF"],
|
||||||
|
"hypergirl": ["#EFEFEF", "#FFFFFF", "#FC76D3", "#000000", "#FC76D3", "#FFFFFF", "#EFEFEF"],
|
||||||
|
"hyperandrogyne": ["#EFEFEF", "#FFFFFF", "#BB83FF", "#000000", "#BB83FF", "#FFFFFF", "#EFEFEF"],
|
||||||
|
"hyperneutrois": ["#EFEFEF", "#FFFFFF", "#BAFA74", "#000000", "#BAFA74", "#FFFFFF", "#EFEFEF"],
|
||||||
|
"finsexual": ["#B18EDF", "#D7B1E2", "#F7CDE9", "#F39FCE", "#EA7BB3"],
|
||||||
|
"unlabeled1": ["#EAF8E4", "#FDFDFB", "#E1EFF7", "#F4E2C4"],
|
||||||
|
"unlabeled2": ["#250548", "#FFFFFF", "#F7DCDA", "#EC9BEE", "#9541FA", "#7D2557"],
|
||||||
|
"pangender": ["#FFF798", "#FEDDCD", "#FFEBFB", "#FFFFFF", "#FFEBFB", "#FEDDCD", "#FFF798"],
|
||||||
|
"pangender.contrast": ["#FFE87F", "#FCBAA6", "#FBC9F3", "#FFFFFF", "#FBC9F3", "#FCBAA6", "#FFE87F"],
|
||||||
|
"gendernonconforming1": {
|
||||||
|
"colors": ["#50284D", "#96467B", "#5C96F7", "#FFE6F7", "#5C96F7", "#96467B", "#50284D"],
|
||||||
|
"weights": [4, 1, 1, 1, 1, 1, 4]
|
||||||
|
},
|
||||||
|
"gendernonconforming2": ["#50284D", "#96467B", "#5C96F7", "#FFE6F7", "#5C96F7", "#96467B", "#50284D"],
|
||||||
|
"femboy": ["#D260A5", "#E4AFCD", "#FEFEFE", "#57CEF8", "#FEFEFE", "#E4AFCD", "#D260A5"],
|
||||||
|
"tomboy": ["#2F3FB9", "#613A03", "#FEFEFE", "#F1A9B7", "#FEFEFE", "#613A03", "#2F3FB9"],
|
||||||
|
"gynesexual": ["#F4A9B7", "#903F2B", "#5B953B"],
|
||||||
|
"androsexual": ["#01CCFF", "#603524", "#B799DE"],
|
||||||
|
"gendervoid": {
|
||||||
|
"colors": ["#081149", "#4B484B", "#000000", "#4B484B", "#081149"],
|
||||||
|
"comment": "gendervoid and related flags sourced from: https://gender.fandom.com/wiki/Gendervoid"
|
||||||
|
},
|
||||||
|
"voidgirl": ["#180827", "#7A5A8B", "#E09BED", "#7A5A8B", "#180827"],
|
||||||
|
"voidboy": ["#0B130C", "#547655", "#66B969", "#547655", "#0B130C"],
|
||||||
|
"nonhuman-unity": {
|
||||||
|
"colors": ["#177B49", "#FFFFFF", "#593C90"],
|
||||||
|
"comment": "used https://twitter.com/foxbrained/status/1667621855518236674/photo/1 as source and colorpicked"
|
||||||
|
},
|
||||||
|
"plural": {
|
||||||
|
"colors": ["#2D0625", "#543475", "#7675C3", "#89C7B0", "#F3EDBD"],
|
||||||
|
"comment": "used https://pluralpedia.org/w/Plurality#/media/File:Plural-Flag-1.jpg as source and colorpicked"
|
||||||
|
},
|
||||||
|
"fraysexual": {
|
||||||
|
"colors": ["#226CB5", "#94E7DD", "#FFFFFF", "#636363"],
|
||||||
|
"comment": "sampled from https://es.m.wikipedia.org/wiki/Archivo:Fraysexual_flag.jpg"
|
||||||
|
},
|
||||||
|
"bear": {
|
||||||
|
"colors": ["#623804", "#D56300", "#FEDD63", "#FEE6B8", "#FFFFFF", "#555555"],
|
||||||
|
"comment": "sourced from https://commons.wikimedia.org/wiki/File:Bear_Brotherhood_flag.svg"
|
||||||
|
},
|
||||||
|
"butch": {
|
||||||
|
"colors": ["#D72800", "#F17623", "#FF9C56", "#FFFDF6", "#FFCE89", "#FEAF02", "#A37000"],
|
||||||
|
"comment": "colorpicked from https://commons.wikimedia.org/wiki/File:Butch_Flag.png"
|
||||||
|
},
|
||||||
|
"femme" : {
|
||||||
|
"colors": ["#FF1A87", "#FF6AB1", "#FFFFFF", "#9A0731", "51091D"],
|
||||||
|
"comment": "colorpicked from https://lgbtqia.wiki/wiki/Femme"
|
||||||
|
},
|
||||||
|
"leather": {
|
||||||
|
"colors": ["#000000", "#252580", "#000000", "#252580", "#FFFFFF", "#252580", "#000000", "#252580", "#000000"],
|
||||||
|
"comment": "colorpicked from https://commons.wikimedia.org/wiki/File:Leather,_Latex,_and_BDSM_pride_-_Light.svg"
|
||||||
|
},
|
||||||
|
"otter": {
|
||||||
|
"colors": ["#263881", "#5C9DC9", "#FFFFFF", "#3A291D", "#5C9DC9", "#263881"],
|
||||||
|
"comment": "colorpicked from https://commons.wikimedia.org/wiki/File:Official_Otter_Pride_Flag_by_Bearbackgear.jpg"
|
||||||
|
},
|
||||||
|
"twink": {
|
||||||
|
"colors": ["#FFB2FF", "#FFFFFF", "#FFFF81"],
|
||||||
|
"comment": "colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg"
|
||||||
|
},
|
||||||
|
"adipophilia": {
|
||||||
|
"colors": ["#000000", "#E16180", "#FFF9BE", "#603E41", "#000000"],
|
||||||
|
"comment": "https://en.wikipedia.org/wiki/File:FatFetishFlag.png"
|
||||||
|
},
|
||||||
|
"kenochoric": ["#000000", "#2E1569", "#824DB7", "#C7A1D6"],
|
||||||
|
"veldian": ["#D182A8", "#FAF6E0", "#69ACBE", "#5D448F", "#3A113E"],
|
||||||
|
"solian": ["#FFF8ED", "#FFE7A8", "#F1B870", "#A56058", "#46281E"],
|
||||||
|
"lunian": ["#2F0E62", "#6F41B1", "#889FDF", "#7DDFD5", "#D2F2E2"],
|
||||||
|
"polyam": {
|
||||||
|
"colors": ["#FFFFFF", "#FCBF00", "#009FE3", "#E50051", "#340C46"],
|
||||||
|
"comment": "polyamorous flag colors pulled from https://polyamproud.com/flag"
|
||||||
|
},
|
||||||
|
"sapphic": ["#FD8BA8", "#FBF2FF", "#C76BC5", "#FDD768", "#C76BC5", "#FBF2FF", "#FD8BA8"],
|
||||||
|
"androgyne": ["#FE007F", "#9832FF", "#00B8E7"],
|
||||||
|
"interprogress": ["#FFD800", "#7902AA", "#FFFFFF", "#FFAFC8", "#74D7EE", "#613915", "#000000", "#E50000", "#FF8D00", "#FFEE00", "#028121", "#004CFF", "#770088"],
|
||||||
|
"progress": ["#FFFFFF", "#FFAFC8", "#74D7EE", "#613915", "#000000", "#E50000", "#FF8D00", "#FFEE00", "#028121", "#004CFF", "#770088"],
|
||||||
|
"intersex": ["#FFD800", "#FFD800", "#7902AA", "#FFD800", "#FFD800"],
|
||||||
|
"old-polyam": ["#0000FF", "#FF0000", "#FFFF00", "#FF0000", "#000000"],
|
||||||
|
"equal-rights": ["#0000FF", "#0000FF", "#FFFF00", "#0000FF", "#0000FF", "#FFFF00", "#0000FF", "#0000FF"],
|
||||||
|
"drag": ["#CC67FF", "#FFFFFF", "#FFA3E3", "#FFFFFF", "#3366FF"],
|
||||||
|
"pronounfluid": ["#FFB3F9", "#FFFFFF", "#D1FDCB", "#C7B0FF", "#000000", "#B8CCFF"],
|
||||||
|
"pronounflux": ["#FDB3F8", "#B6CCFA", "#18DDD3", "#64FF89", "#FF7690", "#FFFFFF"],
|
||||||
|
"exipronoun": ["#1C3D34", "#FFFFFF", "#321848", "#000000"],
|
||||||
|
"neopronoun": ["#BCEC64", "#FFFFFF", "#38077A"],
|
||||||
|
"neofluid": ["#FFECA0", "#FFFFFF", "#FFECA0", "#38087A", "#BCEC64"],
|
||||||
|
"genderqueer": ["#B57EDC", "#B57EDC", "#FFFFFF", "#FFFFFF", "#4A8123", "#4A8123"],
|
||||||
|
"cisgender": ["#D70270", "#0038A7"],
|
||||||
|
"baker": {
|
||||||
|
"colors": ["#F23D9E", "#F80A24", "#F78022", "#F9E81F", "#1E972E", "#1B86BC", "#243897", "#6F0A82"],
|
||||||
|
"comment": "colors from Gilbert Baker's original 1978 flag design used https://gilbertbaker.com/rainbow-flag-color-meanings/ as source and colorpicked"
|
||||||
|
},
|
||||||
|
"caninekin": {
|
||||||
|
"colors": ["#2D2822", "#543D25", "#9C754D", "#E8DAC2", "#CFAD8C", "#B77B55", "#954E31"],
|
||||||
|
"comment": "this is 4 all the dogs, from zombpawcoins on tumblr!"
|
||||||
|
},
|
||||||
|
"libragender": {
|
||||||
|
"colors": ["#000000", "#808080", "#92D8E9", "#FFF544", "#FFB0CA", "#808080", "#000000"],
|
||||||
|
"comment": "Sourced from https://lgbtqia.wiki/wiki/Libragender"
|
||||||
|
},
|
||||||
|
"librafeminine": {
|
||||||
|
"colors": ["#000000", "#A3A3A3", "#FFFFFF", "#C6568F", "#FFFFFF", "#A3A3A3", "#000000"],
|
||||||
|
"comment": "Sourced from https://lgbtqia.wiki/wiki/Librafeminine"
|
||||||
|
},
|
||||||
|
"libramasculine": {
|
||||||
|
"colors": ["#000000", "#A3A3A3", "#FFFFFF", "#56C5C5", "#FFFFFF", "#A3A3A3", "#000000"],
|
||||||
|
"comment": "Sourced from https://lgbtqia.wiki/wiki/Libramasculine"
|
||||||
|
},
|
||||||
|
"libraandrogyne": {
|
||||||
|
"colors": ["#000000", "#A3A3A3", "#FFFFFF", "#9186B1", "#FFFFFF", "#A3A3A3", "#000000"],
|
||||||
|
"comment": "Sourced from https://lgbtqia.wiki/wiki/Librandrogyne"
|
||||||
|
},
|
||||||
|
"libranonbinary": {
|
||||||
|
"colors": ["#000000", "#A3A3A3", "#FFFFFF", "#FFF987", "#FFFFFF", "#A3A3A3", "#000000"],
|
||||||
|
"comment": "Sourced from https://lgbtqia.wiki/wiki/Libranonbinary"
|
||||||
|
},
|
||||||
|
"fluidflux1": {
|
||||||
|
"colors": ["#FF115F", "#A34AA3", "#00A4E7", "#FFDF00", "#000000", "#FFED71", "#85DAFF", "#DBADDA", "#FE8DB1"],
|
||||||
|
"comment": "Sourced from https://gender.fandom.com/wiki/Fluidflux?file=FC90B24D-CA36-4FE2-A752-C9ABFC65E332.jpeg"
|
||||||
|
},
|
||||||
|
"fluidflux2": ["#C6D1D2", "#F47B9D", "#F09F9B", "#E3F09E", "#75EEEA", "#52D2ED", "#C6D1D2"],
|
||||||
|
"transbian": ["#03A3E6", "#F8B4CD","#FAFBF9", "#FA9C57", "#A80864"],
|
||||||
|
"autism":["#C94A49", "#DE7554", "#DBB667", "#6FA35D", "#2E7574", "#232828"],
|
||||||
|
"cenelian":["#FFE7B6", "#93554A", "#52203A", "#7E4A93", "#99AFD6"],
|
||||||
|
"transneutral":["#74DFFF", "#FFFDB3", "#FFFC75", "#FFF200", "#FFFC75", "#FFFDB3", "#FE8CBF"],
|
||||||
|
|
||||||
|
"beiyang": ["#DF1B12", "#FFC600", "#01639D", "#FFFFFF", "#000000"],
|
||||||
|
"burger": ["#F3A26A", "#498701", "#FD1C13", "#7D3829", "#F3A26A"],
|
||||||
|
"throatlozenges": ["#2759DA", "#03940D", "#F5F100", "#F59B00", "#B71212"],
|
||||||
|
"band": ["#2670C0", "#F5BD00", "#DC0045", "#E0608E"]
|
||||||
|
}
|
||||||
@@ -1448,6 +1448,10 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .void_small import void_small
|
from .void_small import void_small
|
||||||
return void_small
|
return void_small
|
||||||
|
|
||||||
|
if name == 'void_old':
|
||||||
|
from .void_old import void_old
|
||||||
|
return void_old
|
||||||
|
|
||||||
if name.startswith('void'):
|
if name.startswith('void'):
|
||||||
from .void import void
|
from .void import void
|
||||||
return void
|
return void
|
||||||
@@ -1508,6 +1512,10 @@ def detect(name: str) -> AsciiArt | None:
|
|||||||
from .soda import soda
|
from .soda import soda
|
||||||
return soda
|
return soda
|
||||||
|
|
||||||
|
if name.startswith('secureblue'):
|
||||||
|
from .secureblue import secureblue
|
||||||
|
return secureblue
|
||||||
|
|
||||||
if name.startswith('krassos') or name.startswith('krass'):
|
if name.startswith('krassos') or name.startswith('krass'):
|
||||||
from .krassos import krassos
|
from .krassos import krassos
|
||||||
return krassos
|
return krassos
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
secureblue = AsciiArt(match=r'''"secureblue"*''', color='12 7', ascii=r"""
|
||||||
|
${c1} ==++++++++++
|
||||||
|
${c1} :========++++++++++++:
|
||||||
|
${c1} ===============+++++++++++
|
||||||
|
${c1} ====================++++++++++
|
||||||
|
${c1} :=============${c2}#%@@%*${c1}=====++++++++-
|
||||||
|
${c1} -============${c2}%@%+++*@@*${c1}=======+++++=
|
||||||
|
${c1} -============${c2}%@#${c1}======${c2}@@${c1}==========+++-
|
||||||
|
${c1} =============${c2}%@+${c1}======${c2}@@${c1}==============.
|
||||||
|
${c1}--=========${c2}*@@@@@@@@@@@@@@@%${c1}+==========-
|
||||||
|
${c1}------=====${c2}%@@@@@@@@@@@@@@@@*${c1}===========
|
||||||
|
${c1}---------==${c2}%@@@@@@@%%@@@@@@@*${c1}===========
|
||||||
|
${c1}:----------${c2}%@@@@@#${c1}===${c2}+%@@@@@*${c1}==========-
|
||||||
|
${c1} ----------${c2}%@@@@@%*${c1}==${c2}*@@@@@@*${c1}==========.
|
||||||
|
${c1} :---------${c2}%@@@@@@@@@@@@@@@@*${c1}=========-
|
||||||
|
${c1} :--------${c2}%@@@@@@@@@@@@@@@@*${c1}========-
|
||||||
|
${c1} :--------${c2}###############+${c1}========:
|
||||||
|
${c1} -------------------------====-
|
||||||
|
${c1} --------------------------
|
||||||
|
${c1} .--------------------.
|
||||||
|
${c1} ------------
|
||||||
|
""")
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# This file is automatically generated. Please do not modify.
|
||||||
|
|
||||||
|
from . import AsciiArt
|
||||||
|
|
||||||
|
void_old = AsciiArt(match=r'''"void_old"''', color='2 8', ascii=r"""
|
||||||
|
${c1} __.;=====;.__
|
||||||
|
_.=+==++=++=+=+===;.
|
||||||
|
-=+++=+===+=+=+++++=_
|
||||||
|
. -=:`` `--==+=++==.
|
||||||
|
_vi, ` --+=++++:
|
||||||
|
.uvnvi. _._ -==+==+.
|
||||||
|
.vvnvnI` .;==|==;. :|=||=|.
|
||||||
|
${c2}+QmQQm${c1}pvvnv; ${c2}_yYsyQQWUUQQQm #QmQ#${c1}:${c2}QQQWUV$QQmL
|
||||||
|
${c2} -QQWQW${c1}pvvo${c2}wZ?.wQQQE${c1}==<${c2}QWWQ/QWQW.QQWW${c1}(: ${c2}jQWQE
|
||||||
|
${c2} -$QQQQmmU' jQQQ@${c1}+=<${c2}QWQQ)mQQQ.mQQQC${c1}+;${c2}jWQQ@'
|
||||||
|
${c2} -$WQ8Y${c1}nI: ${c2}QWQQwgQQWV${c1}`${c2}mWQQ.jQWQQgyyWW@!
|
||||||
|
${c1} -1vvnvv. `~+++` ++|+++
|
||||||
|
+vnvnnv, `-|===
|
||||||
|
+vnvnvns. . :=-
|
||||||
|
-Invnvvnsi..___..=sv=. `
|
||||||
|
+Invnvnvnnnnnnnnvvnn;.
|
||||||
|
~|Invnvnvvnvvvnnv}+`
|
||||||
|
-~|{*l}*|
|
||||||
|
""")
|
||||||
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import json
|
from __future__ import annotations
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from hyfetch.constants import CACHE_PATH
|
import json
|
||||||
from hyfetch.neofetch_util import get_distro_name
|
|
||||||
|
from .constants import CACHE_PATH, SRC
|
||||||
|
from .neofetch_util import get_distro_name
|
||||||
|
|
||||||
|
|
||||||
def get_font_logo() -> str:
|
def get_font_logo() -> str:
|
||||||
@@ -10,7 +11,7 @@ def get_font_logo() -> str:
|
|||||||
if cache.exists():
|
if cache.exists():
|
||||||
return cache.read_text('utf-8')
|
return cache.read_text('utf-8')
|
||||||
|
|
||||||
font_logos: dict[str, str] = json.loads((Path(__file__).parent / 'data/font_logos.json').read_text('utf-8'))
|
font_logos: dict[str, str] = json.loads((SRC / 'data/font_logos.json').read_text('utf-8'))
|
||||||
font_logos = {k.lower(): v for k, v in font_logos.items()}
|
font_logos = {k.lower(): v for k, v in font_logos.items()}
|
||||||
|
|
||||||
# Get the distro
|
# Get the distro
|
||||||
|
|||||||
+1
-1
@@ -503,7 +503,7 @@ def run():
|
|||||||
print(f'Error: invalid hex color "{color}"')
|
print(f'Error: invalid hex color "{color}"')
|
||||||
preset = ColorProfile(colors)
|
preset = ColorProfile(colors)
|
||||||
else:
|
else:
|
||||||
print(f'Preset should be a comma-separated list of hex colors, or one of the following: {', '.join(sorted(PRESETS.keys()))}')
|
print(f'Preset should be a comma-separated list of hex colors, or one of the following: {", ".join(sorted(PRESETS.keys()))}')
|
||||||
|
|
||||||
if preset is None:
|
if preset is None:
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|||||||
@@ -14,14 +14,13 @@ from tempfile import TemporaryDirectory
|
|||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from .color_util import color, printc
|
from .color_util import color, printc
|
||||||
from .constants import GLOBAL_CFG, IS_WINDOWS
|
from .constants import GLOBAL_CFG, IS_WINDOWS, SRC
|
||||||
from .distros import distro_detector
|
from .distros import distro_detector
|
||||||
from .presets import ColorProfile
|
from .presets import ColorProfile
|
||||||
from .serializer import from_dict
|
from .serializer import from_dict
|
||||||
from .types import BackendLiteral, ColorAlignMode
|
from .types import BackendLiteral, ColorAlignMode
|
||||||
|
|
||||||
RE_NEOFETCH_COLOR = re.compile('\\${c[0-9]}')
|
RE_NEOFETCH_COLOR = re.compile('\\${c[0-9]}')
|
||||||
SRC = Path(__file__).parent
|
|
||||||
|
|
||||||
|
|
||||||
def literal_input(prompt: str, options: Iterable[str], default: str, show_ops: bool = True) -> str:
|
def literal_input(prompt: str, options: Iterable[str], default: str, show_ops: bool = True) -> str:
|
||||||
|
|||||||
+14
-928
@@ -1,9 +1,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from .color_util import RGB
|
from .color_util import RGB
|
||||||
from .constants import GLOBAL_CFG
|
from .constants import GLOBAL_CFG, SRC
|
||||||
from .types import LightDark, ColorSpacing
|
from .types import LightDark, ColorSpacing
|
||||||
|
|
||||||
|
|
||||||
@@ -21,6 +22,16 @@ class ColorProfile:
|
|||||||
colors: list[RGB]
|
colors: list[RGB]
|
||||||
spacing: ColorSpacing = 'equal'
|
spacing: ColorSpacing = 'equal'
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def from_json(data: list | dict) -> 'ColorProfile':
|
||||||
|
if isinstance(data, list):
|
||||||
|
return ColorProfile(data)
|
||||||
|
else:
|
||||||
|
pf = ColorProfile(data['colors'])
|
||||||
|
if 'weights' in data:
|
||||||
|
pf = ColorProfile(pf.with_weights(data['weights']))
|
||||||
|
return pf
|
||||||
|
|
||||||
def __init__(self, colors: list[str] | list[RGB]):
|
def __init__(self, colors: list[str] | list[RGB]):
|
||||||
if isinstance(colors[0], str):
|
if isinstance(colors[0], str):
|
||||||
self.raw = colors
|
self.raw = colors
|
||||||
@@ -165,931 +176,6 @@ class ColorProfile:
|
|||||||
|
|
||||||
|
|
||||||
PRESETS: dict[str, ColorProfile] = {
|
PRESETS: dict[str, ColorProfile] = {
|
||||||
'rainbow': ColorProfile([
|
k: ColorProfile.from_json(v)
|
||||||
'#E50000',
|
for k, v in json.loads((SRC / 'data/presets.json').read_text('utf-8')).items()
|
||||||
'#FF8D00',
|
|
||||||
'#FFEE00',
|
|
||||||
'#028121',
|
|
||||||
'#004CFF',
|
|
||||||
'#770088'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'transgender': ColorProfile([
|
|
||||||
'#55CDFD',
|
|
||||||
'#F6AAB7',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#F6AAB7',
|
|
||||||
'#55CDFD'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'nonbinary': ColorProfile([
|
|
||||||
'#FCF431',
|
|
||||||
'#FCFCFC',
|
|
||||||
'#9D59D2',
|
|
||||||
'#282828'
|
|
||||||
]),
|
|
||||||
|
|
||||||
# xenogender sourced from https://commons.wikimedia.org/wiki/File:Xenogender_pride_flag.svg
|
|
||||||
'xenogender': ColorProfile([
|
|
||||||
'#FF6692',
|
|
||||||
'#FF9A98',
|
|
||||||
'#FFB883',
|
|
||||||
'#FBFFA8',
|
|
||||||
'#85BCFF',
|
|
||||||
'#9D85FF',
|
|
||||||
'#A510FF'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'agender': ColorProfile([
|
|
||||||
'#000000',
|
|
||||||
'#BABABA',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#BAF484',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#BABABA',
|
|
||||||
'#000000'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'queer': ColorProfile([
|
|
||||||
'#B57FDD',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#49821E'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'genderfluid': ColorProfile([
|
|
||||||
'#FE76A2',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#BF12D7',
|
|
||||||
'#000000',
|
|
||||||
'#303CBE'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'bisexual': ColorProfile([
|
|
||||||
'#D60270',
|
|
||||||
'#9B4F96',
|
|
||||||
'#0038A8'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'pansexual': ColorProfile([
|
|
||||||
'#FF1C8D',
|
|
||||||
'#FFD700',
|
|
||||||
'#1AB3FF'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'polysexual': ColorProfile([
|
|
||||||
'#F714BA',
|
|
||||||
'#01D66A',
|
|
||||||
'#1594F6',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# omnisexual sorced from https://www.flagcolorcodes.com/omnisexual
|
|
||||||
'omnisexual': ColorProfile([
|
|
||||||
'#FE9ACE',
|
|
||||||
'#FF53BF',
|
|
||||||
'#200044',
|
|
||||||
'#6760FE',
|
|
||||||
'#8EA6FF',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'omniromantic': ColorProfile([
|
|
||||||
'#FEC8E4',
|
|
||||||
'#FDA1DB',
|
|
||||||
'#89739A',
|
|
||||||
'#ABA7FE',
|
|
||||||
'#BFCEFF',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# gay men sourced from https://www.flagcolorcodes.com/gay-men
|
|
||||||
'gay-men': ColorProfile([
|
|
||||||
'#078D70',
|
|
||||||
'#98E8C1',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#7BADE2',
|
|
||||||
'#3D1A78'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'lesbian': ColorProfile([
|
|
||||||
'#D62800',
|
|
||||||
'#FF9B56',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#D462A6',
|
|
||||||
'#A40062'
|
|
||||||
]),
|
|
||||||
|
|
||||||
# abrosexual used colorpicker to source from
|
|
||||||
# https://fyeahaltpride.tumblr.com/post/151704251345/could-you-guys-possibly-make-an-abrosexual-pride
|
|
||||||
'abrosexual': ColorProfile([
|
|
||||||
'#46D294',
|
|
||||||
'#A3E9CA',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#F78BB3',
|
|
||||||
'#EE1766',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'asexual': ColorProfile([
|
|
||||||
'#000000',
|
|
||||||
'#A4A4A4',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#810081'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'aromantic': ColorProfile([
|
|
||||||
'#3BA740',
|
|
||||||
'#A8D47A',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#ABABAB',
|
|
||||||
'#000000'
|
|
||||||
]),
|
|
||||||
|
|
||||||
# https://orientation.fandom.com/wiki/Fictosexual
|
|
||||||
'fictosexual': ColorProfile(["#000000", "#C4C4C4", "#A349A5", "#C4C4C4", "#000000"]),
|
|
||||||
|
|
||||||
# aroace1 sourced from https://flag.library.lgbt/flags/aroace/
|
|
||||||
'aroace1': ColorProfile([
|
|
||||||
'#E28C00',
|
|
||||||
'#ECCD00',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#62AEDC',
|
|
||||||
'#203856'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'aroace2': ColorProfile([
|
|
||||||
'#000000',
|
|
||||||
'#810081',
|
|
||||||
'#A4A4A4',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#A8D47A',
|
|
||||||
'#3BA740'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'aroace3': ColorProfile([
|
|
||||||
'#3BA740',
|
|
||||||
'#A8D47A',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#ABABAB',
|
|
||||||
'#000000',
|
|
||||||
'#A4A4A4',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#810081'
|
|
||||||
]),
|
|
||||||
|
|
||||||
# below sourced from https://www.flagcolorcodes.com/flags/pride
|
|
||||||
# goto f"https://www.flagcolorcodes.com/{preset}" for info
|
|
||||||
# todo: sane sorting
|
|
||||||
'autosexual': ColorProfile([
|
|
||||||
'#99D9EA',
|
|
||||||
'#7F7F7F'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'intergender': ColorProfile([
|
|
||||||
# todo: use weighted spacing
|
|
||||||
'#900DC2',
|
|
||||||
'#900DC2',
|
|
||||||
'#FFE54F',
|
|
||||||
'#900DC2',
|
|
||||||
'#900DC2',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'greygender': ColorProfile([
|
|
||||||
'#B3B3B3',
|
|
||||||
'#B3B3B3',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#062383',
|
|
||||||
'#062383',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#535353',
|
|
||||||
'#535353',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'akiosexual': ColorProfile([
|
|
||||||
'#F9485E',
|
|
||||||
'#FEA06A',
|
|
||||||
'#FEF44C',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#000000',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# bigender sourced from https://www.flagcolorcodes.com/bigender
|
|
||||||
'bigender': ColorProfile([
|
|
||||||
'#C479A2',
|
|
||||||
'#EDA5CD',
|
|
||||||
'#D6C7E8',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#D6C7E8',
|
|
||||||
'#9AC7E8',
|
|
||||||
'#6D82D1',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# demigender yellow sourced from https://lgbtqia.fandom.com/f/p/4400000000000041031
|
|
||||||
# other colors sourced from demiboy and demigirl flags
|
|
||||||
'demigender': ColorProfile([
|
|
||||||
'#7F7F7F',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#FBFF75',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FBFF75',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# demiboy sourced from https://www.flagcolorcodes.com/demiboy
|
|
||||||
'demiboy': ColorProfile([
|
|
||||||
'#7F7F7F',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#9DD7EA',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#9DD7EA',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# demigirl sourced from https://www.flagcolorcodes.com/demigirl
|
|
||||||
'demigirl': ColorProfile([
|
|
||||||
'#7F7F7F',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#FDADC8',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FDADC8',
|
|
||||||
'#C4C4C4',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'transmasculine': ColorProfile([
|
|
||||||
'#FF8ABD',
|
|
||||||
'#CDF5FE',
|
|
||||||
'#9AEBFF',
|
|
||||||
'#74DFFF',
|
|
||||||
'#9AEBFF',
|
|
||||||
'#CDF5FE',
|
|
||||||
'#FF8ABD',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# transfeminine used colorpicker to source from https://www.deviantart.com/pride-flags/art/Trans-Woman-Transfeminine-1-543925985
|
|
||||||
# linked from https://gender.fandom.com/wiki/Transfeminine
|
|
||||||
'transfeminine': ColorProfile([
|
|
||||||
'#73DEFF',
|
|
||||||
'#FFE2EE',
|
|
||||||
'#FFB5D6',
|
|
||||||
'#FF8DC0',
|
|
||||||
'#FFB5D6',
|
|
||||||
'#FFE2EE',
|
|
||||||
'#73DEFF',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# genderfaun sourced from https://www.flagcolorcodes.com/genderfaun
|
|
||||||
'genderfaun': ColorProfile([
|
|
||||||
'#FCD689',
|
|
||||||
'#FFF09B',
|
|
||||||
'#FAF9CD',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#8EDED9',
|
|
||||||
'#8CACDE',
|
|
||||||
'#9782EC',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'demifaun': ColorProfile([
|
|
||||||
'#7F7F7F',
|
|
||||||
'#7F7F7F',
|
|
||||||
'#C6C6C6',
|
|
||||||
'#C6C6C6',
|
|
||||||
'#FCC688',
|
|
||||||
'#FFF19C',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#8DE0D5',
|
|
||||||
'#9682EC',
|
|
||||||
'#C6C6C6',
|
|
||||||
'#C6C6C6',
|
|
||||||
'#7F7F7F',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# genderfae sourced from https://www.flagcolorcodes.com/genderfae
|
|
||||||
'genderfae': ColorProfile([
|
|
||||||
'#97C3A5',
|
|
||||||
'#C3DEAE',
|
|
||||||
'#F9FACD',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FCA2C4',
|
|
||||||
'#DB8AE4',
|
|
||||||
'#A97EDD',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# demifae used colorpicker to source form https://www.deviantart.com/pride-flags/art/Demifae-870194777
|
|
||||||
'demifae': ColorProfile([
|
|
||||||
'#7F7F7F',
|
|
||||||
'#7F7F7F',
|
|
||||||
'#C5C5C5',
|
|
||||||
'#C5C5C5',
|
|
||||||
'#97C3A4',
|
|
||||||
'#C4DEAE',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FCA2C5',
|
|
||||||
'#AB7EDF',
|
|
||||||
'#C5C5C5',
|
|
||||||
'#C5C5C5',
|
|
||||||
'#7F7F7F',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'neutrois': ColorProfile([
|
|
||||||
'#FFFFFF',
|
|
||||||
'#1F9F00',
|
|
||||||
'#000000'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'biromantic1': ColorProfile([
|
|
||||||
'#8869A5',
|
|
||||||
'#D8A7D8',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FDB18D',
|
|
||||||
'#151638',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'biromantic2': ColorProfile([
|
|
||||||
'#740194',
|
|
||||||
'#AEB1AA',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#AEB1AA',
|
|
||||||
'#740194',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'autoromantic': ColorProfile([ # symbol interpreted
|
|
||||||
'#99D9EA',
|
|
||||||
'#99D9EA',
|
|
||||||
'#3DA542',
|
|
||||||
'#7F7F7F',
|
|
||||||
'#7F7F7F',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# i didn't expect this one to work. cool!
|
|
||||||
'boyflux2': ColorProfile(ColorProfile([
|
|
||||||
'#E48AE4',
|
|
||||||
'#9A81B4',
|
|
||||||
'#55BFAB',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#A8A8A8',
|
|
||||||
'#81D5EF',
|
|
||||||
'#69ABE5',
|
|
||||||
'#5276D4',
|
|
||||||
]).with_weights([1, 1, 1, 1, 1, 5, 5, 5])),
|
|
||||||
|
|
||||||
# sourced from https://commons.wikimedia.org/wiki/File:Girlflux_Pride_Flag.jpg
|
|
||||||
"girlflux": ColorProfile([
|
|
||||||
"f9e6d7",
|
|
||||||
"f2526c",
|
|
||||||
"bf0311",
|
|
||||||
"e9c587",
|
|
||||||
"bf0311",
|
|
||||||
"f2526c",
|
|
||||||
"f9e6d7",
|
|
||||||
]),
|
|
||||||
|
|
||||||
# sourced from https://www.deviantart.com/pride-flags/art/Genderflux-1-543925589
|
|
||||||
"genderflux": ColorProfile([
|
|
||||||
"f47694",
|
|
||||||
"f2a2b9",
|
|
||||||
"cecece",
|
|
||||||
"7ce0f7",
|
|
||||||
"3ecdf9",
|
|
||||||
"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([
|
|
||||||
"#B18EDF",
|
|
||||||
"#D7B1E2",
|
|
||||||
"#F7CDE9",
|
|
||||||
"#F39FCE",
|
|
||||||
"#EA7BB3",
|
|
||||||
]),
|
|
||||||
|
|
||||||
'unlabeled1': ColorProfile([
|
|
||||||
'#EAF8E4',
|
|
||||||
'#FDFDFB',
|
|
||||||
'#E1EFF7',
|
|
||||||
'#F4E2C4'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'unlabeled2': ColorProfile([
|
|
||||||
'#250548',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#F7DCDA',
|
|
||||||
'#EC9BEE',
|
|
||||||
'#9541FA',
|
|
||||||
'#7D2557'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'pangender': ColorProfile([
|
|
||||||
'#FFF798',
|
|
||||||
'#FEDDCD',
|
|
||||||
'#FFEBFB',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FFEBFB',
|
|
||||||
'#FEDDCD',
|
|
||||||
'#FFF798',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'pangender.contrast': ColorProfile([
|
|
||||||
'#ffe87f',
|
|
||||||
'#fcbaa6',
|
|
||||||
'#fbc9f3',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#fbc9f3',
|
|
||||||
'#fcbaa6',
|
|
||||||
'#ffe87f',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'gendernonconforming1': ColorProfile(
|
|
||||||
ColorProfile([
|
|
||||||
'#50284d',
|
|
||||||
'#96467b',
|
|
||||||
'#5c96f7',
|
|
||||||
'#ffe6f7',
|
|
||||||
'#5c96f7',
|
|
||||||
'#96467b',
|
|
||||||
'#50284d'
|
|
||||||
]).with_weights([
|
|
||||||
4, 1, 1, 1, 1, 1, 4
|
|
||||||
])
|
|
||||||
),
|
|
||||||
|
|
||||||
'gendernonconforming2': ColorProfile([
|
|
||||||
'#50284d',
|
|
||||||
'#96467b',
|
|
||||||
'#5c96f7',
|
|
||||||
'#ffe6f7',
|
|
||||||
'#5c96f7',
|
|
||||||
'#96467b',
|
|
||||||
'#50284d'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'femboy': ColorProfile([
|
|
||||||
"#d260a5",
|
|
||||||
"#e4afcd",
|
|
||||||
"#fefefe",
|
|
||||||
"#57cef8",
|
|
||||||
"#fefefe",
|
|
||||||
"#e4afcd",
|
|
||||||
"#d260a5"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'tomboy': ColorProfile([
|
|
||||||
"#2f3fb9",
|
|
||||||
"#613a03",
|
|
||||||
"#fefefe",
|
|
||||||
"#f1a9b7",
|
|
||||||
"#fefefe",
|
|
||||||
"#613a03",
|
|
||||||
"#2f3fb9"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'gynesexual': ColorProfile([
|
|
||||||
"#F4A9B7",
|
|
||||||
"#903F2B",
|
|
||||||
"#5B953B",
|
|
||||||
]),
|
|
||||||
|
|
||||||
'androsexual': ColorProfile([
|
|
||||||
"#01CCFF",
|
|
||||||
"#603524",
|
|
||||||
"#B799DE",
|
|
||||||
]),
|
|
||||||
|
|
||||||
# gendervoid and related flags sourced from: https://gender.fandom.com/wiki/Gendervoid
|
|
||||||
'gendervoid': ColorProfile([
|
|
||||||
"#081149",
|
|
||||||
"#4B484B",
|
|
||||||
"#000000",
|
|
||||||
"#4B484B",
|
|
||||||
"#081149"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'voidgirl': ColorProfile([
|
|
||||||
"#180827",
|
|
||||||
"#7A5A8B",
|
|
||||||
"#E09BED",
|
|
||||||
"#7A5A8B",
|
|
||||||
"#180827"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'voidboy': ColorProfile([
|
|
||||||
"#0B130C",
|
|
||||||
"#547655",
|
|
||||||
"#66B969",
|
|
||||||
"#547655",
|
|
||||||
"#0B130C"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# used https://twitter.com/foxbrained/status/1667621855518236674/photo/1 as source and colorpicked
|
|
||||||
'nonhuman-unity': ColorProfile([
|
|
||||||
"#177B49",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#593C90"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# used https://pluralpedia.org/w/Plurality#/media/File:Plural-Flag-1.jpg as source and colorpicked
|
|
||||||
'plural': ColorProfile([
|
|
||||||
"#2D0625",
|
|
||||||
"#543475",
|
|
||||||
"#7675C3",
|
|
||||||
"#89C7B0",
|
|
||||||
"#F3EDBD",
|
|
||||||
]),
|
|
||||||
|
|
||||||
# sampled from https://es.m.wikipedia.org/wiki/Archivo:Fraysexual_flag.jpg
|
|
||||||
'fraysexual': ColorProfile([
|
|
||||||
'#226CB5',
|
|
||||||
'#94E7DD',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#636363',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Queer Subcultures
|
|
||||||
# sourced from https://commons.wikimedia.org/wiki/File:Bear_Brotherhood_flag.svg
|
|
||||||
'bear': ColorProfile([
|
|
||||||
'#623804',
|
|
||||||
'#D56300',
|
|
||||||
'#FEDD63',
|
|
||||||
'#FEE6B8',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#555555',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Butch_Flag.png
|
|
||||||
'butch': ColorProfile([
|
|
||||||
'#D72800',
|
|
||||||
'#F17623',
|
|
||||||
'#FF9C56',
|
|
||||||
'#FFFDF6',
|
|
||||||
'#FFCE89',
|
|
||||||
'#FEAF02',
|
|
||||||
'#A37000',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Leather,_Latex,_and_BDSM_pride_-_Light.svg
|
|
||||||
'leather': ColorProfile([
|
|
||||||
'#000000',
|
|
||||||
'#252580',
|
|
||||||
'#000000',
|
|
||||||
'#252580',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#252580',
|
|
||||||
'#000000',
|
|
||||||
'#252580',
|
|
||||||
'#000000',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Official_Otter_Pride_Flag_by_Bearbackgear.jpg
|
|
||||||
'otter': ColorProfile([
|
|
||||||
'#263881',
|
|
||||||
'#5C9DC9',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#3A291D',
|
|
||||||
'#5C9DC9',
|
|
||||||
'#263881',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# colorpicked from https://commons.wikimedia.org/wiki/File:Twink_Pride_Flag_(proposed).svg
|
|
||||||
'twink': ColorProfile([
|
|
||||||
'#FFB2FF',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FFFF81',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# https://en.wikipedia.org/wiki/File:FatFetishFlag.png
|
|
||||||
'adipophilia': ColorProfile(["#000000", "#E16180", "#FFF9BE", "#603E41", "#000000"]),
|
|
||||||
|
|
||||||
'kenochoric': ColorProfile([
|
|
||||||
'#000000',
|
|
||||||
'#2E1569',
|
|
||||||
'#824DB7',
|
|
||||||
'#C7A1D6',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'veldian': ColorProfile([
|
|
||||||
'#D182A8',
|
|
||||||
'#FAF6E0',
|
|
||||||
'#69ACBE',
|
|
||||||
'#5D448F',
|
|
||||||
'#3A113E',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'solian': ColorProfile([
|
|
||||||
'#FFF8ED',
|
|
||||||
'#FFE7A8',
|
|
||||||
'#F1B870',
|
|
||||||
'#A56058',
|
|
||||||
'#46281E',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'lunian': ColorProfile([
|
|
||||||
'#2F0E62',
|
|
||||||
'#6F41B1',
|
|
||||||
'#889FDF',
|
|
||||||
'#7DDFD5',
|
|
||||||
'#D2F2E2',
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Start of Extras by Jaida Corvera
|
|
||||||
# polyamorous flag colors pulled from https://polyamproud.com/flag
|
|
||||||
'polyam': ColorProfile([
|
|
||||||
"#FFFFFF",
|
|
||||||
"#FCBF00",
|
|
||||||
"#009FE3",
|
|
||||||
"#E50051",
|
|
||||||
"#340C46",
|
|
||||||
]),
|
|
||||||
|
|
||||||
'sapphic': ColorProfile([
|
|
||||||
"#FD8BA8",
|
|
||||||
"#FBF2FF",
|
|
||||||
"#C76BC5",
|
|
||||||
"#FDD768",
|
|
||||||
"#C76BC5",
|
|
||||||
"#FBF2FF",
|
|
||||||
"#FD8BA8"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'androgyne': ColorProfile([
|
|
||||||
"#FE007F",
|
|
||||||
"#9832FF",
|
|
||||||
"#00B8E7",
|
|
||||||
]),
|
|
||||||
|
|
||||||
'interprogress': ColorProfile([
|
|
||||||
"#FFD800",
|
|
||||||
"#7902AA",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#FFAFC8",
|
|
||||||
"#74D7EE",
|
|
||||||
"#613915",
|
|
||||||
"#000000",
|
|
||||||
'#E50000',
|
|
||||||
'#FF8D00',
|
|
||||||
'#FFEE00',
|
|
||||||
'#028121',
|
|
||||||
'#004CFF',
|
|
||||||
'#770088'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'progress': ColorProfile([
|
|
||||||
"#FFFFFF",
|
|
||||||
"#FFAFC8",
|
|
||||||
"#74D7EE",
|
|
||||||
"#613915",
|
|
||||||
"#000000",
|
|
||||||
'#E50000',
|
|
||||||
'#FF8D00',
|
|
||||||
'#FFEE00',
|
|
||||||
'#028121',
|
|
||||||
'#004CFF',
|
|
||||||
'#770088'
|
|
||||||
]),
|
|
||||||
|
|
||||||
'intersex': ColorProfile([
|
|
||||||
"#FFD800",
|
|
||||||
"#FFD800",
|
|
||||||
"#7902AA",
|
|
||||||
"#FFD800",
|
|
||||||
"#FFD800"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'old-polyam': ColorProfile([
|
|
||||||
"#0000FF",
|
|
||||||
"#FF0000",
|
|
||||||
"#FFFF00",
|
|
||||||
"#FF0000",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'equal-rights': ColorProfile([
|
|
||||||
"#0000FF",
|
|
||||||
"#0000FF",
|
|
||||||
"#FFFF00",
|
|
||||||
"#0000FF",
|
|
||||||
"#0000FF",
|
|
||||||
"#FFFF00",
|
|
||||||
"#0000FF",
|
|
||||||
"#0000FF"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'drag': ColorProfile([
|
|
||||||
"#CC67FF",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#FFA3E3",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#3366FF"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Pronoun Flags
|
|
||||||
|
|
||||||
'pronounfluid': ColorProfile([
|
|
||||||
"#ffb3f9",
|
|
||||||
"#ffffff",
|
|
||||||
"#d1fdcb",
|
|
||||||
"#c7b0ff",
|
|
||||||
"#000000",
|
|
||||||
"#b8ccff"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'pronounflux': ColorProfile([
|
|
||||||
"#fdb3f8",
|
|
||||||
"#b6ccfa",
|
|
||||||
"#18ddd3",
|
|
||||||
"#64ff89",
|
|
||||||
"#ff7690",
|
|
||||||
"#ffffff"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'exipronoun': ColorProfile([
|
|
||||||
"#1c3d34",
|
|
||||||
"#ffffff",
|
|
||||||
"#321848",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'neopronoun': ColorProfile([
|
|
||||||
"#bcec64",
|
|
||||||
"#ffffff",
|
|
||||||
"#38077a"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'neofluid': ColorProfile([
|
|
||||||
"#ffeca0",
|
|
||||||
"#ffffff",
|
|
||||||
"#ffeca0",
|
|
||||||
"#38087a",
|
|
||||||
"#bcec64"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'genderqueer': ColorProfile([
|
|
||||||
"#b57edc",
|
|
||||||
"#b57edc",
|
|
||||||
"#ffffff",
|
|
||||||
"#ffffff",
|
|
||||||
"#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
|
|
||||||
'beiyang': ColorProfile([
|
|
||||||
'#DF1B12',
|
|
||||||
'#FFC600',
|
|
||||||
'#01639D',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#000000',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'burger': ColorProfile([
|
|
||||||
'#F3A26A',
|
|
||||||
'#498701',
|
|
||||||
'#FD1C13',
|
|
||||||
'#7D3829',
|
|
||||||
'#F3A26A',
|
|
||||||
]),
|
|
||||||
|
|
||||||
'throatlozenges': ColorProfile([
|
|
||||||
"#2759DA",
|
|
||||||
"#03940D",
|
|
||||||
"#F5F100",
|
|
||||||
"#F59B00",
|
|
||||||
"#B71212"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'band': ColorProfile([
|
|
||||||
"#2670c0",
|
|
||||||
"#f5bd00",
|
|
||||||
"#dc0045",
|
|
||||||
"#e0608e"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Adding libragender flags https://lgbtqia.wiki/wiki/Libragender
|
|
||||||
# Sourced from https://lgbtqia.wiki/wiki/Libragender
|
|
||||||
'libragender': ColorProfile([
|
|
||||||
"#000000",
|
|
||||||
"#808080",
|
|
||||||
"#92D8E9",
|
|
||||||
"#FFF544",
|
|
||||||
"#FFB0CA",
|
|
||||||
"#808080",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Sourced from https://lgbtqia.wiki/wiki/Librafeminine
|
|
||||||
'librafeminine': ColorProfile([
|
|
||||||
"#000000",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#C6568F",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Sourced from https://lgbtqia.wiki/wiki/Libramasculine
|
|
||||||
'libramasculine': ColorProfile([
|
|
||||||
"#000000",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#56C5C5",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Sourced from https://lgbtqia.wiki/wiki/Librandrogyne
|
|
||||||
'libraandrogyne': ColorProfile([
|
|
||||||
"#000000",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#9186B1",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Sourced from https://lgbtqia.wiki/wiki/Libranonbinary
|
|
||||||
'libranonbinary': ColorProfile([
|
|
||||||
"#000000",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#FFF987",
|
|
||||||
"#FFFFFF",
|
|
||||||
"#A3A3A3",
|
|
||||||
"#000000"
|
|
||||||
]),
|
|
||||||
|
|
||||||
# Adding Fluidflux flags - ObsoleteDev
|
|
||||||
# Sourced from https://gender.fandom.com/wiki/Fluidflux?file=FC90B24D-CA36-4FE2-A752-C9ABFC65E332.jpeg
|
|
||||||
|
|
||||||
'fluidflux A': ColorProfile([
|
|
||||||
"#ff115f",
|
|
||||||
"#a34aa3",
|
|
||||||
"#00a4e7",
|
|
||||||
"#ffdf00",
|
|
||||||
"#000000",
|
|
||||||
"#ffed71",
|
|
||||||
"#85daff",
|
|
||||||
"#dbadda",
|
|
||||||
"#fe8db1"
|
|
||||||
]),
|
|
||||||
|
|
||||||
'fluidflux B': ColorProfile([
|
|
||||||
"#c6d1d2",
|
|
||||||
"#f47b9d",
|
|
||||||
"#f09f9b",
|
|
||||||
"#e3f09e",
|
|
||||||
"#75eeea",
|
|
||||||
"#52d2ed",
|
|
||||||
"#c6d1d2"
|
|
||||||
]),
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import math
|
import math
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from hyfetch import presets
|
from .color_util import RGB, color, printc
|
||||||
from hyfetch.color_util import RGB, color, printc
|
from .constants import IS_WINDOWS
|
||||||
from hyfetch.constants import IS_WINDOWS
|
from .neofetch_util import term_size
|
||||||
from hyfetch.neofetch_util import term_size
|
from .presets import PRESETS
|
||||||
from hyfetch.presets import PRESETS
|
|
||||||
|
|
||||||
|
|
||||||
def key_pressed():
|
def key_pressed():
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from . import main
|
from . import main
|
||||||
from .color_util import printc
|
from .color_util import printc
|
||||||
|
|
||||||
|
|
||||||
def run_py():
|
def run_py():
|
||||||
try:
|
try:
|
||||||
main.run()
|
main.run()
|
||||||
|
|||||||
+9
-4
@@ -1,17 +1,18 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from .color_util import printc
|
from .color_util import printc
|
||||||
|
from .constants import SRC
|
||||||
from .py import run_py
|
from .py import run_py
|
||||||
|
|
||||||
|
|
||||||
def run_rust():
|
def run_rust():
|
||||||
# Find the rust executable
|
# Find the rust executable
|
||||||
pd = Path(__file__).parent.joinpath('rust')
|
pd = SRC / 'rust' / ('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():
|
||||||
if 'HYFETCH_DONT_WARN_RUST' not in os.environ:
|
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'
|
printc('&cThe executable for hyfetch v2 (rust) is not found, falling back to legacy v1.99.∞ (python).\n'
|
||||||
@@ -24,4 +25,8 @@ def run_rust():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run_rust()
|
try:
|
||||||
|
run_rust()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
printc('&cThe program is interrupted by ^C, exiting...')
|
||||||
|
exit(0)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# vim: noai:ts=4:sw=4:expandtab
|
# vim: noai:ts=4:sw=4:expandtab
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
# shellcheck disable=2009 disable=2153 disable=2154 disable=2243 disable=2244 disable=2317
|
# shellcheck disable=2009 disable=2153 disable=2154 disable=2243 disable=2244 disable=2317 disable=SC2329
|
||||||
#
|
#
|
||||||
# Neofetch: A command-line system information tool written in bash 3.2+.
|
# Neofetch: A command-line system information tool written in bash 3.2+.
|
||||||
# https://github.com/dylanaraps/neofetch
|
# https://github.com/dylanaraps/neofetch
|
||||||
@@ -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=8.0.2
|
version=8.0.5
|
||||||
|
|
||||||
# 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).
|
||||||
@@ -49,6 +49,7 @@ LANG=C
|
|||||||
[[ -z $GIO_EXTRA_MODULES ]] && export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
|
[[ -z $GIO_EXTRA_MODULES ]] && export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
|
||||||
|
|
||||||
# Use sed -r instead of sed -E if using GNU sed.
|
# Use sed -r instead of sed -E if using GNU sed.
|
||||||
|
# shellcheck disable=SC2218
|
||||||
[[ $(sed --version 2>/dev/null) =~ GNU ]] && gnu_sed=1
|
[[ $(sed --version 2>/dev/null) =~ GNU ]] && gnu_sed=1
|
||||||
sed() {
|
sed() {
|
||||||
if [[ $gnu_sed ]]; then
|
if [[ $gnu_sed ]]; then
|
||||||
@@ -892,17 +893,17 @@ image_source="auto"
|
|||||||
# Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy,
|
# Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy,
|
||||||
# PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore,
|
# PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore,
|
||||||
# Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino Linux, rocky, Rosa, Sabayon, sabotage,
|
# Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino Linux, rocky, Rosa, Sabayon, sabotage,
|
||||||
# Sailfish, SalentOS, Salient OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
# Sailfish, SalentOS, Salient OS, Salix, Sasanqua, Scientific, secureblue, semc, Septor, Serene,
|
||||||
# ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage,
|
# SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS, Soda, Solus,
|
||||||
# Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore,
|
# Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch,
|
||||||
# Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu
|
# TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE,
|
||||||
# Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux, unicodearch,
|
# Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||||
# Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii-linux-ngx,
|
# unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii-
|
||||||
# Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS, Xubuntu,
|
# linux-ngx, Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2, XFerience, Xray_OS,
|
||||||
# yiffOS, Zorin have ascii logos.
|
# 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, void have 'old' logo
|
||||||
# {distro}_old to use them.
|
# variants, use {distro}_old to use them.
|
||||||
|
|
||||||
# NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos, cleanjaro, crux, debian,
|
# NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos, cleanjaro, crux, debian,
|
||||||
# dragonfly, elementary, endeavouros, fedora, freebsd, garuda, gentoo, guix, haiku, hyperbola, kali,
|
# dragonfly, elementary, endeavouros, fedora, freebsd, garuda, gentoo, guix, haiku, hyperbola, kali,
|
||||||
@@ -6396,6 +6397,11 @@ cache_uname() {
|
|||||||
ProductVersion) osx_version=${sw_vers[i+1]} ;;
|
ProductVersion) osx_version=${sw_vers[i+1]} ;;
|
||||||
ProductBuildVersion) osx_build=${sw_vers[i+1]} ;;
|
ProductBuildVersion) osx_build=${sw_vers[i+1]} ;;
|
||||||
esac
|
esac
|
||||||
|
# before iOS 2, iOS didn't internally distinguish between itself and macOS,
|
||||||
|
# so we manually set the OS type if the version is 1.x
|
||||||
|
case $osx_version in
|
||||||
|
1.*) darwin_name="iPhone OS" ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -6672,19 +6678,20 @@ ASCII:
|
|||||||
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||||
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
Redcore, Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, Rhino
|
||||||
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
Linux, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Salient
|
||||||
OS, Salix, Sasanqua, Scientific, semc, Septor, Serene, SharkLinux,
|
OS, Salix, Sasanqua, Scientific, secureblue, semc, Septor, Serene,
|
||||||
ShastraOS, Siduction, SkiffOS, Slackel, Slackware, SliTaz, SmartOS,
|
SharkLinux, ShastraOS, Siduction, SkiffOS, Slackel, Slackware,
|
||||||
Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin,
|
SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS,
|
||||||
SunOS, SwagArch, t2, Tails, Tatra, TeArch, TorizonCore, Trisquel,
|
Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, Tatra, TeArch,
|
||||||
Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin,
|
TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||||
Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME,
|
Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
||||||
ubuntu_old02, Ultramarine Linux, unicodearch, Univalent, Univention,
|
Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||||
Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void, VzLinux, wii-linux-
|
unicodearch, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla,
|
||||||
ngx, Windows, Windows 10, Windows 11, Windows95, Wrt, Xenia, Xenia2,
|
Venom, VNux, Void, VzLinux, wii-linux-ngx, Windows, Windows 10,
|
||||||
XFerience, Xray_OS, Xubuntu, yiffOS, Zorin have ascii logos.
|
Windows 11, Windows95, Wrt, Xenia, Xenia2, 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.
|
void have 'old' logo variants, use {distro}_old to use them.
|
||||||
|
|
||||||
NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos,
|
NOTE: alpine, android, arch, arcolinux, artix, CalinixOS, centos,
|
||||||
cleanjaro, crux, debian, dragonfly, elementary, endeavouros, fedora,
|
cleanjaro, crux, debian, dragonfly, elementary, endeavouros, fedora,
|
||||||
@@ -15324,7 +15331,29 @@ ${c1} _______
|
|||||||
-_______\\
|
-_______\\
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
"void_old")
|
||||||
|
set_colors 2 8
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} __.;=====;.__
|
||||||
|
_.=+==++=++=+=+===;.
|
||||||
|
-=+++=+===+=+=+++++=_
|
||||||
|
. -=:`` `--==+=++==.
|
||||||
|
_vi, ` --+=++++:
|
||||||
|
.uvnvi. _._ -==+==+.
|
||||||
|
.vvnvnI` .;==|==;. :|=||=|.
|
||||||
|
${c2}+QmQQm${c1}pvvnv; ${c2}_yYsyQQWUUQQQm #QmQ#${c1}:${c2}QQQWUV$QQmL
|
||||||
|
${c2} -QQWQW${c1}pvvo${c2}wZ?.wQQQE${c1}==<${c2}QWWQ/QWQW.QQWW${c1}(: ${c2}jQWQE
|
||||||
|
${c2} -$QQQQmmU' jQQQ@${c1}+=<${c2}QWQQ)mQQQ.mQQQC${c1}+;${c2}jWQQ@'
|
||||||
|
${c2} -$WQ8Y${c1}nI: ${c2}QWQQwgQQWV${c1}`${c2}mWQQ.jQWQQgyyWW@!
|
||||||
|
${c1} -1vvnvv. `~+++` ++|+++
|
||||||
|
+vnvnnv, `-|===
|
||||||
|
+vnvnvns. . :=-
|
||||||
|
-Invnvvnsi..___..=sv=. `
|
||||||
|
+Invnvnvnnnnnnnnvvnn;.
|
||||||
|
~|Invnvnvvnvvvnnv}+`
|
||||||
|
-~|{*l}*|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
"Void"*)
|
"Void"*)
|
||||||
set_colors 8 2 7
|
set_colors 8 2 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -15695,6 +15724,32 @@ ${c2} @&&&&${c1} *'*,
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"secureblue"*)
|
||||||
|
set_colors 12 7
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} ==++++++++++
|
||||||
|
${c1} :========++++++++++++:
|
||||||
|
${c1} ===============+++++++++++
|
||||||
|
${c1} ====================++++++++++
|
||||||
|
${c1} :=============${c2}#%@@%*${c1}=====++++++++-
|
||||||
|
${c1} -============${c2}%@%+++*@@*${c1}=======+++++=
|
||||||
|
${c1} -============${c2}%@#${c1}======${c2}@@${c1}==========+++-
|
||||||
|
${c1} =============${c2}%@+${c1}======${c2}@@${c1}==============.
|
||||||
|
${c1}--=========${c2}*@@@@@@@@@@@@@@@%${c1}+==========-
|
||||||
|
${c1}------=====${c2}%@@@@@@@@@@@@@@@@*${c1}===========
|
||||||
|
${c1}---------==${c2}%@@@@@@@%%@@@@@@@*${c1}===========
|
||||||
|
${c1}:----------${c2}%@@@@@#${c1}===${c2}+%@@@@@*${c1}==========-
|
||||||
|
${c1} ----------${c2}%@@@@@%*${c1}==${c2}*@@@@@@*${c1}==========.
|
||||||
|
${c1} :---------${c2}%@@@@@@@@@@@@@@@@*${c1}=========-
|
||||||
|
${c1} :--------${c2}%@@@@@@@@@@@@@@@@*${c1}========-
|
||||||
|
${c1} :--------${c2}###############+${c1}========:
|
||||||
|
${c1} -------------------------====-
|
||||||
|
${c1} --------------------------
|
||||||
|
${c1} .--------------------.
|
||||||
|
${c1} ------------
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"KrassOS"* | "Krass"*)
|
"KrassOS"* | "Krass"*)
|
||||||
set_colors 4 7
|
set_colors 4 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "neowofetch",
|
"name": "neowofetch",
|
||||||
"version": "2.0.2",
|
"version": "2.0.5",
|
||||||
"description": "Updated neofetch",
|
"description": "Updated neofetch",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "HyFetch"
|
||||||
|
dynamic = ["version"]
|
||||||
|
description = "neofetch with flags <3"
|
||||||
|
readme = "README.md"
|
||||||
|
authors = [
|
||||||
|
{ name = "Azalea Gui", email = "me@hydev.org" },
|
||||||
|
]
|
||||||
|
requires-python = ">=3.7"
|
||||||
|
license = "MIT"
|
||||||
|
classifiers = [
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
# Universal dependencies
|
||||||
|
'typing_extensions; python_version < "3.8"',
|
||||||
|
|
||||||
|
# Windows dependencies
|
||||||
|
'psutil ; platform_system=="Windows"',
|
||||||
|
'colorama>=0.4.6 ; platform_system=="Windows"',
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://github.com/hykilpikonna/HyFetch"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
"hyfetch.v1" = "hyfetch.__main__:run_py"
|
||||||
|
"hyfetch.rs" = "hyfetch.__main__:run_rust"
|
||||||
|
"hyfetch" = "hyfetch.__main__:run_rust"
|
||||||
|
|
||||||
|
[tool.hatch.version]
|
||||||
|
source = "regex"
|
||||||
|
path = "Cargo.toml"
|
||||||
|
regex = 'version = "(?P<version>.+?)"'
|
||||||
|
|
||||||
|
[tool.hatch.build]
|
||||||
|
exclude = ["/tools"]
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel.files]
|
||||||
|
"{py_scripts}/neowofetch" = "hyfetch/scripts/neowofetch"
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
from pathlib import Path
|
|
||||||
from setuptools import setup, find_namespace_packages
|
|
||||||
|
|
||||||
# The directory containing this file
|
|
||||||
HERE = Path(__file__).parent
|
|
||||||
|
|
||||||
# Load version without importing it (see issue #192 if you are confused)
|
|
||||||
VERSION = [l for l in (HERE / "Cargo.toml").read_text('utf-8').splitlines() if l.startswith("version = ")]
|
|
||||||
if len(VERSION) != 1:
|
|
||||||
raise ValueError(f"Cannot determine version from Cargo.toml: {VERSION}")
|
|
||||||
VERSION = VERSION[0].split('"')[1]
|
|
||||||
|
|
||||||
# The text of the README file
|
|
||||||
README = (HERE / "README.md").read_text('utf-8')
|
|
||||||
|
|
||||||
# This call to setup() does all the work
|
|
||||||
setup(
|
|
||||||
name="HyFetch",
|
|
||||||
version=VERSION,
|
|
||||||
description="neofetch with flags <3",
|
|
||||||
long_description=README,
|
|
||||||
long_description_content_type="text/markdown",
|
|
||||||
url="https://github.com/hykilpikonna/HyFetch",
|
|
||||||
author="Azalea Gui",
|
|
||||||
author_email="me@hydev.org",
|
|
||||||
license="MIT",
|
|
||||||
classifiers=[
|
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
|
||||||
"Programming Language :: Python :: 3.9",
|
|
||||||
"Programming Language :: Python :: 3.10",
|
|
||||||
"Programming Language :: Python :: 3.11",
|
|
||||||
"Programming Language :: Python :: 3.12",
|
|
||||||
"Programming Language :: Python :: 3.13",
|
|
||||||
],
|
|
||||||
packages=find_namespace_packages(exclude=("tools", "tools.*")),
|
|
||||||
package_data={'hyfetch': ['hyfetch/*']},
|
|
||||||
include_package_data=True,
|
|
||||||
install_requires=[
|
|
||||||
# Universal dependencies
|
|
||||||
'typing_extensions; python_version < "3.8"',
|
|
||||||
|
|
||||||
# Windows dependencies
|
|
||||||
'psutil ; platform_system=="Windows"',
|
|
||||||
'colorama>=0.4.6 ; platform_system=="Windows"',
|
|
||||||
],
|
|
||||||
entry_points={
|
|
||||||
"console_scripts": [
|
|
||||||
"hyfetch.v1=hyfetch.__main__:run_py",
|
|
||||||
"hyfetch.rs=hyfetch.__main__:run_rust",
|
|
||||||
"hyfetch=hyfetch.__main__:run_rust",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
scripts=['hyfetch/scripts/neowofetch']
|
|
||||||
)
|
|
||||||
+7
-9
@@ -16,8 +16,9 @@ rm -rf build/
|
|||||||
# Remove git from the source code before building
|
# Remove git from the source code before building
|
||||||
rm -rf hyfetch/git/
|
rm -rf hyfetch/git/
|
||||||
|
|
||||||
# Build python from setup.py
|
# Build python package
|
||||||
python3 setup.py sdist bdist_wheel
|
python3 -m pip install build
|
||||||
|
python3 -m build
|
||||||
|
|
||||||
# Check
|
# Check
|
||||||
twine check dist/*.tar.gz
|
twine check dist/*.tar.gz
|
||||||
@@ -61,11 +62,6 @@ cp "$DIR/../target/x86_64-pc-windows-gnu/release/hyfetch.exe" wheel/hyfetch/rust
|
|||||||
sed -i 's/Tag: py3-none-.*/Tag: py3-none-win32/' wheel/*.dist-info/WHEEL
|
sed -i 's/Tag: py3-none-.*/Tag: py3-none-win32/' wheel/*.dist-info/WHEEL
|
||||||
python "$DIR/build_rehash.py" wheel
|
python "$DIR/build_rehash.py" wheel
|
||||||
|
|
||||||
# Zip to -win32.whl
|
|
||||||
#new_name=${file/-any/-win32}
|
|
||||||
#cd wheel && zip -qq -y -r "../$new_name" * && cd ..
|
|
||||||
#twine check "$new_name"
|
|
||||||
|
|
||||||
# Zip to -win_amd64.whl
|
# Zip to -win_amd64.whl
|
||||||
# Since pypi doesn't allow two identical files with different names to be uploaded
|
# Since pypi doesn't allow two identical files with different names to be uploaded
|
||||||
# We need to change the zip content a little bit for win_amd64
|
# We need to change the zip content a little bit for win_amd64
|
||||||
@@ -78,8 +74,10 @@ twine check "$new_name"
|
|||||||
# =================
|
# =================
|
||||||
# Build for linux
|
# Build for linux
|
||||||
|
|
||||||
# Now we're done with windows, delete the git folder
|
# Now we're done with windows, delete wheel and unzip again
|
||||||
rm -rf wheel/git
|
echo "> Building for other platforms"
|
||||||
|
rm -rf wheel
|
||||||
|
unzip -qq "$file" -d wheel
|
||||||
|
|
||||||
function build_for_platform() {
|
function build_for_platform() {
|
||||||
ff_platform=$1
|
ff_platform=$1
|
||||||
|
|||||||
+5
-9
@@ -1,11 +1,7 @@
|
|||||||
|
(If anyone stumbles upon this file, it's just some notes for myself because I always forgor stuff)
|
||||||
|
|
||||||
### Things to do before deploying...
|
### Things to do before deploying...
|
||||||
|
|
||||||
* [x] Check file permissions (+x)
|
* [ ] Update changelog (`README.md`) and commit changes
|
||||||
* [x] Check Shellcheck (should be automatic)
|
* [ ] Run `mamba activate 313` (an environment that has build deps e.g. twine)
|
||||||
* [x] Update version numbers (`README.md`, `package.json`, `hyfetch/constants.py`, `neofetch`)
|
* [ ] Run `python -m tools.deploy-release {version}`
|
||||||
* [x] Update distro list in neofetch help (`tools/list_distros.py`)
|
|
||||||
* [x] Regenerate man page (`help2man ./neofetch > neofetch.1`)
|
|
||||||
* [ ] Create an RC release and deploy to pypi, try installing and testing on many distros.
|
|
||||||
* [ ] Change back to stable release, create tag, create GitHub release
|
|
||||||
* [x] Formally deploy to pypi and npm (`tools/deploy.sh`, `npm publish`)
|
|
||||||
* [ ] Update ArchLinux AUR and NixOS packaging
|
|
||||||
|
|||||||
Reference in New Issue
Block a user