Browse Source

update on weather scripts

pull/10/head
JaKooLit 2 years ago
parent
commit
5bf27a9e51
  1. 4
      config/hypr/scripts/Weather.py
  2. 2
      config/hypr/scripts/Weather.sh

4
config/hypr/scripts/Weather.py

@ -2,7 +2,7 @@
# From https://raw.githubusercontent.com/rxyhn/dotfiles/main/home/rxyhn/modules/desktop/waybar/scripts/waybar-wttr.py # From https://raw.githubusercontent.com/rxyhn/dotfiles/main/home/rxyhn/modules/desktop/waybar/scripts/waybar-wttr.py
## ensure to insert city inside "" ## ensure to insert city inside ""
city = "Busan" city = " "
import json import json
import requests import requests
from datetime import datetime from datetime import datetime
@ -61,7 +61,7 @@ WEATHER_CODES = {
data = {} data = {}
weather = requests.get("https://wttr.in/{city}?format=j1").json() weather = requests.get(f"https://wttr.in/{city}?format=j1").json()
def format_time(time): def format_time(time):

2
config/hypr/scripts/Weather.sh

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
city=Busan city=
cachedir=~/.cache/rbn cachedir=~/.cache/rbn
cachefile=${0##*/}-$1 cachefile=${0##*/}-$1

Loading…
Cancel
Save