From 13e56f621b495dc2327c99dbbc66c52c9df6feb0 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 7 Apr 2026 01:55:11 +0000 Subject: [PATCH] [F] Fix macchina #491 --- crates/hyfetch/src/neofetch_util.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/hyfetch/src/neofetch_util.rs b/crates/hyfetch/src/neofetch_util.rs index ad6ee231..c70b60d0 100644 --- a/crates/hyfetch/src/neofetch_util.rs +++ b/crates/hyfetch/src/neofetch_util.rs @@ -509,7 +509,7 @@ pub fn get_distro_name(backend: Backend) -> Result { doc["spacing"] = value(0); doc["padding"] = value(0); // See https://github.com/Macchina-CLI/macchina/issues/319 - // doc["hide_ascii"] = value(true); + doc["hide_ascii"] = value(false); doc["separator"] = value(""); doc["custom_ascii"] = Item::Table(Table::from_iter([( "path", @@ -540,8 +540,11 @@ pub fn get_distro_name(backend: Backend) -> Result { ]; run_macchina_command_piped(&args[..]) .map(|s| { - anstream::adapter::strip_str(&s) - .to_string() + let s = anstream::adapter::strip_str(&s).to_string(); + let s = s.trim(); + s.splitn(2, '-') + .last() + .expect("splitn with 2 should always have at least 1 element") .trim() .to_owned() }) @@ -661,6 +664,7 @@ fn run_macchina(asc: String, args: Option<&Vec>) -> Result<()> { .context("failed to create temp file for macchina theme")?; let theme_doc = { let mut doc = DocumentMut::new(); + doc["hide_ascii"] = value(false); doc["custom_ascii"] = Item::Table(Table::from_iter([( "path", &*asc_file_path.to_string_lossy(),