aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-11-09 16:44:28 +0000
committerDylan Araps <dylan.araps@gmail.com>2019-11-09 16:44:28 +0000
commit8dd5981fbc3b47ebd3108360b0278da9561428c6 (patch)
tree9df608f5a17f34964d555fc3d1f84efcc65dbb6b
parent24498852fd8f79d35f8e84e554e0f312b851f95f (diff)
downloadpfetch-8dd5981fbc3b47ebd3108360b0278da9561428c6.tar.gz
pfetch: remove cursor movement for palette
-rwxr-xr-xpfetch16
1 files changed, 10 insertions, 6 deletions
diff --git a/pfetch b/pfetch
index 80661cd..fc9f428 100755
--- a/pfetch
+++ b/pfetch
@@ -24,7 +24,11 @@ log() {
align=$(printf '%*.s' "$((${#name}-info_length))" "")
- out="[3${PF_COL1-4};1m${name}${PF_SEP}${align}[3${PF_COL2-7}m${info}"
+ # Construct the information string.
+ out=
+ out="[3${PF_COL1-4};1m${name}"
+ out="$out${PF_SEP}${align}"
+ out="$out[3${PF_COL2-7}m${info}"
}
get_title() {
@@ -781,12 +785,12 @@ get_palette() {
#
# This allows us to save hardcoding a second set of sequences
# for background colors.
- palette=" $c1 $c2 $c3 $c4 $c5 $c6 $c7 "
+ palette="$c1 $c1 $c2 $c2 $c3 $c3 $c4 $c4 $c5 $c5 $c6 $c6 "
- # Print the palette with a newline before and after.
- # The '\033[%sC' moves the text to the right, the
- # length of the ascii art.
- printf '\n[%sC%s\n' "${ascii_width-1}" "$palette" >&6
+ # Print the palette with a new-line before and afterwards.
+ printf '\n' >&6
+ log "$palette
+ " " "
}
get_ascii() {