diff --git a/Nunito-Bold.ttf b/Nunito-Bold.ttf new file mode 100644 index 0000000..886134d Binary files /dev/null and b/Nunito-Bold.ttf differ diff --git a/README.md b/README.md index 2888bf5..71d4ab4 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,7 @@ python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` + +## Todo + +- [ ] Accurate temp diff --git a/building.py b/building.py index 18ce395..16342a1 100644 --- a/building.py +++ b/building.py @@ -14,7 +14,7 @@ white = "#ffffff" fontSymbols = ImageFont.truetype("SymbolsNerdFont-Regular.ttf", 18) -fontTitle = ImageFont.truetype("Nunito-SemiBold.ttf", 24) +fontTitle = ImageFont.truetype("Nunito-Bold.ttf", 24) fontLarge = ImageFont.truetype("Nunito-ExtraLight.ttf", 18) fontLargeBold = ImageFont.truetype("Nunito-SemiBold.ttf", 18) fontSmall = ImageFont.truetype("Nunito-ExtraLight.ttf", 16) @@ -56,31 +56,40 @@ def draw_image(): draw = ImageDraw.Draw(image) # Draw the top bar + topbar = 26 draw.rectangle((0, 0, 400, 300), fill=white) - draw.rectangle((0, 0, 400, 30), fill=black) + draw.rectangle((0, 0, 400, topbar), fill=black) # Add the clock timeStr = strftime("%H:%M", time.localtime()) - draw.text((10, 5), timeStr, white, fontSmall) + draw.text((10, 3), timeStr, white, fontSmall) - # Add indoor tempriture - draw.text((350, 5), "19c", white, fontSmall) + # Add indoor temperature + draw.text((350, 3), "19c", white, fontSmall) # Add sections ep = 3 + margin = 5 draw.rounded_rectangle( - (ep, 30 + ep, (400 / 2) - ep, 300 - ep), 10, outline=black, width=2 + (margin, topbar + margin, (400 / 2) - margin, 300 - margin), + 10, + outline=black, + width=2, ) draw.rounded_rectangle( - ((400 / 2) + ep, 30 + ep, 400 - ep, 300 - ep), 10, outline=black, width=2 + ((400 / 2) + margin, topbar + margin, 400 - margin, 300 - margin), + 10, + outline=black, + width=2, ) # Add tasks - draw.text((15, 40), "Tasks", black, fontTitle) + draw.text((20, topbar + 7), "Tasks", black, fontTitle) + draw.line((margin, 62, 200 - margin, 62), fill=black, width=1) tasks = get_todo_items() - taskStart = 80 + taskStart = 70 for task in tasks: if task["status"] == "completed": continue @@ -96,7 +105,8 @@ def draw_image(): taskStart += titleSizeH + (2 * ep) # Add cal - draw.text((215, 40), "Calendar", black, fontTitle) + draw.text((220, topbar + 7), "Calendar", black, fontTitle) + draw.line(((400 / 2) + margin, 62, 400 - margin, 62), fill=black, width=1) events = get_calendar_events() def get_start_date(x): @@ -114,7 +124,7 @@ def draw_image(): else: return startDate - itemStart = 80 + itemStart = 70 try: for key, group in groupby(events, get_start_date): if key == datetime.today().date():