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. |
Signature | hs.ipc.cliResetColors() |
---|---|
Type | Deprecated |
Description | See hs.ipc.cliColors. |
Signature | hs.ipc.cliSetColors(table) -> table |
---|---|
Type | Deprecated |
Description | See hs.ipc.cliColors. |
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:
|
Signature | hs.ipc.cliInstall([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Installs the Parameters:
Returns:
Notes:
|
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:
|
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:
|
Signature | hs.ipc.cliStatus([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Gets the status of the Parameters:
Returns:
|
Signature | hs.ipc.cliUninstall([path][,silent]) -> bool |
---|---|
Type | Function |
Description | Uninstalls the Parameters:
Returns:
Notes:
|
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:
|
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:
|
Signature | hs.ipc:delete() -> None |
---|---|
Type | Method |
Description | Deletes the ipcObject, stopping it as well if necessary Parameters:
Returns:
|
Signature | hs.ipc:isRemote() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ipcObject represents a remote or local port Parameters:
Returns:
Notes:
|
Signature | hs.ipc:isValid() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ipcObject port is still valid or not Parameters:
Returns:
|
Signature | hs.ipc:name() -> string |
---|---|
Type | Method |
Description | Returns the name the ipcObject uses for its port when active Parameters:
Returns:
|
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:
|