Compare commits

...

1 commit

Author SHA1 Message Date
Dmitry Voronin 25e865a56f Networkwidget: Simplify newline append. 2024-12-13 13:38:28 +03:00

View file

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