Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not term.isColor() then
- error("PC doesn't support colors.")
- end
- local bootimg = "/sys/kernel/.bootimg"
- local w,h = term.getSize()
- local tLines = {}
- a = fs.open(bootimg,"r")
- repeat
- sLine = a.readLine()
- table.insert(tLines,sLine)
- until not sLine
- a.close()
- local x = nil
- local y = nil
- local tLengths = {}
- for i=1,#tLines do
- slen = string.len(tLines[i])
- table.insert(tLengths,slen)
- table.sort(tLengths)
- end
- local xCenter = math.floor((w/2) - (tLengths[#tLengths]/2))
- local yCenter = math.floor((h/2) - (#tLengths/2))
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.gray)
- term.clear()
- term.setCursorPos(xCenter,yCenter)
- local img = paintutils.loadImage(bootimg)
- x,y = term.getCursorPos()
- paintutils.drawImage(img,xCenter,y-1)
- x,y = term.getCursorPos()
- local ostxt1 = "Debian 1.0 Raspbian"
- local ostxt2 = "v.2018 CC Edition"
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(math.floor((w/2) - (string.len(ostxt1)/2)), y+2)
- write(ostxt1)
- x,y = term.getCursorPos()
- term.setCursorPos(math.floor((w/2) - (string.len(ostxt2)/2)), y+1)
- write(ostxt2)
- x,y = term.getCursorPos()
- term.setCursorPos(1,y+1)
- sleep(3)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1, 1)
- shell.run("/sys/kernel/apiload")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement