Provides Hammerspoon with the ability to create both local and remote message ports for inter-process communication.
The most common use of this module is to provide support for the command line tool hs
which can be added to your terminal shell environment with hs.ipc.cliInstall. The command line tool will not work unless the hs.ipc
module is loaded first, so it is recommended that you add require("hs.ipc")
to your Hammerspoon init.lua
file (usually located at ~/.hammerspoon/init.lua) so that it is always available when Hammerspoon is running.
This module is based heavily on code from Mjolnir by Steven Degutis.
Signature | hs.ipc.cliGetColors() -> table |
---|---|
Type | Deprecated |
Description | See hs.ipc.cliColors. |
Source | extensions/ipc/ipc.lua line 112 |
Signature | hs.ipc.cliResetColors() |
---|---|
Type | Deprecated |
Description | See hs.ipc.cliColors. |
Source | extensions/ipc/ipc.lua line 136 |
Signature | hs.ipc.cliSetColors(table) -> table |
---|---|
Type | Deprecated |
Description | See hs.ipc.cliColors. |
Source | extensions/ipc/ipc.lua line 124 |
Signature | hs.ipc.cliColors([colors]) -> table |
---|---|
Type | Function |
Description | Get or set the terminal escape codes used to produce colorized output in the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/ipc.lua line 63 |
Signature | hs.ipc.cliInstall([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Installs the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/ipc.lua line 268 |
Signature | hs.ipc.cliSaveHistory([state]) -> boolean |
---|---|
Type | Function |
Description | Get or set whether or not the command line tool saves a history of the commands you type. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/ipc.lua line 148 |
Signature | hs.ipc.cliSaveHistorySize([size]) -> number |
---|---|
Type | Function |
Description | Get or set whether the maximum number of commands saved when command line tool history saving is enabled. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/ipc.lua line 171 |
Signature | hs.ipc.cliStatus([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Gets the status of the |
Parameters |
|
Returns |
|
Source | extensions/ipc/ipc.lua line 194 |
Signature | hs.ipc.cliUninstall([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Uninstalls the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/ipc.lua line 294 |
Signature | hs.ipc.localPort(name, fn) -> ipcObject |
---|---|
Type | Constructor |
Description | Create a new local ipcObject for receiving and responding to messages from a remote port |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/libipc.m line 78 |
Signature | hs.ipc.remotePort(name) -> ipcObject |
---|---|
Type | Constructor |
Description | Create a new remote ipcObject for sending messages asynchronously to a local port |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/libipc.m line 128 |
Signature | hs.ipc:delete() -> None |
---|---|
Type | Method |
Description | Deletes the ipcObject, stopping it as well if necessary |
Parameters |
|
Returns |
|
Source | extensions/ipc/libipc.m line 338 |
Signature | hs.ipc:isRemote() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ipcObject represents a remote or local port |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/ipc/libipc.m line 174 |
Signature | hs.ipc:isValid() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ipcObject port is still valid or not |
Parameters |
|
Returns |
|
Source | extensions/ipc/libipc.m line 195 |
Signature | hs.ipc:name() -> string |
---|---|
Type | Method |
Description | Returns the name the ipcObject uses for its port when active |
Parameters |
|
Returns |
|
Source | extensions/ipc/libipc.m line 156 |
Signature | hs.ipc:sendMessage(data, msgID, [waitTimeout], [oneWay]) -> status, response |
---|---|
Type | Method |
Description | Sends a message from a remote port to a local port |
Parameters |
|
Returns |
|
Source | extensions/ipc/libipc.m line 213 |