Advertisement
Guest User

bootloader

a guest
Jun 26th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. --[ENV] lua
  2. local cobalt = dofile("cobalt")
  3. cobalt.ui = dofile("cobalt-ui/init.lua")
  4. local Panel = cobalt.ui.new({w = "50%", marginleft="25%", h="50%", margintop="25%"})
  5. local Zinc = Panel:add("radio", {wrap="center", y=5,label="ZincLinux", selected=true})
  6. local Craft = Panel:add("radio", {wrap="",y=6,label="CraftOS",marginleft="32%"})
  7. local Button = Panel:add("button", {wrap="center",y=8,w="40%"})
  8. Button.text = " Startup"
  9. Button.backColour = colors.blue
  10. Button.onclick=function()
  11.     if Zinc.selected then
  12.         shell.run("/bin/bash")
  13.     elseif Craft.selected then
  14.         term.clear()
  15.         term.setCursorPos(1,1)
  16.         shell.run("/rom/programs/shell")
  17.     end
  18. end
  19. function cobalt.draw()
  20.     cobalt.ui.draw()
  21. end
  22.  
  23. function cobalt.mousepressed(x,y,button)
  24.     cobalt.ui.mousepressed(x,y,button)
  25. end
  26. function cobalt.mousereleased(x,y,button)
  27.     cobalt.ui.mousereleased(x,y,button)
  28. end
  29.  
  30. cobalt.initLoop()
  31. --term.clear()
  32. --term.setCursorPos(1,1)
  33. --print("CCLinux Bootloader ")
  34. --print("Select OS (type number): ")
  35. --print("ZincLinux: 1")
  36. --print("CraftOS: 2")
  37. --local choice = io.read()
  38. --if tonumber(choice) == 1 then
  39. --  shell.run("/bin/bash login")
  40. --elseif tonumber(choice) == 2 then
  41. --  shell.run("/rom/programs/shell")
  42. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement