Skip to content

[development] extensions

Pedro Pinto edited this page Aug 10, 2019 · 7 revisions

Basic Structure

UUID: EXTENSION_NAME@cinnamon.org
using either your name or your domain name behind the @ sign.

Directory for extensions:

$HOME/.local/share/cinnamon/extension/UUID

Required Files:

metadata.json

  • requiredProperties: ['uuid', 'name', 'description', 'cinnamon-version'],
  • niceToHaveProperties: ['url'],

extension.js

  • requiredFunctions: ['init', 'disable', 'enable'],

Optional Files:

stylesheet.css

  • will be automatically loaded

settings-schema.json

Metadata Example

{
    "cinnamon-version": [
        "1.8",
        "1.9", 
        "2.0"
    ], 
    "uuid": "EXTENSION_NAME@cinnamon.org", 
    "name": "EXTENSION_NAME", 
    "description": "Aweseome Extension", 
    "url" : "https://this-is-where-you-put-your-HP-or-github-or-whatever.url"
}

Extension Basic Functions

/**
 * called when extension is loaded
 */
function init(extensionMeta) {
  //extensionMeta holds your metadata.json info
  const UUID = extensionMeta['uuid'];
}

/**
 * called when extension is loaded
 */
function enable() {

}

/**
 * called when extension gets disabled
 */
function disable() {

}