Networkwidget: Simplify newline append.

This commit is contained in:
Dmitry Voronin 2024-12-13 13:29:10 +03:00
parent 1a94f0e760
commit 3b61c30171

View file

@ -26,25 +26,22 @@
fi fi
for net in ''${_vpns[@]}; do for net in ''${_vpns[@]}; do
[[ "''${networks}" = "" ]] || networks+="\\\n" networks+=" ''${net}\\\n"
networks+=" ''${net}"
done done
for net in ''${_ethernets[@]}; do for net in ''${_ethernets[@]}; do
[[ "''${networks}" = "" ]] || networks+="\\\n" networks+=" ''${net}\\\n"
networks+=" ''${net}"
done done
for net in ''${_wifis[@]}; do for net in ''${_wifis[@]}; do
[[ "''${networks}" = "" ]] || networks+="\\\n" networks+="󰖩 ''${net}\\\n"
networks+="󰖩 ''${net}"
done done
for bt in ''${_bts[@]}; do for bt in ''${_bts[@]}; do
[[ "''${networks}" = "" ]] || networks+="\\\n" networks+="󰂯 ''${bt}\\\n"
networks+="󰂯 ''${bt}"
done done
networks[-1]=''${networks[-1]%\\\n}
printf "{\"text\": \"''${icon}\", \"tooltip\": \"''${networks[@]}\", \"class\": \"''${class}\"}\n" printf "{\"text\": \"''${icon}\", \"tooltip\": \"''${networks[@]}\", \"class\": \"''${class}\"}\n"
} }