mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-29 20:34:46 +01:00
Add minor docs
This commit is contained in:
parent
8400f7dd5f
commit
9f09a8c7a1
3 changed files with 12 additions and 3 deletions
|
@ -99,6 +99,7 @@ function client.get_window(identifier)
|
|||
local response = ReadMsg()
|
||||
|
||||
local props = response.RequestResponse.response.Window.window
|
||||
|
||||
---@type Window
|
||||
local win = {
|
||||
id = props.id,
|
||||
|
|
|
@ -11,8 +11,8 @@ pcall(require, "luarocks.loader")
|
|||
|
||||
-- Neovim users be like:
|
||||
require("pinnacle").setup(function(pinnacle)
|
||||
local input = pinnacle.input --Key and mouse binds
|
||||
local client = pinnacle.client --Window management
|
||||
local input = pinnacle.input -- Key and mouse binds
|
||||
local client = pinnacle.client -- Window management
|
||||
local process = pinnacle.process -- Process spawning
|
||||
|
||||
-- Every key supported by xkbcommon.
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
--
|
||||
-- SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
---@diagnostic disable: redefined-local
|
||||
|
||||
local process = {}
|
||||
|
||||
---Spawn a process with an optional callback for its stdout and stderr.
|
||||
---
|
||||
---`callback` has the following parameters:
|
||||
--- - `stdout`: The process's stdout printed this line.
|
||||
--- - `stderr`: The process's stderr printed this line.
|
||||
--- - `exit_code`: The process exited with this code.
|
||||
--- - `exit_msg`: The process exited with this message.
|
||||
---@param command string|string[] The command as one whole string or a table of each of its arguments
|
||||
---@param callback fun(stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string?)? A callback to do something whenever the process's stdout or stderr print a line. Only one will be non-nil at a time.
|
||||
---@param callback fun(stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string?)? A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
|
||||
function process.spawn(command, callback)
|
||||
---@type integer|nil
|
||||
local callback_id = nil
|
||||
|
|
Loading…
Add table
Reference in a new issue