From 13f1c4c39593b92d6c0c2201ef06af075d0dcf74 Mon Sep 17 00:00:00 2001 From: thek4n Date: Sat, 29 Nov 2025 10:53:25 +0300 Subject: [PATCH] fix wifi in status --- home/user/.local/bin/i3blocks_helper | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/home/user/.local/bin/i3blocks_helper b/home/user/.local/bin/i3blocks_helper index 1cb697d..842b0a1 100755 --- a/home/user/.local/bin/i3blocks_helper +++ b/home/user/.local/bin/i3blocks_helper @@ -8,7 +8,14 @@ readonly EXIT_FAILURE=1 cmd_wireless() { - echo " $(LANG=C nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2) $(ip -o -4 addr show | grep wlp | awk '{print $4}' | cut -d/ -f1 | head -1)" + wifiname="$(LANG=C nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)" + wifi_ip=$(ip -o -4 addr show | grep wlp | awk '{print $4}' | cut -d/ -f1 | head -1) + + if [ -z "${wifiname}" ] || [ -z "${wifi_ip}" ]; then + return 0 + fi + + printf ' %s %s\n' "${wifiname}" "${wifi_ip}" } cmd_battery() {