From 8cd105b84c723e99b61c7367f8cde1778481c314 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Sun, 28 Jan 2024 16:46:57 +0100 Subject: [PATCH] start termianl if not advanced computer --- src/Startup.hx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Startup.hx b/src/Startup.hx index 19a8e35..1f4d15f 100644 --- a/src/Startup.hx +++ b/src/Startup.hx @@ -1,9 +1,20 @@ +import kernel.ui.WindowManager; +import kernel.ps.ProcessManager; +import kernel.binstore.BinStore; +import kernel.MainTerm; import lib.HomeContext; class Startup { public static function main() { - var main = new HomeContext(); + if (MainTerm.instance.isColor()) { + var main = new HomeContext(); - main.run(); + main.run(); + } else { + var term = BinStore.instantiate("terminal"); + var pid = ProcessManager.run(term, {}); + var ctx = WindowManager.getContextByPID(pid); + WindowManager.focusContextToOutput(ctx[0], "main"); + } } }