diff options
| author | Kiran George <kirangeorge1995@gmail.com> | 2024-05-06 22:12:49 +0530 |
|---|---|---|
| committer | Kiran George <kirangeorge1995@gmail.com> | 2024-05-06 22:12:49 +0530 |
| commit | 083bbd3625d2818a87469bf553ec5309e36b4180 (patch) | |
| tree | c0c4c81bc813707cd5452cabcd894e68d4ffee63 /config/hypr/UserScripts/Weather.py | |
| parent | 0c76bebdd4227a11f8045a62fbdc6fea30d4e8a0 (diff) | |
Hyprlock weather delay fix
Diffstat (limited to 'config/hypr/UserScripts/Weather.py')
| -rwxr-xr-x | config/hypr/UserScripts/Weather.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 14c9cfe0..046dbcd3 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -3,7 +3,7 @@ import subprocess from pyquery import PyQuery # install using `pip install pyquery` import json - +import os # original code https://gist.github.com/Surendrajat/ff3876fd2166dd86fb71180f4e9342d7 # weather icons @@ -122,3 +122,15 @@ out_data = { "class": status_code, } print(json.dumps(out_data)) + +simple_weather =f"{icon} {status}\n" + \ + f" {temp} ({temp_feel_text})\n" + \ + f"{wind_text}\n" + \ + f"{humidity_text}\n" + \ + f"{visbility_text} AQI {air_quality_index}\n" + +try: + with open(os.path.expanduser("~/.cache/.weather_cache"), "w") as file: + file.write(simple_weather) +except: + pass
\ No newline at end of file |
