add time indication
This commit is contained in:
parent
5f4d1f24d4
commit
f70364619b
3 changed files with 10 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,4 +1,6 @@
|
||||||
.venv/
|
.venv/
|
||||||
*.png
|
*.png
|
||||||
*.bpm
|
|
||||||
*.json
|
*.json
|
||||||
|
typst
|
||||||
|
*.bmp
|
||||||
|
*.pdf
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ margin: ("x":0cm,"y":0cm)
|
||||||
)
|
)
|
||||||
#let today = datetime.today()
|
#let today = datetime.today()
|
||||||
#let weather = json("weather.json")
|
#let weather = json("weather.json")
|
||||||
|
#let timestamp_data = weather.timestamp.split(" ")
|
||||||
|
//#let time = datetime(hour: int(date_data.at(3)), minute: int(date_data.at(4)), second:0)
|
||||||
|
#let current_hour = int(timestamp_data.at(3))
|
||||||
#let icons_map = (
|
#let icons_map = (
|
||||||
"0": "icons/clear_day.svg",
|
"0": "icons/clear_day.svg",
|
||||||
"1": "icons/clear_day.svg",
|
"1": "icons/clear_day.svg",
|
||||||
|
|
@ -65,7 +68,8 @@ margin: ("x":0cm,"y":0cm)
|
||||||
|
|
||||||
#grid(
|
#grid(
|
||||||
columns: (1fr,2fr,2fr),
|
columns: (1fr,2fr,2fr),
|
||||||
align: (right,center,center),
|
align: (horizon+right,horizon+center,horizon+center),
|
||||||
|
stroke: (x,y) => if int(times.at(y*2+8)) == current_hour or int(times.at(y*2+9)) == current_hour{(y:black)},
|
||||||
..values.flatten().map(x => text(size:1.7em)[#x])
|
..values.flatten().map(x => text(size:1.7em)[#x])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Get weather data..."
|
echo "Get weather data..."
|
||||||
wget -O weather.json "https://api.open-meteo.com/v1/forecast?latitude=43.4516&longitude=-80.4925&hourly=temperature_2m,weather_code&start_date=2025-08-23&end_date=2025-08-23&timezone=America/Toronto"
|
wget -O tmpweather.json "https://api.open-meteo.com/v1/forecast?latitude=43.4516&longitude=-80.4925&hourly=temperature_2m,weather_code&start_date=2025-08-23&end_date=2025-08-23&timezone=America/Toronto"
|
||||||
|
jq --arg timestamp "$(date '+%Y %m %d %H %M %S')" '. + {"timestamp": $timestamp}' tmpweather.json > weather.json
|
||||||
echo "Generate document..."
|
echo "Generate document..."
|
||||||
./typst compile --format png document.typ
|
./typst compile --format png document.typ
|
||||||
echo "Convert to image..."
|
echo "Convert to image..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue