import display
import time
import nvs

display.drawFill(0)
display.drawRect(0, 0, display.width(), 60, True, 0xf68910)
display.drawRect(0, 60, display.width(), display.height() - 60 - 20, True, 0xf6ed09)
display.drawRect(0, display.height() - 20, display.width(), 20, True, 0xf68910)
display.drawPng(0, 11, "/apps/python/geraffel_badge/geraffel.png")
name = nvs.nvs_getstr("owner", "nickname")
font = "permanentmarker36"
text_width = display.getTextWidth(name, font)
text_height = display.getTextHeight(name, font)
display.drawText((display.width() - text_width) >> 1, (display.height() - text_height) >> 1, name, 0, font,)
display.flush()
