#
hs.spoons
Utility and management functions for Spoons Spoons are Lua plugins for Hammerspoon. See https://www.hammerspoon.org/Spoons/ for more information
#
API Overview
Functions - API calls offered directly by the extension
bindHotkeysToSpec isInstalled isLoaded list newSpoon resourcePath scriptPath use
#
API Documentation
#
Functions
#
bindHotkeysToSpec
#
isInstalled
#
isLoaded
#
list
#
newSpoon
#
resourcePath
#
scriptPath
#
use
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.spoons.use(name, arg, [noerror]) -> boolean | nil
|
| Type | Function |
| Description | Declaratively load and configure a Spoon |
| Parameters |
- name - the name of the Spoon to load (without the
.spoon
extension). - arg - if provided, can be used to specify the configuration of the Spoon. The following keys are recognized (all are optional):
config - a table containing variables to be stored in the Spoon object to configure it. For example,
config = { answer = 42 }
will result inspoon.<LoadedSpoon>.answer
being set to 42. hotkeys - a table containing hotkey bindings. If provided, will be passed as-is to the Spoon'sbindHotkeys()
method. The special string"default"
can be given to use the SpoonsdefaultHotkeys
variable, if it exists. fn - a function which will be called with the freshly-loaded Spoon object as its first argument. loglevel - if the Spoon has a variable calledlogger
, itssetLogLevel()
method will be called with this value. start - iftrue
, call the Spoon'sstart()
method after configuring everything else. - noerror - if
true
, don't log an error if the Spoon is not installed, simply returnnil
.
true
if the spoon was loaded,nil
otherwise