
- TAGDIDCHANGE EVENT HAMMERSPOON HOW TO
- TAGDIDCHANGE EVENT HAMMERSPOON FULL
- TAGDIDCHANGE EVENT HAMMERSPOON ZIP
- TAGDIDCHANGE EVENT HAMMERSPOON MAC
Select the ‘Hammerspoon icon from your Mac’s menu bar, and then click ‘Reload config.’.You can now put these three scripts to the test: Reference ‘a’ and ‘a’,’ by copy/pasting the following script into ‘a.’.Select ‘File > Open config.’ This launches the default ‘a’ file – at last, this is the file we actually need!.We now need to reference both of these files, from a. Copy/paste your Wi-Fi script into this window.Īt this point, we have a separate ‘a’ and ‘a’ file.Select ‘File > Rename…’ and give this file the name ‘a.’.Select ‘File > Open config.’ Once again this launches the ‘a’ file.Copy/paste your ‘Hello from Hammerspoon’ script into this file.Select ‘File > Open config.’ This launches the default ‘a’ file.lua 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.

TAGDIDCHANGE EVENT HAMMERSPOON MAC
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.
TAGDIDCHANGE EVENT HAMMERSPOON HOW TO
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. Press the ‘Command + h + w’ keys on your keyboard.Select the ‘Hammerspoon’ icon from your Mac’s menu bar and then click ‘Reload Config.’.Select ‘File > Save’ from the menu bar.Let’s start with something simple that you can test straight away, by creating a keyboard shortcut that triggers a notification.Ĭopy/paste the following into the a window: hs.hotkey.bind(, "W", function() Your first Hammerspoon script: Displaying a notification This is where we’ll be creating our first script. Select ‘File > Open Config’ from the Hammerspoon menu bar. At this point, you should see Hamerspoon’s Lua console.Find the ‘Hammerspoon’ app, and give its accompanying checkbox a click.Click the little padlock in the bottom-left corner, and enter your admin password.Make sure the ‘Privacy’ tab is selected.When prompted, click ‘Open System Preferences.’ This should launch macOS’ regular ‘Security & Privacy’ window.You can select and deselect the various options, depending on your preferences, but you must enable accessibility in order to use Hammerspoon properly, so give the ‘Enable Accessibility’ button a click. The first time you launch Hammerspoon, it’ll present you with a preference pane.Once the file has finished downloading, unzip it and launch the resulting app.
TAGDIDCHANGE EVENT HAMMERSPOON ZIP
Make sure you download the Hammerspoon zip file, rather than the source code!
TAGDIDCHANGE EVENT HAMMERSPOON FULL
(or if it's even possible to have it function in full screen environments).įollowing on from question 1., if the command is done (in Windowed), when you do it twice in a row, the second command acts as just "enter".

I am not sure if it's possible to have the script locked to a window, or maybe locked to full screen apps, etc. Strangely enough, if you change the setting to be Windowed rather than Full Screen, the command works perfectly. Is there any way for Hammerspoon/this script to function in a full screen environment? The game I am using this for opens a full screen window for itself, where it then stops working. Thank you for this! This works well (I tested it in Notepad and the command goes off without a hitch)! I have a couple of questions:
