Add process manager

This commit is contained in:
2025-11-23 18:52:51 +01:00
parent 6f303bf656
commit 1775af99b0
19 changed files with 428 additions and 23 deletions

View File

@@ -1 +1 @@
__oskrnl.console_log(__oskrnl.app_args);
__oskrnl.console_log(__oskrnl.app_proc_getArgs(__oskrnl_procd_pid));

View File

@@ -1,14 +1,13 @@
__oskrnl.console_log("> ");
var input = "";
var inputActive = true;
var pid = "";
__oskrnl.input_onKeyPress(function (key) {
if (!inputActive) return;
__oskrnl.input_onKeyPress(__oskrnl_procd_pid, function (key) {
if (pid != "" && __oskrnl.app_proc_running(pid)) return;
if (key == "Backspace") input = input.slice(0, -1);
else if (key == "Enter") {
inputActive = false;
process();
return;
} else input += key.toLowerCase();
@@ -19,5 +18,14 @@ __oskrnl.input_onKeyPress(function (key) {
function process() {
var app = input.split(" ")[0];
var args = input.split(" ").slice(1);
__oskrnl.app_launcher_run(app, args.join(" "));
pid = __oskrnl.app_launcher_run(app, args.join(" "));
__oskrnl.app_proc_addExitListener(pid, function () {
input = "";
__oskrnl.console_log("> ");
});
if (!__oskrnl.app_proc_running(pid)) {
input = "";
__oskrnl.console_log("> ");
}
}

View File

@@ -0,0 +1,6 @@
__oskrnl.input_onKeyPress(__oskrnl_procd_pid, function (key) {
if (key == __oskrnl.app_proc_getArgs(__oskrnl_procd_pid)[0].toUpperCase()) {
__oskrnl.app_proc_exit(__oskrnl_procd_pid);
return;
}
});

View File

@@ -0,0 +1,5 @@
{
"app:name": "wfkey",
"app:version": "1.0.0",
"app:entrypoint": "index.js"
}