From 9887751cbba1982209e7bb0a635029da752ba18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bygd=C3=A9n?= Date: Tue, 17 Sep 2024 10:51:32 +0200 Subject: [PATCH 1/2] Patch to fix #290 --- scripts/network.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/network.sh b/scripts/network.sh index 6faeb36f..ccec9362 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -22,9 +22,9 @@ get_ssid() ;; Darwin) - if networksetup -getairportnetwork en0 | cut -d ':' -f 2 | sed 's/^[[:blank:]]*//g' &> /dev/null; then + if system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }'; then wifi_label=$(get_tmux_option "@dracula-network-wifi-label" "") - echo "$wifi_label$(networksetup -getairportnetwork en0 | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g' + echo "$wifi_label$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')" else echo "$(get_tmux_option "@dracula-network-ethernet-label" "Ethernet")" fi From 784106ddaf82b4c7753a18c2a8aacd58a455b9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bygd=C3=A9n?= Date: Wed, 16 Oct 2024 09:22:10 +0200 Subject: [PATCH 2/2] Changed to quicker command --- scripts/network.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/network.sh b/scripts/network.sh index ccec9362..f8f2ec15 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -22,9 +22,9 @@ get_ssid() ;; Darwin) - if system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }'; then + if ipconfig getsummary en0 | awk -F ' SSID : ' '/ SSID : / {print $2}'; then wifi_label=$(get_tmux_option "@dracula-network-wifi-label" "") - echo "$wifi_label$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')" + echo "$wifi_label$(ipconfig getsummary en0 | awk -F ' SSID : ' '/ SSID : / {print $2}')" else echo "$(get_tmux_option "@dracula-network-ethernet-label" "Ethernet")" fi