pfetch: hide cursor

This commit is contained in:
Dylan Araps 2019-09-24 12:09:01 +03:00
parent 8f15ee14cc
commit 7d35540a84

6
pfetch
View File

@ -147,10 +147,11 @@ ${c5}\/${c4}-____${c5}\/
# Print the ascii art and position the cursor back where we # Print the ascii art and position the cursor back where we
# started prior to printing it. # started prior to printing it.
# '\e[?25l': Hide the cursor.
# '\033[1m': Print the ascii in bold. # '\033[1m': Print the ascii in bold.
# '\033[m': Clear bold. # '\033[m': Clear bold.
# '\033[%sA: Move the cursor up '$ascii_height' amount of lines. # '\033[%sA: Move the cursor up '$ascii_height' amount of lines.
printf '\033[1m%s\033[m\033[%sA' "$ascii" "$ascii_height" printf '\e[?25l\033[1m%s\033[m\033[%sA' "$ascii" "$ascii_height"
} }
main() { main() {
@ -186,7 +187,8 @@ EOF
# Position the cursor below both the ascii art and information lines. # Position the cursor below both the ascii art and information lines.
# 'log' contains the amount of 'get_' info lines that were printed. # 'log' contains the amount of 'get_' info lines that were printed.
# '\033[%sB': Move the cursor down N lines. # '\033[%sB': Move the cursor down N lines.
printf '\033[%sB\n' "$((ascii_height - log))" # '\e[?25h' : Un-hide the cursor.
printf '\033[%sB\n\e[?25h' "$((ascii_height - log))"
} }
main "$@" main "$@"