Skip to content

Instantly share code, notes, and snippets.

View pandrewhk's full-sized avatar
👨‍💻
🛠

Andrew Pantyukhin pandrewhk

👨‍💻
🛠
View GitHub Profile
@pandrewhk
pandrewhk / wifi.lua
Last active November 23, 2020 11:15 — forked from jellea/wifi.lua
function ssidChangedCallback()
newSSID = hs.wifi.currentNetwork()
if newSSID ~= lastSSID then
hs.alert.show("WiFi changed, muting speakers", 5)
hs.audiodevice.findOutputByName("MacBook Pro Speakers"):setOutputVolume(20)
hs.audiodevice.findOutputByName("MacBook Pro Speakers"):setOutputMuted(true)
end
lastSSID = newSSID