From acd93aa806b73afdf23014b69cad46520829a57d Mon Sep 17 00:00:00 2001 From: AnonymousRand Date: Sat, 18 Jul 2026 17:47:07 -0700 Subject: [PATCH 1/2] [+] NixOwOS --- docs/neofetch.1 | 6 ++--- hyfetch/data/distros/nixowos.ascii | 21 +++++++++++++++ neofetch | 41 +++++++++++++++++++++++++----- 3 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 hyfetch/data/distros/nixowos.ascii diff --git a/docs/neofetch.1 b/docs/neofetch.1 index 950f8959..c6079490 100644 --- a/docs/neofetch.1 +++ b/docs/neofetch.1 @@ -361,9 +361,9 @@ Linux, Linux Lite, Linux Mint, Linux Mint Old, LinuxFromScratch, Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix, MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mauna, Meowix, Mer, MidOS, Minix, MIRACLE LINUX, MX, Namib, NekOS, -Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD, -Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media -Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba, +Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, NixOwOS, +Nobara, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source +Media Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba, OpenMandriva, OpenSolaris, OpenStage, openSUSE, openSUSE Leap, openSUSE Tumbleweed, openSUSE Tumbleweed\-Slowroll, OPNsense, Oracle, orchid, OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, Parrot, diff --git a/hyfetch/data/distros/nixowos.ascii b/hyfetch/data/distros/nixowos.ascii new file mode 100644 index 00000000..6d2395ad --- /dev/null +++ b/hyfetch/data/distros/nixowos.ascii @@ -0,0 +1,21 @@ +{"match": "\"NixOwOS\"*", "color": "#5277c3' '#7ebae4' '#df90af' '#2d789e' '#5f92d3"} +${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖ +${c1} ▜███▙ ${c2}▜███▙ ▟███▛ +${c1} ▜███▙ ${c2}▜███▙▟███▛ ${c1}▗ +${c1} ▐▄ ▜███▙ ${c2}▜██████▛ ${c1}▄▄▞▀▛ +${c1} ▜▀▀▀▄▄ ▜█████████▙ ${c2}▜████▛ ${c1}▄█▛▀ ▗▘ +${c1} ▌ ▀█▄▟██████████▙ ${c2}▜███▙${c1}▟█▛ ▗▞ +${c1} ▐ ▙▖▟${c2}▙▄▄▖ ${c2}▜████${c1}▙▄▟▘ ▟▘ +${c1} ▜▖▝█${c2}███▛ ${c2}▜██▛${c1}██▄▄▄▞▘ +${c1} ▝${c2}▟███▛ ${c4}▀▚▄ ▄▞▀ ${c2}▜▛ ${c1}▟███▛ +${c2} ▟███████████▛ ${c4}▗▄▄▞▘ ▝▚▄▄▖ ${c1}▟██████████▙ +${c2} ▜██████████▛ ${c3}/// ${c4}▟▘ ▄ ▝▙ ${c3}/// ${c1}▟███████████▛ +${c2} ▟███▛ ${c1}▟▙ ${c4}▜▄▟▀▙▄▛ ${c1}▟███▛ +${c2} ▟███▛ ${c1}▟██▙ ${c1}▟███▛ ${c5}▄ +${c2} ▟███▛ ${c1}▜███▙ ${c1}▝▀▀▀▀ ${c5}▗▄▛▀▀ +${c2} ▜██▛ ▗▌${c1}▜███▙ ${c2}▜██████████████████▛ +${c2} ▜▛ ▗▛ ${c1}▟████▙ ${c2}▜████████████████▛ +${c2} ▝▌${c1}▟██████▙ ${c5}▄▄${c2}▜███▙ +${c1} ▟███▛▜███▙${c2}▄▄▟${c5}▀▘ ${c2}▜███▙ +${c1} ▟███▛${c2}▄▄${c1}▜███▙ ${c2}▜███▙ +${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘ diff --git a/neofetch b/neofetch index fb79ea36..df2b4a58 100755 --- a/neofetch +++ b/neofetch @@ -921,7 +921,7 @@ image_source="auto" # LinuxFromScratch, Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix, MagpieOS, # MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mauna, Meowix, Mer, MidOS, Minix, # MIRACLE LINUX, MX, Namib, NekOS, Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, -# Nobara, NomadBSD, +# NixOwOS, Nobara, NomadBSD, # Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media Center, OpenBSD, openEuler, # OpenIndiana, openKylin, openmamba, OpenMandriva, OpenSolaris, OpenStage, openSUSE, openSUSE # Leap, openSUSE Tumbleweed, openSUSE Tumbleweed-Slowroll, OPNsense, Oracle, orchid, OS Elbrus, @@ -1168,10 +1168,11 @@ get_distro() { esac elif [[ -f /etc/NIXOS ]]; then + . /etc/os-release case $distro_shorthand in - on) distro="NixOS $(nixos-version | awk '{print substr($1,0,5),$2}')" ;; - tiny) distro="NixOS" ;; - *) distro="NixOS $(nixos-version)" ;; + on) distro="${NAME} ${VERSION}" ;; + tiny) distro="${NAME}" ;; + *) distro="${NAME} $(nixos-version)" ;; esac elif [[ -f /etc/linspire-version ]]; then @@ -7063,9 +7064,9 @@ ASCII: Live Raizo, LMDE, Lubuntu, Lunar, mac, MacaroniOS, Mageia, Magix, MagpieOS, MainsailOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mauna, Meowix, Mer, MidOS, Minix, MIRACLE LINUX, MX, Namib, NekOS, - Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, Nobara, NomadBSD, - Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media - Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba, + Neptune, NetBSD, Netrunner, Nitrux, NixOS, nixos_colorful, NixOwOS, + Nobara, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source + Media Center, OpenBSD, openEuler, OpenIndiana, openKylin, openmamba, OpenMandriva, OpenSolaris, OpenStage, openSUSE, openSUSE Leap, openSUSE Tumbleweed, openSUSE Tumbleweed-Slowroll, OPNsense, Oracle, orchid, OS Elbrus, PacBSD, Panwah, Parabola, parch, Pardus, @@ -12751,6 +12752,32 @@ ${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘ EOF ;; + "NixOwOS"*) + set_colors "#5277c3" "#7ebae4" "#df90af" "#2d789e" "#5f92d3" + read -rd '' ascii_data <<'EOF' +${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖ +${c1} ▜███▙ ${c2}▜███▙ ▟███▛ +${c1} ▜███▙ ${c2}▜███▙▟███▛ ${c1}▗ +${c1} ▐▄ ▜███▙ ${c2}▜██████▛ ${c1}▄▄▞▀▛ +${c1} ▜▀▀▀▄▄ ▜█████████▙ ${c2}▜████▛ ${c1}▄█▛▀ ▗▘ +${c1} ▌ ▀█▄▟██████████▙ ${c2}▜███▙${c1}▟█▛ ▗▞ +${c1} ▐ ▙▖▟${c2}▙▄▄▖ ${c2}▜████${c1}▙▄▟▘ ▟▘ +${c1} ▜▖▝█${c2}███▛ ${c2}▜██▛${c1}██▄▄▄▞▘ +${c1} ▝${c2}▟███▛ ${c4}▀▚▄ ▄▞▀ ${c2}▜▛ ${c1}▟███▛ +${c2} ▟███████████▛ ${c4}▗▄▄▞▘ ▝▚▄▄▖ ${c1}▟██████████▙ +${c2} ▜██████████▛ ${c3}/// ${c4}▟▘ ▄ ▝▙ ${c3}/// ${c1}▟███████████▛ +${c2} ▟███▛ ${c1}▟▙ ${c4}▜▄▟▀▙▄▛ ${c1}▟███▛ +${c2} ▟███▛ ${c1}▟██▙ ${c1}▟███▛ ${c5}▄ +${c2} ▟███▛ ${c1}▜███▙ ${c1}▝▀▀▀▀ ${c5}▗▄▛▀▀ +${c2} ▜██▛ ▗▌${c1}▜███▙ ${c2}▜██████████████████▛ +${c2} ▜▛ ▗▛ ${c1}▟████▙ ${c2}▜████████████████▛ +${c2} ▝▌${c1}▟██████▙ ${c5}▄▄${c2}▜███▙ +${c1} ▟███▛▜███▙${c2}▄▄▟${c5}▀▘ ${c2}▜███▙ +${c1} ▟███▛${c2}▄▄${c1}▜███▙ ${c2}▜███▙ +${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘ +EOF + ;; + "Nobara"*) set_colors "#999999" "#d80a0a" "#e5b90b" From 6e75c755c71d255efe0167cca271b963b12f41af Mon Sep 17 00:00:00 2001 From: AnonymousRand Date: Sun, 19 Jul 2026 11:23:41 -0700 Subject: [PATCH 2/2] [+] Lightness per theme config options --- crates/hyfetch/src/bin/hyfetch.rs | 4 +++- crates/hyfetch/src/color_util.rs | 16 ++++++++++++++++ crates/hyfetch/src/models.rs | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/hyfetch/src/bin/hyfetch.rs b/crates/hyfetch/src/bin/hyfetch.rs index c8921c9c..75e2380b 100644 --- a/crates/hyfetch/src/bin/hyfetch.rs +++ b/crates/hyfetch/src/bin/hyfetch.rs @@ -224,7 +224,8 @@ fn main() -> Result<()> { } else { color_profile.with_lightness_adaptive( config - .lightness + .lightness_per_theme.map(|val| val.get(theme)) + .or(config.lightness) .unwrap_or_else(|| Config::default_lightness(theme)), theme, ) @@ -1495,6 +1496,7 @@ fn create_config( light_dark: Some(theme), auto_detect_light_dark: Some(det_bg.is_some()), lightness: Some(lightness), + lightness_per_theme: None, color_align, backend, args: None, diff --git a/crates/hyfetch/src/color_util.rs b/crates/hyfetch/src/color_util.rs index d558ddeb..cbb5a6b9 100644 --- a/crates/hyfetch/src/color_util.rs +++ b/crates/hyfetch/src/color_util.rs @@ -72,6 +72,13 @@ static RGB_COLORS_AC: OnceLock = OnceLock::new(); #[derive(Copy, Clone, PartialEq, PartialOrd, Debug, Deserialize, Serialize)] pub struct Lightness(f32); +/// Represents a dictionary of one lightness option per {light, dark} theme. +#[derive(Copy, Clone, Debug, Deserialize, Serialize)] +pub struct LightnessPerTheme { + dark: Lightness, + light: Lightness, +} + #[derive(Debug, Error)] pub enum LightnessError { #[error( @@ -148,6 +155,15 @@ impl Lightness { } } +impl LightnessPerTheme { + pub fn get(&self, theme: TerminalTheme) -> Lightness { + match theme { + TerminalTheme::Light => self.light, + TerminalTheme::Dark => self.dark + } + } +} + impl TryFrom for Lightness { type Error = LightnessError; diff --git a/crates/hyfetch/src/models.rs b/crates/hyfetch/src/models.rs index e432f480..e9ad874f 100644 --- a/crates/hyfetch/src/models.rs +++ b/crates/hyfetch/src/models.rs @@ -6,6 +6,7 @@ use strum::{AsRefStr, Display, EnumString}; use crate::color_profile::ColorProfile; use crate::color_util::Lightness; +use crate::color_util::LightnessPerTheme; use crate::neofetch_util::ColorAlignment; use crate::types::{AnsiMode, Backend, TerminalTheme}; @@ -16,6 +17,7 @@ pub struct Config { pub auto_detect_light_dark: Option, pub light_dark: Option, pub lightness: Option, + pub lightness_per_theme: Option, pub color_align: ColorAlignment, pub backend: Backend, #[serde(default)]