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 `defaults` or other tools which allow access to the `User Defaults` of applications, to access these outside of Hammerspoon |
Source | extensions/settings/internal.m |
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 `hs.setDate()`. e.g. `os.date(hs.settings.dateFormat)` |
Source | extensions/settings/internal.m |
Signature | hs.settings.clear(key) -> bool |
---|---|
Type | Function |
Description | Deletes a setting |
Parameters |
|
Returns |
|
Source | extensions/settings/internal.m |
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/internal.m |
Signature | hs.settings.getKeys() -> table |
---|---|
Type | Function |
Description | Gets all of the previously stored setting names |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/internal.m |
Signature | hs.settings.set(key[, val]) |
---|---|
Type | Function |
Description | Saves a setting with common datatypes |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/internal.m |
Signature | hs.settings.setData(key, val) |
---|---|
Type | Function |
Description | Saves a setting with raw binary data |
Parameters |
|
Returns |
|
Source | extensions/settings/internal.m |
Signature | hs.settings.setDate(key, val) |
---|---|
Type | Function |
Description | Saves a setting with a date |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/settings/internal.m |
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/internal.m |