mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-20 10:57:19 +02:00
polybar-weather: use country if city is unavailable
This commit is contained in:
parent
385360b516
commit
ac6410af1a
1 changed files with 3 additions and 1 deletions
|
@ -29,7 +29,9 @@ def get_location():
|
||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
(data["location"]["latitude"], data["location"]["longitude"]),
|
(data["location"]["latitude"], data["location"]["longitude"]),
|
||||||
data["city"]["names"]["en"],
|
data["city"]["names"]["en"]
|
||||||
|
if "city" in data
|
||||||
|
else data["country"]["names"]["en"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue