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 |
Source | extensions/settings/libsettings.m line 326 |
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 |
Source | extensions/settings/libsettings.m line 320 |
Signature | hs.settings.clear(key) -> bool |
---|---|
Type | Function |
Description | Deletes a setting |
Parameters |
|
Returns |
|
Source | extensions/settings/libsettings.m line 179 |
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 |
|
Source | extensions/settings/libsettings.m line 157 |
Signature | hs.settings.getKeys() -> table |
---|---|
Type | Function |
Description | Gets all of the previously stored setting names |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/libsettings.m line 200 |
Signature | hs.settings.set(key[, val]) |
---|---|
Type | Function |
Description | Saves a setting with common datatypes |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/libsettings.m line 49 |
Signature | hs.settings.setData(key, val) |
---|---|
Type | Function |
Description | Saves a setting with raw binary data |
Parameters |
|
Returns |
|
Source | extensions/settings/libsettings.m line 91 |
Signature | hs.settings.setDate(key, val) |
---|---|
Type | Function |
Description | Saves a setting with a date |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/libsettings.m line 129 |
Signature | hs.settings.watchKey(identifier, key, [fn]) -> identifier | current value |
---|---|
Type | Function |
Description | Get or set a watcher to invoke a callback when the specified settings key changes |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/libsettings.m line 230 |