neofetch: remove unnecessary(?) parameter expansion and BASH_VERSINFO
This commit is contained in:
parent
c2fcf35ab1
commit
8e56495da8
8
neofetch
8
neofetch
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
version=7.0.0
|
version=7.0.0
|
||||||
|
|
||||||
if [[ "$BASH_VERSION" ]]; then
|
if [[ "${BASH_VERSINFO[0]}" ]]; then
|
||||||
bash_version=${BASH_VERSION/.*}
|
bash_version=${BASH_VERSINFO[0]}
|
||||||
else
|
else
|
||||||
bash_version=5
|
bash_version=5
|
||||||
shopt -s eval_unsafe_arith
|
shopt -s eval_unsafe_arith
|
||||||
|
@ -3992,7 +3992,7 @@ get_window_size() {
|
||||||
#
|
#
|
||||||
# False positive.
|
# False positive.
|
||||||
# shellcheck disable=2141
|
# shellcheck disable=2141
|
||||||
case ${BASH_VERSINFO[0]} in
|
case $bash_version in
|
||||||
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
|
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
|
||||||
*) IFS=';t' read -d t -t 1 -sra term_size ;;
|
*) IFS=';t' read -d t -t 1 -sra term_size ;;
|
||||||
esac
|
esac
|
||||||
|
@ -4240,7 +4240,7 @@ display_image() {
|
||||||
|
|
||||||
# Add a tiny delay to fix issues with images not
|
# Add a tiny delay to fix issues with images not
|
||||||
# appearing in specific terminal emulators.
|
# appearing in specific terminal emulators.
|
||||||
((BASH_VERSINFO[0]>3)) && sleep 0.05
|
((bash_version>3)) && sleep 0.05
|
||||||
printf '%b\n%s;\n%s\n' "0;1;$xoffset;$yoffset;$width;$height;;;;;$image" 3 4 |\
|
printf '%b\n%s;\n%s\n' "0;1;$xoffset;$yoffset;$width;$height;;;;;$image" 3 4 |\
|
||||||
"${w3m_img_path:-false}" -bg "$background_color" &>/dev/null
|
"${w3m_img_path:-false}" -bg "$background_color" &>/dev/null
|
||||||
;;
|
;;
|
||||||
|
|
Reference in New Issue