hs.host.addresses() -> table
hs.host.cpuUsage([period], [callback]) -> table
period
- an optional value specifying the time between samples collected for calculating CPU usage statistics.callback
is not provided, this is an optional integer, default 100000, specifying the number of microseconds to block between samples collected. Note that Hammerspoon will block for this period of time during execution of this function.callback
is provided, this is an optional number, default 1.0, specifying the number of seconds between samples collected. Hammerspoon will not block during this time period.callback
- an optional callback function which will receive the cpu usage statistics in a table, described below, as its sole argument.overall
containing the same keys as described above but based upon the average of all cores combined.n
containing the number of cores detected.hs.host.cpuUsage:finished()
- returns a boolean indicating if the second CPU sample has been collected yet (true) or not (false).hs.host.cpuUsage:stop()
- abort the sample collection. The callback function will not be invoked.period
microseconds (1 second = 1,000,000 microseconds). The default period is 1/10 of a second. If period
is too small, it is possible that some of the CPU statistics may result in nan
(not-a-number).hs.host.cpuUsageTicks() -> table
ticks
since the most recent system boot.overall
containing the same keys as described above but based upon the combined total of all cpu cores for the system.n
containing the number of cores detected.hs.host.cpuUsage
.hs.host.globallyUniqueString() -> string
hs.host.uuid
hs.host.temporaryDirectory()
when creating temporary files.hs.host.gpuVRAM() -> table
hs.host.idleTime() -> seconds
hs.host.interfaceStyle() -> string
hs.host.localizedName() -> string
hs.host.names() -> table
hs.host.operatingSystemVersion() -> table
operatingSystemVersionString
selector, which Apple states is not guaranteed to be reliably parseable.approximate
key is defined and set to true, as the exact patch level cannot be definitively determined.operatingSystemVersion
selector and the exact
key is defined and set to true if this method is used.hs.host.operatingSystemVersionString() -> string
hs.host.thermalState() -> string
hs.host.uuid() -> string
hs.host.globallyUniqueString
hs.host.vmStat() -> table
hs.host.vmStats()
.vm_stat
.hs.host.volumeInformation([showHidden]) -> table