awaymili.blogg.se

Hammerspoon spoons
Hammerspoon spoons












  1. Hammerspoon spoons software license#
  2. Hammerspoon spoons install#
  3. Hammerspoon spoons code#
  4. Hammerspoon spoons download#

The method should accept a single parameter, which is a table. If your Spoon provides actions that a user can map to hotkeys, you should expose a :bindHotKeys() method. you should generally activate them in a :start() method, and de-activate them in a :stop() method Hotkeys timers, watchers, spotlight searches, etc. If your Spoon provides some kind of background activity, e.g. homepage - A URL for the home of your Spoon, e.g.

Hammerspoon spoons software license#

license - The software license that applies to your Spoon, ideally with a link to the text of the license (e.g. author - Your name and optionally your email address You should include at least the following properties on your object: In the :init() method, you should do any work that is necessary to prepare resources for later use, although generally you should not be starting any timers/watchers/etc.

hammerspoon spoons

If the object you return has an :init() method, Hammerspoon will call it automatically (although users can override this behaviour, so be sure to document your :init() method). Instead, it should simply prepare an object with methods to be used later, then return the object. You should generally not perform any work, map any hotkeys, start any timers/watchers/etc. When a user calls hs.loadSpoon(), Hammerspoon will load and execute a from the relevant Spoon.

  • Spoon methods/variables/constants/etc.
  • However, Spoons offer the most value to users of Hammerspoon when they conform to an API convention, allowing users to interact with all of their Spoons in very similar ways.

    hammerspoon spoons

    Ultimately a Spoon can be as little as a directory whose name ends. 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. 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 spoons install#

    Hammerspoon will install it for you in ~/.hammerspoon/Spoons/ How do I use a Spoon?

    hammerspoon spoons

    Hammerspoon spoons download#

    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 spoons code#

  • 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.

    hammerspoon spoons

    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 spoons