#
hs.settings
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.
#
API Overview
Constants - Useful values which cannot be changed
bundleID dateFormat
Functions - API calls offered directly by the extension
clear get getKeys set setData setDate watchKey
#
API Documentation
#
Constants
#
bundleID
#
dateFormat
#
Functions
#
clear
#
get
#
getKeys
#
set
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.settings.set(key[, val])
|
| Type | Function |
| Description | Saves a setting with common datatypes |
| Parameters |
- key - A string containing the name of the setting
- val - An optional value for the setting. Valid datatypes are: string number boolean nil table (which may contain any of the same valid datatypes)
- None
- If no val parameter is provided, it is assumed to be nil
- This function cannot set dates or raw data types, see
hs.settings.setDate()
andhs.settings.setData()
- Assigning a nil value is equivalent to clearing the value with
hs.settings.clear