diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-05-09 00:35:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-09 00:35:23 +0900 |
| commit | 472661662b29ec932f017e44a36a63b0dc61ac38 (patch) | |
| tree | 2217d9d7a5168d2eb367f0b486c6a3238b769b24 /config/hypr/UserScripts | |
| parent | 8e9b6f015038ae76ce68035d6aee7ff88a5be06c (diff) | |
| parent | 25cbdc6a01177a5da063458438cc9ea10271ec9f (diff) | |
Merge pull request #247 from JaKooLit/development
Development to Main
Diffstat (limited to 'config/hypr/UserScripts')
| -rwxr-xr-x | config/hypr/UserScripts/Weather.py | 14 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/Weather.sh | 4 |
2 files changed, 17 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 diff --git a/config/hypr/UserScripts/Weather.sh b/config/hypr/UserScripts/Weather.sh index 40048710..f916b028 100755 --- a/config/hypr/UserScripts/Weather.sh +++ b/config/hypr/UserScripts/Weather.sh @@ -78,3 +78,7 @@ esac #echo $temp $condition echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}" + +cached_weather=" $temperature \n$condition ${weather[1]}" + +echo -e $cached_weather > ~/.cache/.weather_cache
\ No newline at end of file |
