ambient/functions.d/ambient_get_ssid.fish

11 lines
377 B
Fish
Raw Normal View History

2020-01-02 15:33:37 +00:00
function ambient_get_ssid
2020-01-02 19:53:56 +00:00
if not set -q ambient_ssid
2020-01-05 16:47:37 +00:00
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
2020-01-02 19:53:56 +00:00
end
echo $ambient_ssid
2020-01-02 15:33:37 +00:00
end