nixos-config/home-manager/wayland/eww/scripts/network

9 lines
234 B
Plaintext
Raw Normal View History

2024-05-11 19:17:30 -04:00
#!/usr/bin/env bash
nmcli -t c show --active | awk -F ':' -e \
'// { if ($3 == "'$1'") {
print "{\"name\":\""$1"\",\"device\":\""$4"\"}";
found = 1;
exit;
}}
END { if (!found) print "{}" }'