Skip to content

Plugin Daemon API

Derrick Gold edited this page Apr 30, 2016 · 2 revisions

#Plugin Daemon API:

##API Calls The Plugin Daemon has an API for direct plugin management. This API can be utilized through the mmcom program provided, or through a direct web-socket connection using the protocol aptly named: STDIN. To put things into context, this is the all encompassing API that the Web GUI utilizes.

##List of API commands:

    /* commands
     * Lists all these available API calls.
     */        

    /*
     * disable <pluginName>
     * Unloads a plugin from the frontend, unschedules the plugin
     * from updating, and stops any child processes of plugin.
     */

    /*
     * enable <pluginName>
     * Loads a plugin into the frontend and if applicable, enables
     * it in the main scheduler for providing display updates.
     */

    /*
     * reload <pluginName>
     * Reloads a plugins 'plugin.conf' file configuration,
     * unloads the plugin from the frontend and scheduler,
     * then reloads it back into the frontend and scheduler
     * with the newly loaded configuration setup.
     */

    /*
     * plugins
     * List all plugins currently loaded in the PluginDaemon.
     */

    /*
     * getdir <pluginName>
     * Returns the filepath to the directory in which the
     * specified plugin's configuration file resides.
     */


    /*
     * rmplug <pluginName>
     * Completely unloads a plugin from the PluginDaemon.
     * After this is called, the PluginDaemon will be completely
     * unaware of this plugins existence.
     */

    /*
     * mirrorsize
     * Returns the frontend display dimensions as a string
     * formatted as 'widthxheight'.
     */

    /*
     * stop
     * Stops the plugin daemon for a clean shutdown,
     */

    /*
     * setcss <plugin> <cssAttr=value;attr=value....>
     * Set a CSS value for a plugin's frontend
     * display.
     */

    /*
     * getcss <plugin> <attr1, attr2,....>
     * Query the plugin's css attribute from the frontend.
     * If plugin is not loaded to frontend, nothing will
     * be returned. Multiple CSS properties can be queried
     * for and will be delimited with a newline character.
     */

    /*savecss <plugin>*/

    /*
     * getstate <plugin>
     * Returns whether a plugin is enabled and running
     * or not.
     */

    /*
     * jscmd <plugin> {\"fn\":\"<FUNCTION>\",\"args\":<ARGS>}
     * If plugin has a javascript class instantiated, this will
     * send a command to that plugin to execute a function. The
     * string sent should be formatted as JSON with the 'fn' property
     * being the name of the function to execute, and 'args' property
     * being the arguments to provide to that function call.
     */

    /*
     * display
     * Returns whether or not a display is connected to the daemon.
     */

    /*
     * getopt <plugin> <config_file_setting>
     * Returns a value in a plugins config file based
     * on the queried setting.
     */


    /*
     * setopt <plugin> <config_file_setting>=<new_value>
     * Write a new entry or overwrite an existing entry in a plugin's
     * config file.
     */

##Command Line API Calls Using mmcom allows one to make synchronous API calls in the command line, or in other programs, and writes the response to stdout.

mmcom [-p portNum] -c command [[-x plugin-name] [-v data]]

Clone this wiki locally