mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 16:51:34 +02:00
Clean dotfiles
This commit is contained in:
parent
5c2b55f13c
commit
197750ffa3
32 changed files with 123 additions and 579 deletions
15
config/bspwm/polybar/scripts/weather.py
Executable file
15
config/bspwm/polybar/scripts/weather.py
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
"""For working this script set in ~/.profile 2 variable:
|
||||
OWM_POLYBAR: API key
|
||||
OWM_CITY: Your city
|
||||
"""
|
||||
import requests, os
|
||||
|
||||
|
||||
API_KEY = os.getenv("OWM_POLYBAR")
|
||||
CITY = os.getenv("OWM_CITY")
|
||||
|
||||
try:
|
||||
JSON = requests.get(f"http://api.openweathermap.org/data/2.5/weather?q={CITY}&lang=EN&&units=metric&appid={API_KEY}").json()
|
||||
print("", int(JSON["main"]["temp"]), "°С")
|
||||
except Exception:
|
||||
print(" err °С")
|
||||
Loading…
Add table
Add a link
Reference in a new issue