testing version of LuaBIOS and OpenOS
people were having issues getting them to work so now we promote consistency
This commit is contained in:
32
data/OpenOS/bin/resolution.lua
Normal file
32
data/OpenOS/bin/resolution.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local shell = require("shell")
|
||||
local tty = require("tty")
|
||||
|
||||
local args = shell.parse(...)
|
||||
local gpu = tty.gpu()
|
||||
|
||||
if #args == 0 then
|
||||
local w, h = gpu.getViewport()
|
||||
io.write(w," ",h,"\n")
|
||||
return
|
||||
end
|
||||
|
||||
if #args ~= 2 then
|
||||
print("Usage: resolution [<width> <height>]")
|
||||
return
|
||||
end
|
||||
|
||||
local w = tonumber(args[1])
|
||||
local h = tonumber(args[2])
|
||||
if not w or not h then
|
||||
io.stderr:write("invalid width or height\n")
|
||||
return 1
|
||||
end
|
||||
|
||||
local result, reason = gpu.setResolution(w, h)
|
||||
if not result then
|
||||
if reason then -- otherwise we didn't change anything
|
||||
io.stderr:write(reason..'\n')
|
||||
end
|
||||
return 1
|
||||
end
|
||||
tty.clear()
|
||||
Reference in New Issue
Block a user