SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#8326 2015-04-25 20:39:23

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

schwim wrote:

I've already set the proper directories in the rc, but if you look at my errors, it's not looking for light rain.png or mist.png like the files are named, but 26.png and 30.png, which don't match any of the image names in the directory.

I just don't know what the numbers correlate to (for instance, maybe 26 = partly cloudy) or I would rename them to what the script is looking for.

Perhaps there is a issue with png numbers in order.

Sorry for the long way to bring at you guys, I was not prepared for releases, since i was asked by a friend i've released in the non normal manner for all. neutral

However, please take a look on personal copy, Download at MEGA to check how i used on my system.

Folder name must renamed to ".conky" this is how i used on my system. Wish it is more clear.

Sorry,
Nili

Last edited by Nili (2015-04-25 20:46:06)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

Be excellent to each other!

#8327 2015-04-25 22:12:37

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

schwim wrote:

I just don't know what the numbers correlate to (for instance, maybe 26 = partly cloudy) or I would rename them to what the script is looking for.

Lets use Nili's conky as an example  ... strip out formatting just commands

Line 1

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=472135&u=c&d=8" -o ~/.cache/weather.xml}

--- get the forecast and save as weather.xml

Line 2

${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °

--- look in weather.xml - grep "temp" (I have:  temp="17") and display that result with a " °" after it
17 °

Line 3: simple:

Current

--- display Current

Line 4

${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

--- look in weather.xml for "yweather:condition" and get the "code=" on that line

    $ grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\""
code="30"

Here's where I go fuzzy because I know very little about grep ... but it is suppose to match that 30 with an image found in the icon directory and copy to ~/.cache/weather.png
--- and then display the image: ${image ~/.cache/weather.png -p -1,1 -s 32x32}

BTW - if you have resized the images you do mot need the -s 32x32 because you are telling the images command to resize the 32x32 image to 32x32.  Leave it out and the images command simply puts the upper/left corner of the image at -p -1,1.

I am going to recreate Nili's conky here exactly and see is that works - mean's I'll have to rename some existing stuff ... but ....


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8328 2015-04-25 22:14:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

@ Nili

Naaaaaaaaaa not your fault at all, we have to make it work on our machines.  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8329 2015-04-25 23:45:39

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: Conky v1.9 Thread

heya sector, I got the images showing.  To do so, I had to open weather.xml and look at the following lines:

<yweather:forecast day="Sat" date="25 Apr 2015" low="57" high="73" text="Scattered Strong Storms" code="47" />
<yweather:forecast day="Sun" date="26 Apr 2015" low="46" high="72" text="Partly Cloudy" code="30" />
<yweather:forecast day="Mon" date="27 Apr 2015" low="41" high="69" text="Sunny" code="32" />
<yweather:forecast day="Tue" date="28 Apr 2015" low="47" high="72" text="Partly Cloudy" code="30" />
<yweather:forecast day="Wed" date="29 Apr 2015" low="46" high="64" text="Rain" code="12" />
<yweather:forecast day="Thu" date="30 Apr 2015" low="45" high="70" text="PM Showers" code="39" />
<yweather:forecast day="Fri" date="1 May 2015" low="47" high="73" text="Partly Cloudy" code="30" />
<yweather:forecast day="Sat" date="2 May 2015" low="51" high="78" text="Sunny" code="32" />

Noting the codes and then rename the images to match the code.  For instance, Sunny.png became 32.png.  That got it working for me.

Offline

#8330 2015-04-26 05:57:11

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Nili wrote:
chepioq wrote:

Thank NILI, I install your weather conky and that work fine.

Can we put it in French ?


Ofcourse you can, just must know your city WOEID

this link is for Paris, France
http://weather.yahooapis.com/forecastrss?w=615702

I found also city Nice, FR WOEID 614274
http://weather.yahooapis.com/forecastrss?w=614274

Check out other WOEID on This Link then enough to put WOEID number behind conky url.

It's not the problem, I found mt WOEID (576999 for Aubagne, France), I just want replace the name for days in english (Mon, Tue, Wed, Thu, Fri, Sat, Sun ) by the french one (Lun, Mar, Mer, Jeu, Ven , Sam, Dim)

Offline

#8331 2015-04-26 06:42:09

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

chepioq wrote:

It's not the problem, I found mt WOEID (576999 for Aubagne, France), I just want replace the name for days in english (Mon, Tue, Wed, Thu, Fri, Sat, Sun ) by the french one (Lun, Mar, Mer, Jeu, Ven , Sam, Dim)

Far as I know it is not possible, there is some info on this link confirming that it is not yet possible unfortunately.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8332 2015-04-26 06:45:23

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

schwim wrote:

Noting the codes and then rename the images to match the code.  For instance, Sunny.png became 32.png.  That got it working for me.

schwim, These are numbers that show the weather images on conky. Or refer the MEGA link ^above.
EY40MLbt.png

Last edited by Nili (2015-04-26 06:59:41)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8333 2015-04-26 06:47:59

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Many thanks Sector11 for putting your hands to do something more and perhaps much better.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8334 2015-04-26 14:05:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Nili wrote:

Sector11, i'll change mine to every 3hour because from my observation noticed that Yahoo Weather becomes updated once in three hours, so i'll change interval 5min to 3h. Thanks for telling me. I wanted to make some change early but forgot it.

Every three hours! OH MY!  That's not good

Remember guys, you will need to adapt the settings according to your preferences because this conky is not made for public release although i released it here. But I am here to speak for everything possible to make functional on your system.

Thank you for understanding.

Kindly regards,
Nili

I think what you have done is use some of the default "harmattan" settings and then made changes to your liking but keeping some things as the defaults that harmattan set.  Once I grabbed your icons (resized sized and numbered) everything I had came alive, so I was on the right track.  And your conky on my machine works here:

file:///media/5/Conky/Nili-wx/cache
file:///media/5/Conky/Nili-wx/icons
file:///media/5/Conky/Nili-wx/stuff
file:///media/5/Conky/Nili-wx/Nili-Weather-Orig
file:///media/5/Conky/Nili-wx/Nili-Weather.conky

See - conky files can be anywhere - just need to change the commands that call for info to call in the right places is all that is required..

Now I'm working on "re-configuring" Nili-Weather.conky as the font was way to small for my 'old' eyes.  big_smile

First thing I did was get rid of EVERY ${voffset xx} as they were not needed ... let me explain.

simple way:  the conky has 4 lines for each date:

  1. empty line

  2. ${voffset -9}${alignr}${command to get low temp} °/${command to get high temp} °

  3. ${font cure:bold:size=7}${voffset 0}${alignr}${command to get short day name}, ${command to get day number}

  4. ${command searching for image to use this day and give it a day number}${image command using that number}

The voffset in line 2 is moving the info up into the empty space - moving every line under it up 9 pixels as well

The LONG commands that check the code for images and other data need no line in the conky same as the ${image} command.  ${image name.png} will always put the top/left corner of ANY image at the top left corner of the conky window at the actual size of the image.

That's where the position command comes in: -p -1,1, -1,35, -1,71, -1,107 etc . they could theoretically all go on one line - however cleaner code would be to keep each ${image} with the data gathered for that day.

Another thing your are using a LONG (well harttman is) line to get the day name and then the "date" command for the day number.
IE:

${alignr}${color1}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +1days +%d}${color}

One command to get TUE the other to get 28
You can shorten that to one command:

${alignr}${color1}${execi 3600 echo `date --date="1 day" | awk '{print $1" "$3}'`}${color}

as seen here:

 26 Apr 15 | 10:18:41 ~
    $ grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'
MON
 
 26 Apr 15 | 10:18:51 ~
    $ date -d +1days +%d
27
 
 26 Apr 15 | 10:18:58 ~
    $ echo `date --date="1 day" | awk '{print $1" "$3}'`
Mon 27
 
 26 Apr 15 | 10:19:05 ~
    $ 

I'll post my code when done.  big_smile

OH and chepioq - that should at least give you the day names in French because "date" works on your locale.

Nili wrote:

Many thanks Sector11 for putting your hands to do something more and perhaps much better.

I see you helping others with stuff I don't understand - least I can do is help you and others with conky.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8335 2015-04-26 14:28:30

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

WOW very nice S11, I knew well how you do these things smile just managed to replace/remove things according to your suggestion.
I am very interested in the end of look what have you done.

Last edited by Nili (2015-04-26 14:37:22)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8336 2015-04-26 15:43:17

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Hi Nili,
I find how replace the english name by the french one.

Here the conky, with the new line :

# Conky settings #
background no
update_interval 3600
double_buffer yes
no_buffers yes
imlib_cache_size 10

# Window specifications #
gap_x 1190
gap_y 38
minimum_size 73
maximum_width 183
own_window yes
own_window_type desktop # other options are: override/normal/desktop/panel
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
#alignment middle_middle
#own_window_argb_visual yes
#own_window_argb_value 0

# Graphics settings #
draw_shades no
draw_outline yes
draw_borders no
default_outline_color 000000
draw_graph_borders no

# Text settings #
use_xft yes
xftalpha 0.8
xftfont cure:size=7
text_buffer_size 256
override_utf8_locale yes
imlib_cache_size 0

# Color scheme
default_color F2F2F2
color1 FFFFFF
color2 F5B800
color3 BFBFBF

TEXT
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=8" | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > ~/.cache/weather.xml}

${font anorexia:bold:size=7}${voffset -3}${alignr}${color2}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °${font}${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}Actuel${color}${font}
${execi 300 cp -f ~/test/icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}+Aujourd'hui${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p -1,35 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +1days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p -1,71 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +2days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p -1,107 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +3days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p -1,143 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +4days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p -1,179 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +5days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png ~/.cache/weather-6.png}${image ~/.cache/weather-6.png -p -1,215 -s 32x32}

${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +6days +%d}${font}${color}
${execi 300 cp -f ~/test/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-7.png}${image ~/.cache/weather-7.png -p -1,251 -s 32x32}

${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +7days +%d}${font}${color}

${font cure:size=7}${color2}${execi 300 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunrise=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}${alignr}Lever
${color4}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%${alignr}Humidité${color}
${color5}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${alignr}Vent${color}
Coucher${alignr}${color2}${execi 300 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunset=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}

and the result :
1430062910.jpg

The 27/04 : Updated with optimized code

Last edited by chepioq (2015-04-27 12:02:09)

Offline

#8337 2015-04-26 16:49:25

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Very nice chepioq, tongue good job, I did not know that was possible.   :8 let just wait an expect new version adjusted by S11 that will be even more systemized.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8338 2015-04-26 18:32:49

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

NOOOOOOOOOOO!!  "Expert" --> no thank you.  Different way of doing things: yes.   wink

OK here's what I have ... I even added 2 days.
2015_04_26_14_53_53_1920x1080_Sector11.jpg
Talk about a nice compact little conky.  Would work very well on small screens,  Nice find Nili and thank you for sharing ... I have more exploring of the Harmattan conkys in the future.

I moved the days above the temperatures - personal choice
And I moved the other info that is for today above the -- + next --- days section

Each of those "days" below -- + next -- only uses two lines as far as conky is concerned.
example:

${alignr}${color1}${execi 1200 echo `date --date="2 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}° ${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}${alignr}${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png /media/5/Conky/Nili-wx/cache/weather-3.png}${image /media/5/Conky/Nili-wx/cache/weather-3.png -p 1,179}

But by breaking the long line with a few well placed backslashes ( \ ) we get something a little more readable:

${alignr}${color1}${execi 1200 echo `date --date="2 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}\
${alignr}${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png /media/5/Conky/Nili-wx/cache/weather-3.png}\
${image /media/5/Conky/Nili-wx/cache/weather-3.png -p 1,179}

Now mine is a little wider to make room for people that use °F where they can have Low: -25 and High -10 in the winter or High: 112° Low 100° in the summer - that's two extra character spaces needed.
Look at Monday 27, the negative sign is hard coded in place (you can see my red+x.png test image in place to test absolute spacing as well) 2015_04_26_14_49_54_1920x1080_Sector11.jpg

One "could" make it a little wider yet and add the month ...

${alignr}${color1}${execi 1200 echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`}${color}

but  that's another option.

 26 Apr 15 | 15:16:29 ~
    $ date --date="1 day" | awk '{print $1" "$3" "$2}'
Mon 27 Apr

Definitely smaller than the one I use daily: 2015_04_26_14_54_34_1920x1080_Sector11.jpg

And here's the conky - my way:

# pkill -xf "conky -c /media/5/Conky/Nili-wx/Nili-Weather_2.conky" &
########## Nili Weather conky
###  Begin Window Settings  ########################################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager #,sticky
own_window_colour 000000
own_window_class Conky
own_window_title Nili's Weather 2
### ARGB can be used for real transparency - requires composite manager
### Plays hell on conky with images.
#  own_window_argb_visual yes # Options: yes or no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#  own_window_argb_value 100

minimum_size 90 0 #73 0	# w|h
maximum_width 90 #183

gap_x 10	# l|r
gap_y 10	# u|d

alignment tr
##########################################  End Window Settings  ###
###  Font Settings  ################################################
use_xft yes
xftfont monofur:bold:size=9
#xftfont monofur:bold:size=10
#xftfont Fantasque Sans Mono:bold:size=10
xftalpha 1.0
override_utf8_locale yes
############################################  End Font Settings  ###
###  Color Settings  ###############################################
draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

#default_color DCDCDC #Gainsboro
#default_color C0C0C0 #Silver
default_color F2F2F2
color0 A9A9A9 #169 169 169 DarkGray
color1 FFFFFF
color2 F5B800
color3 BFBFBF
#color1 778899 #LightSlateGray
#color2 DCDCDC #Gainsboro #F5F5DC #Beige
#color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 FFA07A #LightSalmon
###########################################  End Color Settings  ###
###  Borders Section  ##############################################
draw_borders no
# Stippled borders?
stippled_borders 5
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 2
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
###########################################  End Borders Secton  ###
###  Miscellaneous Section  ########################################
background yes
use_spacer none
#text_buffer_size 6144
no_buffers yes
imlib_cache_size 0
double_buffer yes
####################################  End Miscellaneous Section  ###

update_interval 1
TEXT
${execi 1200 curl -s "http://weather.yahooapis.com/forecastrss?w=2344681&u=c&d=10" -o /media/5/Conky/Nili-wx/cache/weather.xml}\
${alignr 5}${color2}${execi 1200 grep "yweather:condition" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °${color}
${alignr}${color1}Current${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:condition" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png /media/5/Conky/Nili-wx/cache/weather.png}\
${image /media/5/Conky/Nili-wx/cache/weather.png -p 1,1}
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png /media/5/Conky/Nili-wx/cache/weather-1.png}\
${image /media/5/Conky/Nili-wx/cache/weather-1.png -p 1,37}
${alignr}${color1}${time %a %d}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}

${color2}${execi 1200 grep "yweather:astronomy" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "sunrise=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}${alignr}Sunrise
${color4}${execi 1200 grep "yweather:atmosphere" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%${alignr}Humidity${color}
${color5}${execi 1200 grep "yweather:wind" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 1200 grep "yweather:units" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${alignr}Wind${color}
Sunset${alignr}${color2}${execi 1200 grep "yweather:astronomy" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "sunset=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${alignc}${membar 0,10} + next ${membar 0,10}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png /media/5/Conky/Nili-wx/cache/weather-2.png}\
${image /media/5/Conky/Nili-wx/cache/weather-2.png -p 1,140}
${alignr}${color1}${execi 1200 echo `date --date="1 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}

${alignr}${color1}${execi 1200 echo `date --date="2 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}\
${alignr}${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png /media/5/Conky/Nili-wx/cache/weather-3.png}\
${image /media/5/Conky/Nili-wx/cache/weather-3.png -p 1,179}

${alignr}${color1}${execi 1200 echo `date --date="3 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png /media/5/Conky/Nili-wx/cache/weather-4.png}\
${image /media/5/Conky/Nili-wx/cache/weather-4.png -p 1,218}

${alignr}${color1}${execi 1200 echo `date --date="4 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png /media/5/Conky/Nili-wx/cache/weather-5.png}\
${image /media/5/Conky/Nili-wx/cache/weather-5.png -p 1,258}

${alignr}${color1}${execi 1200 echo `date --date="5 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png /media/5/Conky/Nili-wx/cache/weather-6.png}\
${image /media/5/Conky/Nili-wx/cache/weather-6.png -p 1,297}

${alignr}${color1}${execi 1200 echo `date --date="6 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png /media/5/Conky/Nili-wx/cache/weather-7.png}\
${image /media/5/Conky/Nili-wx/cache/weather-7.png -p 1,337}

${alignr}${color1}${execi 1200 echo `date --date="7 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8').png /media/5/Conky/Nili-wx/cache/weather-8.png}\
${image /media/5/Conky/Nili-wx/cache/weather-8.png -p 1,376}

${alignr}${color1}${execi 1200 echo `date --date="8 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==9'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==9'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==9').png /media/5/Conky/Nili-wx/cache/weather-8.png}\
${image /media/5/Conky/Nili-wx/cache/weather-8.png -p 1,415}

${alignr}${color1}${execi 1200 echo `date --date="9 day" | awk '{print $1" "$3}'`}${color}
${alignr}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==10'}° \
${color2}${execi 1200 grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==10'}°${color}\
${execi 1200 cp -f /media/5/Conky/Nili-wx/icons/$(grep "yweather:forecast" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==10').png /media/5/Conky/Nili-wx/cache/weather-8.png}\
${image /media/5/Conky/Nili-wx/cache/weather-8.png -p 1,454}
${hr}
${color7}${execi 1200 grep "lastBuildDate" /media/5/Conky/Nili-wx/cache/weather.xml | cut -c 33-40}${alignr}Fetch${color}

Done - feels good.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8339 2015-04-26 18:36:13

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

chepioq wrote:

I find how replace the english name by the french one.

Well done - is it a setting at the website?  I see nothing in the conky code that would do that.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8340 2015-04-26 18:58:43

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Sector11 wrote:
chepioq wrote:

I find how replace the english name by the french one.

Well done - is it a setting at the website?  I see nothing in the conky code that would do that.

This two lines in the conky :

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=10" -o ~/.cache/weather1.xml}
${exec cat ~/.cache/weather1.xml | sed 's/Sun/Dim/g'| sed 's/Mon/Lun/g'| sed 's/Tue/Mar/g'| sed 's/Wed/Mer/g'| sed 's/Thu/Jeu/g'| sed 's/Fri/Ven/g'| sed 's/Sat/Sam/g' > ~/.cache/weather.xml}

I use sed, but I think command is not optimized.
But that work.  tongue

Offline

#8341 2015-04-26 20:11:27

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

chepioq wrote:

I use sed, but I think command is not optimized.
But that work.  tongue

NICE!  you could either switch to what I showed above using ${date} OR combine those two lines into one - optimize it:

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=10" -o ~/.cache/weather1.xml && cat ~/.cache/weather1.xml | sed 's/Sun/Dim/g'| sed 's/Mon/Lun/g'| sed 's/Tue/Mar/g'| sed 's/Wed/Mer/g'| sed 's/Thu/Jeu/g'| sed 's/Fri/Ven/g'| sed 's/Sat/Sam/g' > ~/.cache/weather.xml}

I tested changing ~/.cache to ~/test and in a terminal:

 26 Apr 15 | 17:02:36 ~
    $ curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=10" -o ~/test/weather1.xml && cat ~/test/weather1.xml | sed 's/Sun/Dim/g'| sed 's/Mon/Lun/g'| sed 's/Tue/Mar/g'| sed 's/Wed/Mer/g'| sed 's/Thu/Jeu/g'| sed 's/Fri/Ven/g'| sed 's/Sat/Sam/g' > ~/test/weather.xml

and ended up with:

  • ~/test/weather.xml - French day names

  • ~/test/weather1.xml - English day names

Your way allows for "multiple" languages on the same system though.  Good stuff!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8342 2015-04-27 06:49:14

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

I simplified my code, and now I have just one pipe.
I replace

sed 's/Sun/Dim/g'| sed 's/Mon/Lun/g'| sed 's/Tue/Mar/g'| sed 's/Wed/Mer/g'| sed 's/Thu/Jeu/g'| sed 's/Fri/Ven/g'| sed 's/Sat/Sam/g'

by

 sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g'

The new line :

${exec cat ~/.cache/weather1.xml | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > ~/.cache/weather.xml}

It's more readable  smile

Offline

#8343 2015-04-27 09:05:38

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

And finally, an other one code line, which replace the two :

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=10" -o ~/.cache/weather1.xml}
${exec cat ~/.cache/weather1.xml | sed 's/Sun/Dim/g'| sed 's/Mon/Lun/g'| sed 's/Tue/Mar/g'| sed 's/Wed/Mer/g'| sed 's/Thu/Jeu/g'| sed 's/Fri/Ven/g'| sed 's/Sat/Sam/g' > ~/.cache/weather.xml}
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=8" | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > ~/.cache/weather.xml}

With that line, it's not needed create the weather1.xml.

I think my code is fully optimized. And it works ! tongue

Offline

#8344 2015-04-27 12:59:53

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Very nice guys, you did an awesome job!  big_smile  I'll make some changes on mine aswell.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8345 2015-04-27 13:43:17

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

And I have to go searching for the line I came up with because I had NO idea anout how to do it all in one line.  big_smile

@chepioq - nice final touch.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8346 2015-04-28 14:50:52

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

@Nili
I post your conky on ubuntu-fr forum : http://forum.ubuntu-fr.org/viewtopic.ph … #p19696651 , post #979.
I hope it will please a lot of people

Offline

#8347 2015-04-28 16:20:04

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

^ I love it when people spread the wealth.  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8348 2015-04-28 16:34:48

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Thank you chepioq, Well, Big thanks goes to all Involed anyway smile  {)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#8349 2015-04-29 21:03:46

wagmic1
#! CrunchBanger
Registered: 2013-11-15
Posts: 119

Re: Conky v1.9 Thread

@chepioq
tres chouette ce conky mais les prevision ca demoralise un peu pour un mois de mai smile


I need to learn how to speak/write English big_smile
latest Firefox on #! handylinux

Offline

Help fund CrunchBang, donate to the project!

#8350 2015-04-29 22:19:56

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: Conky v1.9 Thread

@Sector11 - feel free to add this to the Conky Archive (or anywhere else if you think it adds value wink )
hFdv8wQz.png

The zipfile contains ellipses.conkyrc, clock.lua, the bg image and this scrot
ellipse-conky-clock.zip


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo