new weather script alltogether
This commit is contained in:
parent
8fad648a6e
commit
da5ddaa09d
@ -159,7 +159,7 @@
|
|||||||
// to use the weather module replace <your_location> with your city or town
|
// to use the weather module replace <your_location> with your city or town
|
||||||
// note: do not use spaces: new york would be newyork
|
// note: do not use spaces: new york would be newyork
|
||||||
"custom/weather": {
|
"custom/weather": {
|
||||||
"exec": "~/.config/waybar/scripts/weather.sh Euskirchen",
|
"exec": "~/.config/waybar/scripts/weather.py Euskirchen",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"interval": 600,
|
"interval": 600,
|
||||||
},
|
},
|
||||||
|
9
scripts/weather.py
Executable file
9
scripts/weather.py
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/python3
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import sys
|
||||||
|
|
||||||
|
req = requests.get(f'https://wttr.in/{sys.argv[1]}?format="%t:%c:%C"').text[1:-1].split(':')
|
||||||
|
|
||||||
|
print('{' + f'"text": "{req[0]} {req[1]}", "tooltip": "", "class": "{req[2]}"' + '}')
|
||||||
|
|
1
scripts/weather_new.sh
Normal file
1
scripts/weather_new.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/bash
|
Loading…
x
Reference in New Issue
Block a user