Switch to systemd-networkd for AP name

This commit is contained in:
Knut Ahlers 2024-10-28 12:20:37 +01:00
parent f91ced3130
commit 0206ddaf1c
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -11,12 +11,12 @@ ip=$(ip a show ${interface} | awk '/inet .* scope global/{ print $2 }' | cut -d
# We found no ip: Get out here
[ -z "${ip}" ] && exit
network=$(iwgetid -r)
network=$(networkctl status -a | awk -F ': ' '/Wi-Fi access point/{ print $2 }' | cut -d ' ' -f 1)
# We found no network: Get out here
[ -z "${network}" ] && exit
printf "\uf9a1 <span color=\"#8FAAFC\">%s</span> <span color=\"#50fa7b\">(%s)</span>\n" ${network} ${ip}
printf "\uf1eb <span color=\"#8FAAFC\">%s</span> <span color=\"#50fa7b\">(%s)</span>\n" ${network} ${ip}
# On click copy IP
[ -n "${BLOCK_BUTTON:-}" ] && echo -n "${ip}" | tr -d '\n' | xclip -selection c || true