misc: cleanup

This commit is contained in:
Dylan Araps 2018-06-03 17:07:04 +10:00
parent 96bd33c2a0
commit 55b3925a29

View file

@ -1415,7 +1415,7 @@ get_de() {
# the desktop variables are sometimes also set to the # the desktop variables are sometimes also set to the
# window manager name. This checks to see if WM == DE # window manager name. This checks to see if WM == DE
# and dicards the DE value. # and dicards the DE value.
[[ "$wm" && "$de" =~ ^$wm$ ]] && { unset -v de; return; } [[ "$de" == "$wm" ]] && { unset -v de; return; }
;; ;;
esac esac
@ -3620,10 +3620,9 @@ get_image_size() {
read -r width height <<< "$(identify -format "%w %h" "$image")" read -r width height <<< "$(identify -format "%w %h" "$image")"
crop_mode="none" crop_mode="none"
while (( "$width" >= ("$term_width" / 2) || while ((width >= (term_width / 2) || height >= term_height)); do
"$height" >= "$term_height" )); do ((width=width/2))
width="$((width / 2))" ((height=height/2))
height="$((height / 2))"
done done
;; ;;
@ -3785,13 +3784,8 @@ display_image() {
} }
to_ascii() { to_ascii() {
# Log the error.
err "$1" err "$1"
# This function makes neofetch fallback to ascii mode.
image_backend="ascii" image_backend="ascii"
# Print the ascii art.
get_ascii get_ascii
# Set cursor position next image/ascii. # Set cursor position next image/ascii.
@ -3799,7 +3793,6 @@ to_ascii() {
} }
to_off() { to_off() {
# This function makes neofetch fallback to off mode.
err "$1" err "$1"
image_backend="off" image_backend="off"
text_padding= text_padding=