Serialize simple Lua variables across Hammerspoon launches Settings must have a string key and must be made up of serializable Lua objects (string, number, boolean, nil, tables of such, etc.)
This module is based partially on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.settings.bundleID |
---|---|
Type | Constant |
Description | A string representing the ID of the bundle Hammerspoon's settings are stored in . You can use this with the command line tool |
Signature | hs.settings.dateFormat |
---|---|
Type | Constant |
Description | A string representing the expected format of date and time when presenting the date and time as a string to |
Signature | hs.settings.clear(key) -> bool |
---|---|
Type | Function |
Description | Deletes a setting Parameters:
Returns:
|
Signature | hs.settings.get(key) -> string or boolean or number or nil or table or binary data |
---|---|
Type | Function |
Description | Loads a setting Parameters:
Returns:
Notes:
|
Signature | hs.settings.getKeys() -> table |
---|---|
Type | Function |
Description | Gets all of the previously stored setting names Parameters:
Returns:
Notes:
|
Signature | hs.settings.set(key[, val]) |
---|---|
Type | Function |
Description | Saves a setting with common datatypes Parameters:
Returns:
Notes:
|
Signature | hs.settings.setData(key, val) |
---|---|
Type | Function |
Description | Saves a setting with raw binary data Parameters:
Returns:
|
Signature | hs.settings.setDate(key, val) |
---|---|
Type | Function |
Description | Saves a setting with a date Parameters:
Returns:
Notes:
|
Signature | hs.settings.watchKey(identifier, key, [fn | nil]) -> identifier | current value |
---|---|
Type | Function |
Description | Get or set a watcher to invoke a callback when the specified settings key changes Parameters:
Returns:
Notes:
|