diff --git a/package/swayscript/script/NetworkWidget.nix b/package/swayscript/script/NetworkWidget.nix index 89783e61..e6e004e3 100644 --- a/package/swayscript/script/NetworkWidget.nix +++ b/package/swayscript/script/NetworkWidget.nix @@ -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.