Networkwidget: Call network list only once.

This commit is contained in:
Dmitry Voronin 2024-12-28 15:42:47 +03:00
parent f926b3bc63
commit 1de270e49f
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -2,9 +2,10 @@
function networkwidget() {
local IFS=$'\n'
local internet=$(nmcli networking connectivity check)
local _ethernets=($(nmcli connection show --active | rg ethernet | sed "s/ .*//"))
local _vpns=($(nmcli connection show --active | rg vpn | sed "s/ .*//"))
local _wifis=($(nmcli connection show --active | rg wifi | sed "s/ .*//"))
local _connections=($(nmcli connection show --active))
local _ethernets=($(printf "%s\n" ${_connections[@]} | rg ethernet | sed "s/ .*//"))
local _vpns=($(printf "%s\n" ${_connections[@]} | rg vpn | sed "s/ .*//"))
local _wifis=($(printf "%s\n" ${_connections[@]} | rg wifi | sed "s/ .*//"))
local _bts_raw=($(bluetoothctl devices Connected))
local _bts=()
local _bt_lowest=100