You are not logged in.

#1 2019-02-22 17:28:53

damo
....moderator....
Registered: 2015-08-20
Posts: 5,271

How to format wttr.in output for conky?

I am trying to format some terminal output to display in conky, but I don't know how to convert it so conky can display it. I have tried ${iconv_start} etc, but I get

conky: unknown variable '$iconv_start'

(This is also happening for other conkys which previously worked BTW. Has something changed recently?)

This doesn't show everything in the forum post (but it does in the post editor - "?" are ANSI symbols). And anyway, why is just the sun symbol showing here for me?

damo@debian: ~ $ curl wttr.in/London?format=4
London: ☀️ ?️+13°C ?️←19 km/h

I suspect that there is something missing on my system but I don't know where to start looking  monkey


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#2 2019-02-22 17:47:29

ohnonot
...again
Registered: 2015-09-29
Posts: 4,165
Website

Re: How to format wttr.in output for conky?

i see 2 questionmarks there.
if i execute that command myself, i see 2 square blocks in urxvt.
in xterm (uses a vector font) i see this:
wttr-xterm.png
i copy-paste the same in geany and see this:
wttr-geany.png
i don't think iconv_start will help you there. these are colored unicode symbols contained in modern fonts.
have you tried with another format, then further parse that output for conky?

also: wttr.in/:help

edit: parse, not pass.

Last edited by ohnonot (2019-02-23 08:52:44)

Offline

#3 2019-02-22 17:52:47

damo
....moderator....
Registered: 2015-08-20
Posts: 5,271

Re: How to format wttr.in output for conky?

Thanks - I suspect it is a font issue, as you say.

And wttr.in/:help hasn't been a help, so far!


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2019-02-22 17:58:03

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,932
Website

Re: How to format wttr.in output for conky?

This

#-------------------------------------
# Executor weather
execp = new
execp_command = wget http://wttr.in/?format=4 2>/dev/null -O - | cut -d : -f 2
execp_interval = 1200
execp_continuous = 0
execp_tooltip = weather
execp_font = cuprum 12
execp_font_color = #111111 80
execp_padding = 0 0
execp_background_id = 0
execp_centered = 1

is working in tint2.
weather.png

Last edited by brontosaurusrex (2019-02-22 17:59:42)

Offline

#5 2019-02-22 18:12:42

damo
....moderator....
Registered: 2015-08-20
Posts: 5,271

Re: How to format wttr.in output for conky?

^ Nice


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#6 2019-02-22 18:45:17

unklar
Member
Registered: 2015-10-31
Posts: 951

Re: How to format wttr.in output for conky?

Did you check it out?

Install external dependencies

wttr.in has the following external dependencies:

    golang, wego dependency
    wego, weather client for terminal

...
Install Python dependencies

Python requirements:

    Flask
    geoip2
    geopy
    requests
    gevent

If you want to get weather reports as PNG files, you'll also need to install:

    PIL
    pyte (>=0.6)
    necessary fonts

You can install most of them using pip.

https://github.com/chubin/wttr.in

Offline

#7 2019-02-23 14:35:19

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,932
Website

Re: How to format wttr.in output for conky?

@damo, Ok, there is something going on here, testing the exact same code with exact same font on other machine (that tint2 snippet) is showing me some weird chars. Not sure how to figure it out. Workaround would be to use simpler 'format=3'.

Last edited by brontosaurusrex (2019-02-23 14:49:04)

Offline

#8 2019-02-23 14:41:55

damo
....moderator....
Registered: 2015-08-20
Posts: 5,271

Re: How to format wttr.in output for conky?

brontosaurusrex wrote:

... Not sure how to figure it out.

Join the club! Thanks for helping out smile


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#9 2019-11-25 18:03:23

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 921
Website

Re: How to format wttr.in output for conky?

Sorry to bump this thread, but i just was playing with wttr.in for my conky.
To have a clean output without those unicode icons or fonts let use like this:

in your terminal

curl 'wttr.in/Tokyo?format=%l:+%C+%t'

in your conky

${texeci 500 curl 'wttr.in/Tokyo?format=%l:+%C+%t'}

from wttr@github there are some other actions to play with:

c    Weather condition,
C    Weather condition textual name,
h    Humidity,
t    Temperature,
w    Wind,
l    Location,
m    Moonphase ????????,
M    Moonday,
p    precipitation (mm),
o    Probability of Precipitation,
P    pressure (hPa),

Just replace those "%l:+%C+%t" with any other of those above strings to have other features outputs.

I am bringing to your attention for those who are interested in showing clean txt without any icons or fonts symbols.
Pretty much looks like this on my conky.

Regards!


OS: FreeBSD // CWM & Devuan // Fluxbox (lean & mean).
I only play 96kHz Hi-Res audio WAV or FLAC via DAC player.
Chuck Norris doesn't approve systemd.

Offline

#10 2019-11-25 20:51:28

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,932
Website

Re: How to format wttr.in output for conky?

@Nili: Nice, thanks for sharing.

Offline

Board footer

Powered by FluxBB