diff --git a/crates/hyfetch/build.rs b/crates/hyfetch/build.rs index 867995cd..5ce00d42 100644 --- a/crates/hyfetch/build.rs +++ b/crates/hyfetch/build.rs @@ -65,6 +65,7 @@ fn main() -> Result<()> { &dir.join("neofetch"), &dir.join("../../neofetch"), ]).context("couldn't find neofetch")?; + println!("cargo:rerun-if-changed={}", neofetch_src.display()); fs::copy(&neofetch_src, o.join("neofetch"))?; preset_codegen(&o.join("hyfetch/data/presets.json"), &o.join("presets.rs"))?; diff --git a/neofetch b/neofetch index dc8d458e..408aca8f 100755 --- a/neofetch +++ b/neofetch @@ -5556,8 +5556,11 @@ strip_escape_codes() { } print_ascii() { + local ascii_from_file="off" + if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then ascii_data="$(< "$image_source")" + ascii_from_file="on" elif [[ "$image_source" == "ascii" || $image_source == auto ]]; then : else @@ -5586,7 +5589,7 @@ print_ascii() { fi # Fallback if file not found. - ((lines==1)) && { + [[ "$ascii_from_file" != "on" ]] && ((lines==1)) && { lines= ascii_len= image_source=auto