1/28/2024 0 Comments Hammerspoon rapid fire scriptlua files, and then reference each script from that all-important a file. In this final section, we’re going to create our scripts as separate. We may have pasted our Wi-Fi script over our original ‘Hello from Hammerspoon’ script, but it is possible to run multiple Hammerspoon scripts side by side. Reconnect to your network, and it should trigger another notification, complete with the name of the network that you’ve just connected to. Try disconnecting from your Wi-Fi network, by selecting the ‘Wi-Fi’ icon in your Mac’s menu bar and choosing ‘Turn off Wi-Fi.’ You should see a notification warning you that the Internet is disconnected. Select the ‘Hammerspoon’ icon and choose ‘Reload config.’.Select ‘File > Save’ from your Mac’s menu bar.Hs.notify.show("Connected to Wi-Fi network","",net,"") Hs.notify.show("You lost Wi-Fi connection","","","") In this section, we’re going to create a script that’ll display a notification whenever the Wi-Fi signal is lost, and then displays another notification every time your Mac connects to a new network, complete with the name of the network that it’s just connected to.Ĭopy/paste the following into your a file: wifiwatcher = hs.(function () If you don’t have a reliable Wi-Fi network, or your Mac regularly switches between different networks, then it may help to display notifications about the current state of your Wi-Fi connection. Now we know how to issue a notification, the next step is displaying a notification in response to certain events. Your custom notification should now appear onscreen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |