From 2b23aa02bcc88f7af3cb31d8a865f6912f7c8d41 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 24 Sep 2019 14:55:52 +0300 Subject: [PATCH] pfetch: only calculate alignment if function exists --- pfetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pfetch b/pfetch index 3a51309..0758eb3 100755 --- a/pfetch +++ b/pfetch @@ -314,7 +314,8 @@ EOF # "info names" for output alignment. The option names and subtitles # match 1:1 so this is thankfully simple. for info; do - info_length=$((${#info} > info_length ? ${#info} : info_length)) + type "get_$info" >/dev/null && + info_length=$((${#info} > info_length ? ${#info} : info_length)) done # Iterate over the above list and run any existing "get_" functions.