diff --git a/crates/hyfetch/src/bin/hyfetch.rs b/crates/hyfetch/src/bin/hyfetch.rs index 4795a67b..7c75a1e0 100644 --- a/crates/hyfetch/src/bin/hyfetch.rs +++ b/crates/hyfetch/src/bin/hyfetch.rs @@ -723,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. let tmp_dst = get_distro_name(backend).or_else(|_| get_distro_name(Backend::Neofetch)).context("failed to get distro name")?; let detected_dst = Some(distro.map_or_else( - || format!("{:?}", Distro::detect(tmp_dst).unwrap()), - |d| d.to_string(), + || { + 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 diff --git a/crates/hyfetch/src/presets.rs b/crates/hyfetch/src/presets.rs index 623c52a5..6e20ad7d 100644 --- a/crates/hyfetch/src/presets.rs +++ b/crates/hyfetch/src/presets.rs @@ -233,6 +233,14 @@ pub enum Preset { Libragender, Librafeminine, Libramasculine, Libraandrogyne, Libranonbinary, Fluidfluxa, Fluidfluxb, + + Transbian, + + Autism, + + Cenelian, + + Transneutral, } #[derive(Clone, Eq, PartialEq, Debug)] @@ -718,6 +726,22 @@ impl Preset { Self::Fluidfluxb => ColorProfile::from_hex_colors(vec![ "#c6d1d2", "#f47b9d", "#f09f9b", "#e3f09e", "#75eeea", "#52d2ed", "#c6d1d2" ]), + + Self::Transbian => ColorProfile::from_hex_colors(vec![ + "#03A3E6", "#F8B4CD","#FAFBF9", "#FA9C57", "#A80864" + ]), + + Self::Autism => ColorProfile::from_hex_colors(vec![ + "#c94a49", "#de7554", "#dbb667", "#6fa35d", "#2e7574", "#232828" + ]), + + Self::Cenelian => ColorProfile::from_hex_colors(vec![ + "#ffe7b6", "#93554a", "#52203a", "#7e4a93", "#99afd6" + ]), + + Self::Transneutral => ColorProfile::from_hex_colors(vec![ + "#74dfff", "#fffdb3", "#fffc75", "#fff200", "#fffc75", "#fffdb3", "#fe8cbf" + ]), }) .expect("preset color profiles should be valid") } diff --git a/hyfetch/color_util.py b/hyfetch/color_util.py index 2ca4f22d..42e02d7d 100644 --- a/hyfetch/color_util.py +++ b/hyfetch/color_util.py @@ -141,9 +141,9 @@ class RGB: g = int(hex[2:4], 16) b = int(hex[4:6], 16) elif len(hex) == 3: - r = int(hex[0], 16) - g = int(hex[1], 16) - b = int(hex[2], 16) + r = int(hex[0] * 2, 16) + g = int(hex[1] * 2, 16) + b = int(hex[2] * 2, 16) else: raise ValueError(f"Error: invalid hex length") return cls(r, g, b) diff --git a/hyfetch/main.py b/hyfetch/main.py index c72d1167..0df0a1a0 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -503,7 +503,7 @@ def run(): print(f'Error: invalid hex color "{color}"') preset = ColorProfile(colors) 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: exit(1) diff --git a/hyfetch/presets.py b/hyfetch/presets.py index d25789e1..574be95a 100644 --- a/hyfetch/presets.py +++ b/hyfetch/presets.py @@ -1092,4 +1092,40 @@ PRESETS: dict[str, ColorProfile] = { "#52d2ed", "#c6d1d2" ]), + + # Adding Transbian Pride Flag - ObsoleteDev + 'transbian': ColorProfile([ + "#03A3E6", + "#F8B4CD", + "#FAFBF9", + "#FA9C57", + "#A80864" + ]), + + 'Autism': ColorProfile([ + "#c94a49", + "#de7554", + "#dbb667", + "#6fa35d", + "#2e7574", + "#232828" + ]), + + 'Cenelian': ColorProfile([ + "#ffe7b6", + "#93554a", + "#52203a", + "#7e4a93", + "#99afd6" + ]), + + 'Transneutral': ColorProfile([ + "#74dfff", + "#fffdb3", + "#fffc75", + "#fff200", + "#fffc75", + "#fffdb3", + "#fe8cbf" + ]), } diff --git a/neofetch b/neofetch index 6a0db2b2..937d8460 100755 --- a/neofetch +++ b/neofetch @@ -6396,6 +6396,11 @@ cache_uname() { ProductVersion) osx_version=${sw_vers[i+1]} ;; ProductBuildVersion) osx_build=${sw_vers[i+1]} ;; 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 }