|
|
@@ -91,8 +91,9 @@ if hostname == "home" then |
|
|
|
weather(cr, screenWidth / 2 - 11.5*.6*15, screenHeight / 2 - 60) |
|
|
|
else |
|
|
|
clock(cr, screenWidth - 260, 170) |
|
|
|
calendar(cr, screenWidth - 480, 475) |
|
|
|
weather(cr, screenWidth - 420, 290) |
|
|
|
calendar(cr, screenWidth - 475, 440) |
|
|
|
agenda(cr, screenWidth - 480, 620) |
|
|
|
end |
|
|
|
|
|
|
|
cairo_destroy(cr) |
|
|
@@ -105,6 +106,25 @@ function clock(cr, x, y) |
|
|
|
end |
|
|
|
|
|
|
|
function calendar(cr, x, y) |
|
|
|
size = 18 |
|
|
|
yt = 0 |
|
|
|
for line in io.lines("/tmp/cal.txt") do |
|
|
|
yt = yt + size |
|
|
|
xt = 0 |
|
|
|
for substr in string.gmatch(line, "[^]+") do |
|
|
|
if substr:match("%[7m") then |
|
|
|
color = {.45, .65, .9, 1} |
|
|
|
else |
|
|
|
color = nil |
|
|
|
end |
|
|
|
substr = substr:gsub("%[.?7m", "") |
|
|
|
emboss(cr, x + xt, y + yt, substr, 0, size, nil, color, "Fira Code") |
|
|
|
xt = xt + .6*size * utf8.len(substr) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function agenda(cr, x, y) |
|
|
|
size = 14 |
|
|
|
yt = 0 |
|
|
|
for line in io.lines("/tmp/agenda_export.txt") do |
|
|
|