# Owner: glow # KeyID: E65A8520F36AEE13CFE4F56BEB8FE331063A4794 # Key: https://glow.li/pgp # Verify: curl "https://glow.li/posts/use-your-current-location-for-wego-in-termux/index.html.asc" | gpg -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 - --- date=2016-02-16 layout=post title="Use your current location for wego in Termux" tags[]=Technology tags[]=Termux tags[]=Snippet tags[]=Android tags[]=CLI oldurls[]=technology/2016/2/16/use-your-current-location-for-wego-in-termux/ - --- ![Screenshot](/media/images/wego_screenshot1.webp) [Wego](https://github.com/schachmat/wego) is a pretty cool weather client for the terminal. You also need [termux-api](https://play.google.com/store/apps/details?id=com.termux.api) and the `jq` package. Now you can run the following command to display the weather report for your current location. ``` loc=$(termux-location -p network)&&wego "$(echo $loc | jq .latitude),$(echo $loc | jq .longitude)" ``` ### Wego on termux For wego to work you must set the WEGORC environment variable. You probably want to do this in your shells startup script. ``` export WEGORC=$HOME/.wegorc ``` Otherwise it installs just fine if you follow the instructions. ### Wttr.in If you don't want to go through the hassle of installing wego, you can just use [wttr.in](https://wttr.in) instead. [Wttr.in](https://wttr.in) is an implementation of wego that can be called with just `curl wttr.in` to get the current weather. If you don't want to rely on IP Geo location you can also use the same script for [wttr.in](https://wttr.in) instead of wego. ``` loc=$(termux-location -p network)&&curl wttr.in/$(echo $loc | jq .latitude),$(echo $loc | jq .longitude) ``` -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5lqFIPNq7hPP5PVr64/jMQY6R5QFAmHoUI8ACgkQ64/jMQY6 R5QcYhAAiHJV46UpJlE4lojDNIwqsFkCz4TWnWczcj89gWhv0E1Rd6r81dmrbXZh 1TTWW/8Oi9At+zvC8/sgq/IC0SunYO4Er++8+OUD1NSZjuatKQ6Tue3eDpEy+GAL yb/LMWYRp42n1gZDSf8C4mO/quNEynCISmj39zwhgvHdyuq1uiCMpsIQrq1/CiaY UBgjoqRY6S2lkZ854Lp5jQlJQtICXumVm+hIW7+Bp0O+RJfUAl78YvbzANS621gE ORNW6vVEIgYKgfUoiKi5uhsaLfYrH5SV/+pVw4mWOyDvOWAv9da/YYbOm4J11f3h k27Ow+5MK5mZbEr8e5rC39JQiJphvLn8oA/+DqwLjPLJ57aoJkLWKUSqDGIkIsa5 HbtV2BVY378NaosFaFqtL+mde3DZp0j7zOS9t1M1JUVqm5GoopXjJY4WgMFMuwLC BZasczFIIyowZURuZz5eiDRqP/cSn7HJHkSbeM/OFYFphBjEvMjyZ6t2ykGepoNF gj+O5UNf5DboBltv93jliEJE+hSYXStvJAMTGJRcqWdH6MF/fJoMYMZFKPiigroc Gkq9AGHlxJy1kc+AjFH0XugP5pBouNh1FseMWoQidIcGeYHVtvuC8nEhKxIWLjas iUxoW790ZWh7By0w3YNx8pzcMMsG08H0ybkzZZjglXQdL1oZonY= =sOmE -----END PGP SIGNATURE-----