#!/usr/bin/lua
local s6 = require("s6lua")

-- Loads the console font from /etc/vconsole.conf's FONT= line.
local f = io.open("/etc/vconsole.conf", "r")
if not f then
	os.exit(0)
end
for line in f:lines() do
	local font = line:match('^FONT=(.+)$')
	if font then
		font = font:gsub('^"(.*)"$', "%1")
		s6.run(string.format("setfont %q", font))
	end
end
f:close()
