
- #Hammerspoon spoons install
- #Hammerspoon spoons full
- #Hammerspoon spoons code
- #Hammerspoon spoons series
More extensions will always be a huge benefit to Hammerspoon. You can learn more about the Lua scripting language at lua.org.
#Hammerspoon spoons full
If you are new to Hammerspoon, read the Getting Started Guide with reference to the full API documentation. You will need to create a Lua script in ~/.hammerspoon/a using our APIs and standard Lua APIs. Out of the box, Hammerspoon does nothing.
#Hammerspoon spoons install
How do I install it?ĭownload the latest release and then drag the application to /Applications/. You might want to do something crazy like have iTunes automatically start playing when your Mac detects you are in Paris. You might want to display an alert when your battery drops below a certain percentage.
#Hammerspoon spoons series
You might want to run a series of commands when your wifi interface connects to your home network. 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. If you want to explore the options Hammerspoon offers, check out the Getting Started Guide and the full API documentation as well as the already pre-made plugins called Spoons.
#Hammerspoon spoons code
You can write Lua code that interacts with macOS APIs for applications, windows, mouse pointers, filesystem objects, audio devices, batteries, screens, low-level keyboard/mouse events, clipboards, location services, wifi, and more. 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.
noerror - if true, don't log an error if the Spoon is not installed, simply return nil.This is a tool for powerful automation of macOS. start - if true, call the Spoon's start() method after configuring everything else. loglevel - if the Spoon has a variable called logger, its setLogLevel() method will be called with this value. fn - a function which will be called with the freshly-loaded Spoon object as its first argument. The special string "default" can be given to use the Spoons defaultHotkeys variable, if it exists. If provided, will be passed as-is to the Spoon's bindHotkeys() method. hotkeys - a table containing hotkey bindings. Defaults to: will result in spoon.answer being set to 42. Provided values are merged with the defaults. metadata: (optional) table containing metadata values to be inserted in the template. basedir: (optional) directory where to create the template. name: name of the new spoon, without the. Hs.spoons.newSpoon(name, basedir, metadata, ) -> string | nil loaded - boolean indication of whether the Spoon is loaded ( true) or only installed ( false).
Each entry is a table with the following entries:
Table with a list of installed/loaded spoons (depending on the value of onlyLoaded). onlyLoaded - only return loaded Spoons (skips those that are installed but not loaded). true if the Spoon is loaded, nil otherwise. Hs.spoons.isLoaded(name) -> boolean | nil Returns nil if the Spoon is not installed. If the Spoon is installed, it returns a table with the Spoon information as returned by list(). Hs.spoons.isInstalled(name) -> table | nil Not all the entries in def must be bound, but if any keys in map don't have a definition, an error will be produced. map - table containing name-to-hotkey definitions and an optional message to be displayed via hs.alert() when the hotkey has been triggered, as supported by bindHotkeys in the Spoon API. Each key is a hotkey name, and its value must be a function that will be called when the hotkey is invoked. def - table containing name-to-function definitions for the hotkeys supported by the Spoon. Map a number of hotkeys according to a definition table Hs.spoons.bindHotkeysToSpec(def, map) -> none Functions - API calls offered directly by the extensionĪPI Documentation Functions bindHotkeysToSpec Signature. Utility and management functions for Spoons Hammerspoon docs: hs.spoons docs » hs.spoons