fetch

A MSYS2-compatible sys-info prompt
Log | Files | Refs | README | LICENSE

commit 53cde5e488b63464f3ccc84e5c3505812f388056
parent 17aafece4e0db78f644c3414e0922b35bccd69f8
Author: Byron Torres <b@torresjrjr>
Date:   Fri, 29 Jan 2021 11:45:44 +0000

Simplify cursor util with ANSI escape sequences

Diffstat:
Mfetch | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/fetch b/fetch @@ -11,14 +11,8 @@ c3=$(printf '\e[33m'); c4=$(printf '\e[34m') c5=$(printf '\e[35m'); c6=$(printf '\e[36m') c7=$(printf '\e[37m'); c8=$(printf '\e[38m') -reposition_cursor() { - printf '\r' - for i in $(seq ${graphic_y}); do printf '\e[A'; done -} - -padding() { - for i in $(seq ${graphic_x}); do printf '\e[C'; done -} +reposition() { printf '\r\e[%sA' "${graphic_y}" ;} +padding() { printf '\e[%sC' "${graphic_x}" ;} ## Graphic @@ -94,7 +88,7 @@ status() { main() { graphic - reposition_cursor + reposition status echo }