aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-25 14:36:01 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-25 14:36:01 +0300
commit4852dcaa44490be4d021a2fad08c12cb495754e1 (patch)
tree86d4a4fb99e9a3ee7b32dc4f76ea41da3248626a
parent98c976f72dfe11f110ddf5a0fc4b63b65f459779 (diff)
downloadpfetch-4852dcaa44490be4d021a2fad08c12cb495754e1.tar.gz
pfetch: skip displaying empty information.
-rwxr-xr-xpfetch5
1 files changed, 4 insertions, 1 deletions
diff --git a/pfetch b/pfetch
index 2b613ca..87f9d13 100755
--- a/pfetch
+++ b/pfetch
@@ -56,6 +56,9 @@ log() {
#
# $[6] /home/goldie $
+ # End here if no data was found.
+ [ "$2" ] || return
+
# Move the cursor to the right, the width of the ascii art with an
# additional gap for text spacing.
printf '[%sC' "${ascii_width--1}"
@@ -93,7 +96,7 @@ get_title() {
# shellcheck disable=SC2039
host=${HOSTNAME:-${hostname:-$(hostname)}}
- log "[3${PF_COL3:-1}m${user}${c7}@[3${PF_COL3:-1}m${host}" >&6
+ log "[3${PF_COL3:-1}m${user}${c7}@[3${PF_COL3:-1}m${host}" " " >&6
}
get_os() {