oreomobile.blogg.se

Hammerspoon spoon example
Hammerspoon spoon example




Ultimately a Spoon can be as little as a directory whose name ends.

hammerspoon spoon example

Many Spoons will offer additional API points on top of these, and you should consult their documentation to learn more. page - A string containing a URL to the Spoon's homepage.NAME.license - A string containing some information about the license that applies to the Spoon, ideally including a URL to the license.thor - A string containing the name/email of the spoon's author.NAME.version - A string containing the version number of the Spoon.NAME.name - A string containing the name of the Spoon.The Spoon should also provide some standard metadata: Hence you can have it look for Spoons in other paths by adding those paths to package.path as follows: Note that hs.loadSpoon() uses package.path to find Spoons. This will make the spoon available in the global Lua namespace as spoon.NAME.Īfter loading a Spoon, you are responsible for calling its start() method if it has one before using it. Loading a Spoonįor most Spoons, simply add hs.loadSpoon("NAME") to your Hammerspoon config (note that NAME should not include the.

hammerspoon spoon example

There you should find some documentation of the API offered by the Spoon, and any special requirements it has. Hopefully the Spoon came with some documentation, either on its homepage or in ~/.hammerspoon/Spoons/NAME.spoon. There are two parts to this, loading the spoon, and integrating it into your configuration. Hammerspoon will install it for you in ~/.hammerspoon/Spoons/ How do I use a Spoon? Simply download one, uncompress it (if your browser hasn't done that part automatically) and double click on the Spoon. The official repository of Spoons is (the source for which can be found at ), but authors may choose to distribute them separately from their own sites.

  • The authors of Spoons sticking, wherever possible, to a standard API for users to use.
  • hammerspoon spoon example

    Infrastructure within Hammerspoon for loading Lua code from Spoons.Users should be able to download a Spoon and quickly integrate it into their config without worrying about what it is doing internally. Spoons have been created as a way to address these issues. Spoons are intended to be pure-Lua plugins for users to use in their Hammerspoon configs.Īs a community, we have created many great configurations for Hammerspoon, but sharing code between them is hard and fragile.






    Hammerspoon spoon example