quickshell-web/modules_old/Quickshell.Io/Process.json

173 lines
7.9 KiB
JSON
Raw Normal View History

2024-09-27 23:35:19 +00:00
{
"name": "Process",
"module": "Quickshell.Io",
"type": "class",
"super": {
"type": "qt",
"module": "qml.QtQml",
"name": "QtObject"
},
"description": "Child process.",
"details": "#### Example\n```qml\nQS_Quickshell00Io_Process {\n running: true\n command: [ \"some-command\", \"arg\" ]\n stdout: QS_Quickshell00Io_SplitParser {\n onRead: data => console.log(`line read: ${data}`)\n }\n}\n```\n",
"properties": {
"running": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the process is currently running. Defaults to false.\n\nSetting this property to true will start the process if command has at least\none element.\nSetting it to false will send SIGTERM. To immediately kill the process,\nuse {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"signal\" >}} with SIGKILL. The process will be killed when\nquickshell dies.\n\nIf you want to run the process in a loop, use the onRunningChanged signal handler\nto restart the process.\n```qml\nQS_Quickshell00Io_Process {\n running: true\n onRunningChanged: if (!running) running = true\n}\n```\n"
},
"workingDirectory": {
"type": {
"type": "qt",
"module": "qml",
"name": "string"
},
"details": "The working directory of the process. Defaults to [quickshell's working directory].\n\nIf the process is already running changing this property will affect the next\nstarted process. If the property has been changed after starting a process it will\nreturn the new value, not the one for the currently running process.\n\n[quickshell's working directory]: ../../quickshell/quickshell#prop.workingDirectory\n"
},
"manageLifetime": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the process should be killed when the Process object is destroyed or quickshell exits.\nDefaults to true.\n\nThis property may be changed while the process is running and will affect it.\n\n{{< callout type=\"warning\" >}}\n If set to false the process will still be killed if the quickshell config reloads.\nIt will not be killed if quickshell exits normally or crashes.\n\n{{< /callout >}}"
},
"stderr": {
"type": {
"type": "local",
"module": "Quickshell.Io",
"name": "DataStreamParser"
},
"details": "The parser for stderr. If the parser is null the process's stdout channel will be closed\nand no further data will be read, even if a new parser is attached.\n"
},
"stdout": {
"type": {
"type": "local",
"module": "Quickshell.Io",
"name": "DataStreamParser"
},
"details": "The parser for stdout. If the parser is null the process's stdout channel will be closed\nand no further data will be read, even if a new parser is attached.\n"
},
"command": {
"type": {
"type": "qt",
"module": "qml",
"name": "list",
"of": {
"type": "qt",
"module": "qml",
"name": "string"
}
},
"details": "The command to execute. Each argument is its own string, which means you don't have\nto deal with quoting anything.\n\nIf the process is already running changing this property will affect the next\nstarted process. If the property has been changed after starting a process it will\nreturn the new value, not the one for the currently running process.\n\n{{< callout type=\"info\" >}}\n You can use `[\"sh\", \"-c\", <your command>]` to execute your command with\nthe system shell.\n\n{{< /callout >}}"
},
"environment": {
"type": {
"type": "unknown",
"module": "",
"name": ""
},
"details": "Environment of the executed process.\n\nThis is a javascript object (json). Environment variables can be added by setting\nthem to a string and removed by setting them to null (except when {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"clearEnvironment\" >}} is true,\nin which case this behavior is inverted, see {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"clearEnvironment\" >}} for details).\n\n\n```qml\nenvironment: ({\n ADDED: \"value\",\n REMOVED: null,\n \"i'm different\": \"value\",\n})\n```\n\n{{< callout type=\"info\" >}}\n You need to wrap the returned object in () otherwise it won't parse due to javascript ambiguity.\n{{< /callout >}}\n\nIf the process is already running changing this property will affect the next\nstarted process. If the property has been changed after starting a process it will\nreturn the new value, not the one for the currently running process.\n"
},
"clearEnvironment": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the process's environment should be cleared prior to applying {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"environment\" >}}.\nDefaults to false.\n\nIf true, all environment variables will be removed before the {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"environment\" >}}\nobject is applied, meaning the variables listed will be the only ones visible to the process.\nThis changes the behavior of `null` to pass in the system value of the variable if present instead\nof removing it.\n\n```qml\nclearEnvironment: true\nenvironment: ({\n ADDED: \"value\",\n PASSED_FROM_SYSTEM: null,\n})\n```\n\nIf the process is already running changing this property will affect the next\nstarted process. If the property has been changed after starting a process it will\nreturn the new value, not the one for the currently running process.\n"
},
"stdinEnabled": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If stdin is enabled. Defaults to false. If this property is false the process's stdin channel\nwill be closed and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"write\" >}} will do nothing, even if set back to true.\n"
},
"processId": {
"type": {
"type": "qt",
"module": "qml",
"name": "variant"
},
"details": "The process ID of the running process or `null` if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"running\" >}} is false.\n",
"flags": ["readonly"]
}
},
"functions": [
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "signal",
"id": "signal",
"details": "Sends a signal to the process if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"running\" >}} is true, otherwise does nothing.\n",
"params": [
{
"name": "signal",
"type": {
"type": "qt",
"module": "qml",
"name": "int"
}
}
]
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "write",
"id": "write",
"details": "Writes to the process's stdin. Does nothing if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"running\" >}} is false.\n",
"params": [
{
"name": "data",
"type": {
"type": "qt",
"module": "qml",
"name": "string"
}
}
]
}
],
"signals": {
"exited": {
"name": "exited",
"details": null,
"params": [
{
"name": "exitCode",
"type": {
"type": "qt",
"module": "qml",
"name": "int"
}
},
{
"name": "exitStatus",
"type": {
"type": "unknown",
"module": "",
"name": ""
}
}
]
},
"started": {
"name": "started",
"details": null,
"params": []
}
},
"variants": {}
}