forked from Shinonome/dots-hyprland
#301 but for auto detected city name also
This commit is contained in:
@@ -154,7 +154,7 @@ const BatteryModule = () => Stack({
|
|||||||
],
|
],
|
||||||
setup: (self) => self.poll(900000, async (self) => {
|
setup: (self) => self.poll(900000, async (self) => {
|
||||||
const WEATHER_CACHE_PATH = WEATHER_CACHE_FOLDER + '/wttr.in.txt';
|
const WEATHER_CACHE_PATH = WEATHER_CACHE_FOLDER + '/wttr.in.txt';
|
||||||
const updateWeatherForCity = (city) => execAsync(`curl https://wttr.in/${city}?format=j1`)
|
const updateWeatherForCity = (city) => execAsync(`curl https://wttr.in/${city.replace(/ /g, '%20')}?format=j1`)
|
||||||
.then(output => {
|
.then(output => {
|
||||||
const weather = JSON.parse(output);
|
const weather = JSON.parse(output);
|
||||||
Utils.writeFile(JSON.stringify(weather), WEATHER_CACHE_PATH)
|
Utils.writeFile(JSON.stringify(weather), WEATHER_CACHE_PATH)
|
||||||
|
|||||||
Reference in New Issue
Block a user