![]() You can find the name for yours in the Network section of your System Preferences. The only thing you'll have to customise is the name of your Ethernet interface in a in my case it's "USB 10/100/1000 LAN" because I'm using a dock. If event = hs. thenĮlseif event = hs. then EvernoteOpenAndTag: Add some missing hotkeys for opening a note in Evernote, and for common tag sets. Emojis: Let users choose emojis by name/keyword. ![]() EmmyLua: Thie plugin generates EmmyLua annotations for Hammerspoon and any installed Spoons. Hs.alert.show("Wifi already in the desired state")įunction M.setEthernetInterface(ethernetInterfaceName)ĮthernetInterface = ethernetInterfaceName A much-needed eject menu for your Mac menu bar. NewState = desiredState and "on" or "off" If hs.wifi.interfaceDetails() ~= desiredState then Hammerspoon is an application that combines the lua language with the macOS operating. Return activeInterfaceName = ethernetInterfaceĭesiredState = not isEthernetConnected() and true or false Note: this software only works for macOS. SystemWatcher = hs.(homeNetwork.handleWifi)ĪctiveInterfaceName = hs.network.interfaceName(ipv4) Toggle WiFi based on Ethernet being connected or not I'm not associated to it in any way, I literally installed it to try and achieve the same purpose as the OP.įor anything you want to automate, you write little Lua scripts in this case, I created a a file which I saved next to the main configuration file, $HOME/.hammerspoon/a. With these, you can write Lua scripts to control many aspects of your OS X environment. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user. At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine. Hammerspoon is a tool to automate various operations on a Mac. This is a tool for powerful automation of OS X. however, as there are multiple ways of accomplishing the same result, I thought it worth sharing one more: using Hammerspoon and a couple of snippets of Lua code. switcher = hs.(hs. realise this question is a bit old. For some reason, the (capital?) tab character is string.char(25) when shift was being pressed. If shift+command+tab was pressed, we go to the previous window. Returning true means that the key press is not forwarded on to other applications (but it is if we return false or nil). If tab was pressed while only the cmd modifier was on, then we call switcher:next() to go to switch to the next window. mapCmdTab is a callback function for every time a key is pressed. We set up a window switcher that switches between windows within the current space. Getting Wi-Fi notifications Now we know how to issue a notification, the next step is displaying a notification in response to certain events. It runs natively on Apple Silicon and is fully compatible with Hammerspoon. Your custom notification should now appear onscreen. CommandPost is a free and open source macOS application that bridges between. This is a tool for powerful automation of OS X. Quick switch Chrome users, or open incognito mode. If you already have Hammerspoon, rename a to a before copying into /.hammerspoon, then edit your a and add the following: require ('hammerspoon-pc') Customizing You can have each app get a different set of keypresses. Select the ‘Hammerspoon’ icon from your Mac’s menu bar and then click ‘Reload Config.’ Press the ‘Command + h + w’ keys on your keyboard. Open a Chrome tab with alt + Snap windows to the edges of the screen, and resize it Move windows between multiple monitors. In order to use cmd+tab and shift+command+tab to switch windows, you need to use eventtap so that you can override the default app switcher hotkey. Install Hammerspoon Create a directory: /.hammerspoon and put all files there.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |