[F] Fix empty bracket displayed when no theme is present

https://github.com/dylanaraps/neofetch/pull/1713
This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-08-14 12:23:28 -04:00
parent 48dc7eee76
commit c52d9dca66

View file

@ -3751,10 +3751,12 @@ get_style() {
append_theme "$gtk3_theme" 'GTK3' append_theme "$gtk3_theme" 'GTK3'
# Final string. # Final string.
theme+=']' if [[ -n "$theme" ]]; then
theme="${theme#'], '}" theme+=']'
theme="${theme/'GTK2/GTK3'/'GTK2/3'}" theme="${theme#'], '}"
theme="${theme%, }" theme="${theme/'GTK2/GTK3'/'GTK2/3'}"
theme="${theme%, }"
fi
# Make the output shorter by removing "[GTKX]" from the string. # Make the output shorter by removing "[GTKX]" from the string.
if [[ "$gtk_shorthand" == "on" ]]; then if [[ "$gtk_shorthand" == "on" ]]; then