You are not logged in.

#1341 2016-11-01 15:20:16

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

unklar wrote:

@Teo,
how do I know that he takes the right lichtenstein (from three in GE)?  cool

If I may.

wttr.in gets your location from your ISP.  This is why you really do not need to include a city if you want your city.

 01 Nov 16 @ 12:14:31 ~
  $ curl wttr.in
Weather for City: Buenos Aires, Argentina

      .-.      Rain With Thunderstorm
     (   ).    15 °C          
    (___(__)   ← 0 km/h       
   ‚‘⚡‘‚⚡‚‘    6 km           
   ‚’‚’⚡’‚’    2.3 mm   

More Information:

1. do not use spaces in names; use an underscore ( _ ) or "quote quote"
- ie: a slight difference

 01 Nov 16 @ 11:35:17 ~
  $ wttr rio de janeiro
Weather for City: Rio, Greece

 01 Nov 16 @ 11:35:49 ~
  $ wttr rio_de_janeiro
Weather for City: Rio De Janeiro, Brazil

2. add a country or province/state:

 01 Nov 16 @ 11:40:00 ~
  $ wttr london
Weather for City: London, United Kingdom

 01 Nov 16 @ 11:40:47 ~
  $ wttr London_canada
Weather for City: London, Canada

 01 Nov 16 @ 11:40:47 ~
  $ wttr London_ontario
Weather for City: London, Canada

How well that will work for you I don't know.  I get the exactly the same for two lichtenstein cities in Germany, and than: Vaduz, Liechtenstein

 01 Nov 16 @ 11:52:01 ~
  $ wttr Lichtenstein_Saxony
Weather for City: Lichtenstein, Germany

 01 Nov 16 @ 11:53:48 ~
  $ wttr Lichtenstein_Baden-Württemberg
Weather for City: Lichtenstein, Germany

 01 Nov 16 @ 11:55:02 ~
  $ wttr Lichtenstein
Weather for City: Vaduz, Liechtenstein

You can use airport codes as well ... someone posted this handy bash script here (or at #! - my forgetter).  I call it: wttr  I should have added the name of the person that posted it.   sad 
EDIT: Found the original bash script/author and added some help.

#!/bin/bash
### bash script credit to Fog
### https://forums.bunsenlabs.org/viewtopic.php?pid=20757#p20757
###
### Usage: wttr.in/:help (plus a few observations by S11)
###
###   $ curl wttr.in            # current location
###   $ curl wttr.in/muc        # weather in the Munic airport
###
### Supported location types:
###
###   /paris                    # city name
###   /paris_canada             # city name, country
###   /paris_ontario            # city name, province/state
###   /new_york or "new york"   # city name
###   /muc                      # airport code (3 letters)
###   /@stackoverflow.com       # domain name
###   /94107                    # area codes (US)
###
### Special locations:
###
###   /moon                     # Moon phase
###                               (add ,+US or ,+France for these cities)
###
### Units:
###
###   ?m                        # metric (SI) (default; except US)
###   ?u                        # USCS        (US default)
###
### Special URLs:
###
###   /:help                    # show this page
###
### === Aitport codes =============================================
### List of airports by IATA code: A
### https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A
###
### Lists of airports by country
### https://en.wikipedia.org/wiki/Category:Lists_of_airports_by_country
###

weather() {
     if [ ! -z $1 ]
     then
         curl -4 http://wttr.in/$1
     else
         curl -4 http://wttr.in
     fi

	}
weather $1
$SHELL

German:
https://de.wikipedia.org/wiki/Liste_der_IATA-Codes/A
https://de.wikipedia.org/wiki/Liste_der … eutschland

Last edited by Sector11 (2016-11-01 16:29:55)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1342 2016-11-01 16:55:17

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,648

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hi @Sector11, smile

thankyou for the explanation. I always came to Vaduz, (so much "coal" for the rich principality I did not  ]:D ) because I did not know the trick with the underline.

Perfect and, thanks to Teo.  wink  comparison -> conky -> wttr-sript
2016-11-01-17-36-15_scrot.th.png

PS: Now I see the script, wow, very good!   O:)

Offline

#1343 2016-11-01 18:34:31

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I love how Teo's one 'bash king-foo' line put that whole thing into a conky.  smile

Wish I knew what he knows.  Anyway, I get to 'use' what he knows and that's good enough for me.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1344 2016-11-01 18:38:14

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

OK, I have to ask.  Why do the arrows show in a terminal with  all mono fonts I plug in but not in conky?

What really really simple thing am I missing?

Same thing I'm missing I guess. I've no idea why this happens; could be a conky variable that needs to be declared? Who knows...

mihaicociuba wrote:

@Teo - I don't think that the end results looks great, your scripts look way much better.
The command line weather uses the api from https://www.worldweatheronline.com/ , and their git (for CLI weather) is here https://github.com/chubin/wttr.in, so my logic was if you can use some of their work in order to have a conkyweather similar to the python script https://ubuntuforums.org/showthread.php?t=869328
This is just an idea so feel free to disregard it if it's not feasible.
In the meantime your scripts are working great.

Relax mate and thanks for your kind words.
I don't know python. I could learn I guess, but I won't; I am more of a C guy.
If I ever did something with your suggestion, that'd be to create a script straight from https://www.worldweatheronline.com/.
Maybe in the future...

Sector11 wrote:

wttr.in gets your location from your ISP.  This is why you really do not need to include a city if you want your city.

I don't know about that one, it gives me weather for Athens, Greece, which is 500km from where I live.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1345 2016-11-01 18:42:59

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

I love how Teo's one 'bash king-foo' line put that whole thing into a conky.  smile

Wish I knew what he knows.  Anyway, I get to 'use' what he knows and that's good enough for me.

The regular expression could never work with sed, even with the -r parameter, only perl could do it.
Thanks to reddit user Fallenalien22 for the inspiration.

...but I think I'll stick to sed, thank you very much wink

Last edited by TeoBigusGeekus (2016-11-01 18:46:00)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1346 2016-11-01 18:56:21

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:
Sector11 wrote:

OK, I have to ask.  Why do the arrows show in a terminal with  all mono fonts I plug in but not in conky?

What really really simple thing am I missing?

Same thing I'm missing I guess. I've no idea why this happens; could be a conky variable that needs to be declared? Who knows...

Oh well, then I don't feel so bad.  At least I got a great font out of it.  Where did you ever find that font?

TeoBigusGeekus wrote:
Sector11 wrote:

wttr.in gets your location from your ISP.  This is why you really do not need to include a city if you want your city.

I don't know about that one, it gives me weather for Athens, Greece, which is 500km from where I live.

OH OH!  Well that is contrary to the help file for wttr.in  sad

 01 Nov 16 @ 15:53:02 ~
  $ curl wttr.in/:help
Usage:

    $ curl wttr.in          # current location
    $ curl wttr.in/muc      # weather in the Munic airport

Supported location types:

    /paris                  # city name
    /muc                    # airport code (3 letters)
    /@stackoverflow.com     # domain name
    /94107                  # area codes

Special locations:

    /moon                   # Moon phase (add ,+US or ,+France for these cities)

Units:

    ?m                      # metric (SI) (used by default everywhere except US)
    ?u                      # USCS (used by default in US)

Special URLs:

    /:help                  # show this page

 
 01 Nov 16 @ 15:53:16 ~
  $ 

I KNOW:  You moved and no one told you lol lol


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1347 2016-11-02 05:25:48

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I was abducted!

Sector11 wrote:

At least I got a great font out of it.  Where did you ever find that font?

Can't remember, I tried all my monospace fonts one by one until this one produced all the wind directions.
I had it forgotten in my .fonts folder, never actually used it.
I prefer Consolas, Fantasque Mono or Ubuntu Mono.

Last edited by TeoBigusGeekus (2016-11-02 12:30:39)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1348 2016-11-02 16:39:37

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Abducted!!! yikes yikes Damn aliens!  Or was it nieces or nephews or ..{cough cough}... work!
So you should be in Athens but you are getting use to Kastoria.  big_smile

Yea, you already got me onto Fantasque Mono, love it. Consolas is a mono font? ... How about that, if I knew that, I forgot it.
I have way too many fonts and way too many mono fonts**.  All come by way of; a) installed with Linux or b) conky.

===
** image: my mono fonts

EDIT:

I quite like this Fira Mono, I'm trying it out in my terminal and it's a clean font I can clearly at a smaller size.  But maybe that's just me.
UHa95Dm0.jpg

Last edited by Sector11 (2016-11-02 16:47:01)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1349 2016-11-02 18:35:59

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

It saddens me to say it, but I use Microsoft fonts on my system: Tahoma for normal font and Consolas for monospace.
I find them the most eye pleasing among many competitors.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1350 2016-11-02 19:06:48

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Well I have the fonts installed from ttf-mscorefonts-installer, but only because I have backed up ~/.fonts over the years and they were there - same thing as the ubuntu fonts, those show up in a lot of conkys sooooooooooooooo .....

Tahoma I don't have - I recall having it once, but I do have Consolas.

So we be 'saddened' together.  big_smile


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1351 2016-11-02 21:25:08

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

That 10/Lo thing in the 1_Accuweather script kept annoying me after S11 mentioned it and I did something for it:

if [[ $(sed -n 4p $HOME/1_accuweather/first_days) == Lo ]]; then
			line_3=$(sed -n 3p $HOME/1_accuweather/first_days)
			sed -i -e '3s/^.*$/N\/A/' -e "4s/^.*$/$line_3/" $HOME/1_accuweather/first_days
		fi

Add these lines at the end of the #First 5 days' section, just before the last fi.

With this addition, instead of 2/Lo, the output will be N/A / 2:
IG2YbtMt.jpg

Better or worse? Is it worth an update?

Last edited by TeoBigusGeekus (2016-11-02 21:26:19)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1352 2016-11-02 21:41:05

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Better make it

if [[ $(sed -n 4p $HOME/1_accuweather/first_days) == Lo ]]; then
			line_3=$(sed -n 3p $HOME/1_accuweather/first_days)
			sed -i -e '3s/^.*$/-/' -e "4s/^.*$/$line_3/" $HOME/1_accuweather/first_days
		fi

-/2 is better looking than N/A/2

Last edited by TeoBigusGeekus (2016-11-02 22:07:37)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1353 2016-11-02 22:18:04

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

That 10/Lo thing in the 1_Accuweather script kept annoying me after S11 mentioned it.

]:D ]:D  {evil}hahaha ... I'm growing on him.  {rubbing hands}  ]:D ]:D

TeoBigusGeekus wrote:

Better make it

if [[ $(sed -n 4p $HOME/1_accuweather/first_days) == Lo ]]; then
			line_3=$(sed -n 3p $HOME/1_accuweather/first_days)
			sed -i -e '3s/^.*$/N\/A/' -e "4s/^.*$/$line_3/" $HOME/1_accuweather/first_days
		fi

-/2 is better looking than N/A/2

OK, where do you get the " - " in all that?  But yea that is better than N/A.

Why not:

thedayhasendedchecknighttemp

naaaaaaaa that would never fit.  smile

But seriously  why not, if you can, make is a variable in the script ( ##Default = -  ) that people can use what they want, oh and have a way to leave it blank.

I quite like my blank space: TgLm0j9P.jpg


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1354 2016-11-02 22:21:07

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

OK, where do you get the " - " in all that?  But yea that is better than N/A.

It was an OOPS, sorry. Look at my edited post.

As for the variable, we'll see tomorrow.

Goodnight S11.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1355 2016-11-02 23:11:08

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

G'night Teo ... will try that after dinner.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1356 2016-11-08 18:01:48

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

We're both a few tomorrows short ...  :8  lol  lol

Anyway I started playing again ... been interrupted a few times but here's the layout:
OyLEgBCb.jpg
= 1550 wide


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1357 2016-11-08 18:37:10

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,486

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Totally abandoned the idea of changing the 10/Lo thingy after the non-existent response it provoked.
I'll just leave it as it is.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1358 2016-11-08 19:11:04

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,648

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ Sector11  cool

TeoBigusGeekus wrote:

Totally abandoned the idea of changing the 10/Lo thingy after the non-existent response it provoked.
I'll just leave it as it is.

I find this statement sympathetic.  wink

Offline

#1359 2016-11-08 19:11:50

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hey - if it works; don't fix it - if no one complains; don't change it.

... and then - along comes Sector11 who just has to tweak the hell out of everything conky related.  big_smile lol

New one coming along quite nice:
Rd5ZMBrG.jpg

@ unklar -  I'm at it again!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#1360 2016-11-08 19:19:17

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,648

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ I see it!
It "packed" you again.  big_smile

Offline

Board footer

Powered by FluxBB