LukeSmithxyz / voidrice

My dotfiles (deployed by LARBS)
GNU General Public License v3.0
4.29k stars 1.21k forks source link

dwmblocks hangs on sb-forecast/sb-moonphase #1295

Open ssnailed opened 1 year ago

ssnailed commented 1 year ago

Currently when dwmblocks starts, it will hang on sb-forecast/sb-moonphase if wttr.in is slow to respond. The easy solution to this is to just introduce a timeout by using the -m or --connect-timeout flags for curl. Alternatively, you could have sb-forecast immediately return but have it start a background process to fetch the weather. This sub-process would then have to send a signal to dwmblocks once the weather is fetched. This would considerably improve the start time of dwmblocks for people with chronically slow internet connections and would prevent dwmblocks from hanging on startup.

Is this a change that would make sense? I would be happy to contribute this if this is something you are interested in.

LukeSmithxyz commented 1 year ago

If you can implement the backgrounding elegantly, I think that would be a good idea. I've started to add -m to a lot of these curl-based modules for that reason, but yes, that would be a more principled solution.

appeasementPolitik commented 1 year ago

Hey, I'm currently working on adding this as this is also a feature I would like to see. So far I'm having good results so I'll make a pull request in a little while

ssnailed commented 1 year ago

Perfect, I haven't had any time to work on it yet