Merge pull request #2 from mltnhm/macOS-support

Add macOS support
This commit is contained in:
embr 2020-01-06 10:02:48 +00:00 committed by GitHub
commit c4e8f175f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,10 @@
function ambient_get_ssid
if not set -q ambient_ssid
set -g ambient_ssid (iw dev | grep ssid | awk '{print $2}')
if test (uname) = "Darwin"
set -g ambient_ssid (/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | sed -n 's/^ *SSID: //p')
else
set -g ambient_ssid (iw dev | grep ssid | awk '{print $2}')
end
end
echo $ambient_ssid
end