If you want to explore the options Hammerspoon offers, check out the Getting Started Guide and the full API documentation. You might want to do something crazy like having iTunes automatically start playing when your Mac detects you are in Paris. So instead of scheduling a task to run each minute to check what the wifi network is, when a wifi event happens the OS API that you're registered to triggers a call to your task. Type the following in the Hammerspoon console, or add it to your a file and reload the configuration: hs. Once a Spoon is installed, you need to use the hs.loadSpoon () function to load it. You might want to display an alert when your battery drops below a certain percentage. One benefit that hammerspoon brings is it bridges the gap between your scripts/tasks and operating system APIs. a This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. Hammerspoon will install the Spoon under /.hammerspoon/Spoons/. In the question 'What are the best power user tools for macOS' Spectacle is ranked 3rd while Hammerspoon is ranked 35th. You might want to run a series of commands when your wifi interface connects to your home network. When comparing Hammerspoon vs Spectacle, the Slant community recommends Spectacle for most people. You might want to bind a keyboard shortcut to a series of window operations, or an Applescript. Typically you would write a configuration file in Lua that connects events to actions. You can write Lua code that interacts with OS X APIs for applications, windows, mouse pointers, filesystem objects, audio devices, batteries, screens, low-level keyboard/mouse events, clipboards, location services, wifi, and more. This is very hard to describe succinctly. For example, when you use hs.application for the first time, you will see a message in the console: > hs.application.get('Terminal') 06:47:15: - Loading extension: application hs. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user. Hammerspoon automatically loads any modules under the hs namespace the first time you use them. At its core, it is just a bridge between the operating system and a Lua scripting engine. Hammerspoon is a tool for powerful automation of OS X.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |