Module corky.conky

Corky interface to Conky.

This module will clean up the global namespace and remove all conky_* variables and functions (with the exception of conky_window). All of these variables/functions may then be accessed using the table returned by this module:

local conky = require "corky.conky"

-- Use conky.build_info instead of conky_build_info:
print (conky.build_info)

-- The "conky_" prefix is allowed:
print (conky.conky_build_info)

The conky_window table must be available globally for Conky's Cairo interface to work, so it will not be removed. It can be accessed as global variable or like the other variables via the table returned by this module.

Info:

  • Copyright: © 2015-2017 Stefan Göbel
  • Release: 2017033001
  • License: GPLv3
  • Author: Stefan Göbel [⌂] [✉]

Functions

setup (...) Setup the Conky functions and variables.
global (...) Make conky_* functions or variables global.

Local Functions

meta.__index (self, key) Return a conky_* variable/function.

Local Tables

conky Stores the conky_* variables and functions.
meta The meta table for the corky.conky table.


Functions

setup (...) line 82
Setup the Conky functions and variables.

This function will be called automatically when the module is loaded!

After calling this function all global variables and functions with a name starting with "conky_" will be removed from the global namespace. Instead, they will be available in the table returned by this module.

Since Conky requires some functions to be available globally, an arbitrary number of parameters may be specified to keep these functions (or variables) in _G. The parameters must be strings, specifying the names of the functions or variables, without the "conky_" prefix. If global() has been called for some functions or variables before setup(), all these functions or variables will be excluded, too.

Note: There is a built-in exception: the conky_window table will not be removed from the global namespace. It appears that removing it breaks Conky's Cairo interface. All variables that are kept in _G will still be copied to this module's table and - depending on the variable type - may be accessed both ways.

Calling this function multiple times is allowed, but usually not necessary.

Parameters:

  • ... An arbitrary number of strings, specifying which functions or variables to keep in the global namespace. The names must not include the "conky_" prefix.
global (...) line 116
Make conky_* functions or variables global.

Once a name has been marked as global by this function, setup() will not remove it from the global namespace. If setup() has been called already, all specified functions or variables will be copied back into the global namespace.

Note: Variables or functions will be copied to _G, and will still be available in the table returned by this module. Keep in mind that changing value type variables (e.g. strings or numbers) will only change one of the copies!

Parameters:

  • ... Names of the functions or variables to keep in or copy back to the global namespace. Names must not include the "conky_" prefix, it will be added automatically!

Local Functions

meta.__index (self, key) line 154
Return a conky_* variable/function.

The key parameter specifies the name of the variable or function to return. It may include the "conky_" prefix, it will be automatically added if it does not.

Parameters:

  • self table The corky.conky table.
  • key string The name of the variable or function to return.

Returns:

  1. The requested variable or function, or nil if it does not exist.

Local Tables

conky line 52
Stores the conky_* variables and functions.

The keys in the table are the original names (including the "conky_" prefix). The values are the corresponding variables and functions.

meta line 142
The meta table for the corky.conky table.

Provides a custom indexer to access the conky_* stuff.

generated by LDoc 1.4.6 Last updated 2019-02-14 20:51:07