-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstartup
94 lines (63 loc) · 1.73 KB
/
startup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
os.pullEvent = os.pullEventRaw
--ik this isn't needed, but I hate putting the desktop env in startup.
deltaOS = true
--for programs who would like to know that is deltaOS or not installed
version = "LYNX-1.4"
os.loadAPI("/apis/delta")
os.loadAPI("/apis/kernel")
os.loadAPI("/apis/graphics")
if OneOS then
OneOS.RequestRunAtStartup()
end
if OneOS then
OneOS.CanClose = function()
if modified then
return false
else
return true
end
end
end
local function loadDeltaOS()
os.loadAPI("/apis/users")
local tApis = fs.list( "/apis" )
for k, v in pairs( tApis ) do
if not fs.isDir(v) then
os.loadAPI("/apis/"..v)
end
end
if fs.exists("/system/.setup_trigger") then
shell.run("/ft-setup.lua")
fs.delete("system/.setup_trigger")
end
graphics.reset(colors.lightBlue, colors.black)
graphics.drawLine(1, colors.lightGray)
graphics.drawLine(kernel.y, colors.lightGray)
term.setBackgroundColor(colors.lightBlue)
term.setCursorPos(1, 2)
graphics.cPrint("DeltaOS")
graphics.drawImage("/system/logo.nfp", kernel.x/2-11/2, 4)
term.setBackgroundColor(colors.lightBlue)
--[[
local data = http.get("https://raw.githubusercontent.com/FlareHAX0R/deltaOS/master/version")
if data:readAll() ~= version then
term.setCursorPos(1, kernel.y/2+1)
graphics.cPrint("Updating...")
sleep(0.5)
shell.run("/system/update")
os.reboot()
end
]]--
if storage.totalKB() <= 10 then
term.setCursorPos(1, kernel.y/2+1)
term.clearLine()
graphics.cPrint(":( We detected that you are low on storage space.")
graphics.cPrint("You have "..tostring(storage.totalKB()).." KB left.")
end
sleep(1.5)
shell.run("/system/desktop.lua")
end
local err = kernel.catnip(loadDeltaOS)
if err ~= "noErr" then
delta.bsod(err)
end