aawwaaa

99_gpu.lua

Aug 10th, 2025
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. local serialization = require("serialization")
  2. local component = require("component")
  3.  
  4. local function load_config()
  5. local file = io.open("/etc/sc", "r")
  6. if not file then
  7. return {}
  8. end
  9. local config = serialization.unserialize(file:read("*all"))
  10. file:close()
  11. return config
  12. end
  13.  
  14. local config = load_config()
  15.  
  16. if not config.primary then
  17. return
  18. end
  19.  
  20. local gpu = component.gpu
  21.  
  22. gpu.bind(config.primary, false)
  23. gpu.setResolution(gpu.maxResolution())
  24. require("tty").clear()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment