# 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", "oldurls": [ "technology/2016/2/16/use-your-current-location-for-wego-in-termux/" ], "tags": ["Technology", "Termux", "Snippet", "Android", "CLI"], "title": "Use your current location for wego in Termux" } +++ ![Screenshot](media/images/wego-screenshot1) [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/jMQY6R5QFAmRuqGYACgkQ64/jMQY6 R5StJw/+PXQePQoRo4qzd36TnJda77IThcY/q/EqGrHulHl2FmlJqq6a7I9hgiqG 95YtVF9vIVV+fd3rAHDMKwOla8bjZh8BsuAIuqqP2a71+259kw0QRVhMJFaltCo5 h2z1QhtjjDV2vmoyNAyD8jCeQOtCotdr77Fn6I/qZ2+OTQJ/k2siuEpEvsF9PHzz wQ5o9S2KruTTP4npOB4Cm2dabuv+qz+BKXEedzsjfownpWpl/1H9lHUE0W5Vu2y/ BpaBYwzXDwZMgKEA1regkftveop+BN1ILipAfEIXJo3uL2PS/MTE2W/dFuZDSJPm 9idIj9IG8ESRtx+2J4OPRrymIpyIDC90xlM4kGGhSOujNEyApAhMM5GM7BTADofp wGZX8wctJpibtzK7ZsEzOIkQ+thrpivt/vq+EoP+WlPg9w2CdUcqgTGRS/5saXPE 2gm6P8z+Hi27gaFWqbpslgGGhCntLrTsdPLOeulaSf8UUSzTCm45bksiCj/rudO2 UnVfWuRuyRSoYVrjfnnxbxAZPhhe4Yjo8jSmMJxDV/37b5hAhObUCvNQa5V2fmpG fjFtHxm524E/zeYJ0eMMS80vdaVFhCSr2+86wL9XBnlw5IBw8bNuL5NkR0+jllW2 r/QguFTIw2vAzt6Gh4QeOjtrEEQnMJIX3dXkymOVZKsIAT59Fv8= =8sBg -----END PGP SIGNATURE-----