Commit bc0118a7 authored by Dylan Araps's avatar Dylan Araps

Ascii: Fix bug where source is an image

parent 83c57513
......@@ -2011,11 +2011,18 @@ image_backend() {
}
get_ascii() {
if [[ ! -f "$image_source" || "$image_source" =~ (auto|ascii) ]]; then
if [[ ! -f "$image_source" ||
"$image_source" =~ (auto|ascii) ||
"$image_source" =~ \.(png|jpg|jpe|jpeg|gif) ]]; then
# Fallback to distro ascii mode if custom ascii isn't found.
[[ ! "$image_source" =~ (auto|ascii) ]] && \
err "Ascii: Ascii file not found, using distro ascii."
# Fallback to distro ascii mode if source is an image.
[[ "$image_source" =~ \.(png|jpg|jpe|jpeg|gif) ]] && \
err "Image: Source is image file but ascii backend was selected. Using distro ascii."
if [[ -d "/usr/share/neofetch/ascii/distro" ]]; then
ascii_dir="/usr/share/neofetch/ascii/distro"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment