From 27bd71f9e4b67be71b77d036c5e3e5426692a0bb Mon Sep 17 00:00:00 2001 From: 20kdc Date: Fri, 9 Nov 2018 23:19:27 +0000 Subject: [PATCH] (Probably) fix sys-init self-destructing if no monitors around --- claw/code-claw.lua | 2 +- code/apps/sys-init.lua | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/claw/code-claw.lua b/claw/code-claw.lua index c3c3baa..dc3d133 100644 --- a/claw/code-claw.lua +++ b/claw/code-claw.lua @@ -26,7 +26,7 @@ return { }, ["neo-init"] = { desc = "KittenOS NEO / sys-init (startup)", - v = 6, + v = 7, deps = { "neo", "neo-icecap", diff --git a/code/apps/sys-init.lua b/code/apps/sys-init.lua index 6a2984d..1ef6fea 100644 --- a/code/apps/sys-init.lua +++ b/code/apps/sys-init.lua @@ -65,6 +65,17 @@ local function basicDraw(bg) return gpu end +local function consoleEventHandler(ev) + if ev[1] == "h._kosneo_syslog" then + local text = "" + for i = 3, #ev do + if i ~= 3 then text = text .. " " end + text = text .. tostring(ev[i]) + end + table.insert(console, text) + end +end + -- Attempts to get an NSS monitor with a priority list of screens local function retrieveNssMonitor(...) local spc = {...} @@ -133,17 +144,6 @@ local function retrieveNssMonitor(...) end end -local function consoleEventHandler(ev) - if ev[1] == "h._kosneo_syslog" then - local text = "" - for i = 3, #ev do - if i ~= 3 then text = text .. " " end - text = text .. tostring(ev[i]) - end - table.insert(console, text) - end -end - local function sleep(t) neo.scheduleTimer(os.uptime() + t) while true do