1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-15 05:04:50 +00:00
opus/sys/boot/kiosk.boot

34 lines
746 B
Plaintext
Raw Normal View History

2019-01-09 13:50:42 +00:00
local os = _G.os
local parallel = _G.parallel
local peripheral = _G.peripheral
2019-01-10 07:22:06 +00:00
local settings = _G.settings
2019-01-09 13:50:42 +00:00
local term = _G.term
2019-01-18 13:48:30 +00:00
local preferred = settings.get('kiosk.monitor')
local mon = preferred and peripheral.wrap(preferred) or
peripheral.find('monitor')
2019-01-09 13:50:42 +00:00
if mon then
term.redirect(mon)
2019-01-11 15:01:06 +00:00
mon.setTextScale(tonumber(settings.get('kiosk.textscale')) or 1)
2019-01-09 13:50:42 +00:00
parallel.waitForAny(
function()
os.run(_ENV, '/sys/boot/opus.boot')
end,
function()
while true do
local event, _, x, y = os.pullEventRaw('monitor_touch')
if event == 'monitor_touch' then
os.queueEvent('mouse_click', 1, x, y)
os.queueEvent('mouse_up', 1, x, y)
end
end
end
)
else
os.run(_ENV, '/sys/boot/opus.boot')
end