From ac6410af1a8f6393b62f45195ba0376d8b34c27a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 22 Oct 2021 07:21:11 +0200 Subject: [PATCH] polybar-weather: use country if city is unavailable --- bin/polybar-weather | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/polybar-weather b/bin/polybar-weather index 2f0932b..fd36777 100755 --- a/bin/polybar-weather +++ b/bin/polybar-weather @@ -29,7 +29,9 @@ def get_location(): ) return ( (data["location"]["latitude"], data["location"]["longitude"]), - data["city"]["names"]["en"], + data["city"]["names"]["en"] + if "city" in data + else data["country"]["names"]["en"], )