From c52d9dca66f5d7a5bb4f9967bd0f19f9e01800a1 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Sun, 14 Aug 2022 12:23:28 -0400 Subject: [PATCH] [F] Fix empty bracket displayed when no theme is present https://github.com/dylanaraps/neofetch/pull/1713 --- neofetch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 9eb6e6fc..c5deb210 100755 --- a/neofetch +++ b/neofetch @@ -3751,10 +3751,12 @@ get_style() { append_theme "$gtk3_theme" 'GTK3' # Final string. - theme+=']' - theme="${theme#'], '}" - theme="${theme/'GTK2/GTK3'/'GTK2/3'}" - theme="${theme%, }" + if [[ -n "$theme" ]]; then + theme+=']' + theme="${theme#'], '}" + theme="${theme/'GTK2/GTK3'/'GTK2/3'}" + theme="${theme%, }" + fi # Make the output shorter by removing "[GTKX]" from the string. if [[ "$gtk_shorthand" == "on" ]]; then