You are not logged in.

#681 2016-03-15 18:21:39

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

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

Thanks guys ...

No need to worry about the overexciting conkys - doc just said life as per normal because all other check ups always come out fine, no restrictions.  But then he knows we dropped salt from our daily routine a few years ago.

So no salty conkys    tongue


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#682 2016-03-15 18:24:58

Unia
Octo-portal-pussy
From: Stockholm, Sweden
Registered: 2015-09-17
Posts: 355
Website

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

Good to see you again!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#683 2016-03-15 18:59:27

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

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

Thanks Unia.

@Teo - sorry for hijacking the thread.

Back on topic:
The weather todays - Light during the day and dark at night.   O:)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#684 2016-03-15 19:02:19

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:

@Teo - sorry for hijacking the thread.

Are you kidding me?
First health, then conky.


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

#685 2016-03-15 20:50:31

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

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

Hmmmmmmmmm OK, how about:

${combine healthy conky}

]:D ]:D

combine var1 var2
              Places  the lines of var2 to the right of the lines of var1 separated by the chars that are put
              between var1 and var2. For example: ${combine ${head /proc/cpuinfo 2}  -  ${head  /proc/meminfo
              1}}  gives as output "cpuinfo_line1 - meminfo_line1" on line 1 and "cpuinfo_line2 -" on line 2.
              $combine vars can also be nested to place more vars next to each other.

Thanks my friend.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#686 2016-03-16 14:58:27

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

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

Sometimes it's hard to mess with perfection.  Teo's latest 1c accuweather hourly script is perfection.  It does everything for us.

But after a frustrating day trying to get the script to work where I keep my conkys ( /media/5 ) I had to break down and ask for Teo's help and as usual, there it was ... such a simple solution if you know the workings of 'sed', which I don't.  smile

So my tweaked 1c script works now and I've tweaked the conkys to my liking, open them, look at them and close them.  With OB menu entries.
2016_03_16_11_25_29_Scrot11.jpg

Gotta love Teo's scripts.

You'll need to tweak a few things - and create a black and yellow 1x1 image as well.
8-8_2.conky

## pkill -xf "conky -q -c /media/5/Conky/1c_accuweather_images_hourly_test/8-8_2.conky" &

## ---------- Begin Window Settings

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager #,undecorated,below
own_window_colour 000000
own_window_class Conky
own_window_title Last 8 - Next 8 Hours - Weather - 1c
## ARGB can be used for real transparency
#  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 150

minimum_size 1040 300
maximum_width 1040

gap_x 20	## l|r
gap_y 20	## u|d
alignment tl
## ---------- End Window Settings
## ---------- Font Settings
## Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=10

## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0

## Force UTF8? requires XFT
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
color0 98FB98 #PaleGreen
color1 778899 #LightSlateGray
color2 FFD700 #Gold
color3 B0E0E6 #PowderBlue
color4 F4A460 #SandyBrown			#FFA07A #LightSalmon
color5 DEB887 #BurlyWood			#FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 5F9EA0 #CadetBlue
color8 FFA500 #Orange 				#FF6347 #Tomato
color9 FF4500 #OrangeRed			#CD5C5C #IndianRed
## ---------- End Color Settings
## ---------- Begin Borders Section
draw_borders no
## Stippled borders?
stippled_borders 5
## border margins
border_inner_margin 9
border_outer_margin 0
## border width
border_width 2
## graph borders
draw_graph_borders yes ## no
## default_graph_size 15 40
## ---------- End Borders Secton
## ---------- Begin Miscellaneous Section
## Boolean value, if true, Conky will be forked to background when started.
background no ## yes

## Adds spaces around certain objects to stop them from moving other things
## around, this only helps if you are using a mono font
## Options: right, left or none
use_spacer none

## Default and Minimum size is 256 - needs more for single commands that
## "call" a lot of text IE: bash scripts
text_buffer_size 5192

## Subtract (file slystem) buffers from used memory?
no_buffers yes

# Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value if
# you use $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0

## Use the Xdbe extension? (eliminates flicker)
## It is highly recommended to use own window with this one
## so double buffer won't be so big.
double_buffer yes

## ---------- End Miscellaneous Section
update_interval 1

lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre main

# ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\
TEXT
 ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}\
${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\
${font Monofur:size=15}${color ffe595}Weather for the last and the next 8 hours${font} ${membar 0}
${image /media/5/Conky/images/black_1.png -p 560,11 -s 2x385}${image /media/5/Conky/images/yellow_1.png -p 560,11 -s 1x385}
${execpi 600 sed -n '1,26p' /media/5/Conky/1c_accuweather_images_hourly_test/altogether8_plus_8}

16-hour_2.conky

## pkill -xf "conky -q -c /media/5/Conky/1c_accuweather_images_hourly_test/16-hour_2.conky" &

## ---------- Begin Window Settings

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager #,below
own_window_colour 000000
own_window_class Conky
own_window_title 16 Hour Weather - 1c
## ARGB can be used for real transparency
#  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 150

minimum_size 1040 300
maximum_width 1040

gap_x 0	## l|r
gap_y 0	## u|d
alignment mm
## ---------- End Window Settings
## ---------- Font Settings
## Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=10

## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0

## Force UTF8? requires XFT
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
color0 98FB98 #PaleGreen
color1 778899 #LightSlateGray
color2 FFD700 #Gold
color3 B0E0E6 #PowderBlue
color4 F4A460 #SandyBrown			#FFA07A #LightSalmon
color5 DEB887 #BurlyWood			#FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 5F9EA0 #CadetBlue
color8 FFA500 #Orange 				#FF6347 #Tomato
color9 FF4500 #OrangeRed			#CD5C5C #IndianRed
## ---------- End Color Settings
## ---------- Begin Borders Section
draw_borders no
## Stippled borders?
stippled_borders 5
## border margins
border_inner_margin 9
border_outer_margin 0
## border width
border_width 2
## graph borders
draw_graph_borders yes ## no
## default_graph_size 15 40
## ---------- End Borders Secton
## ---------- Begin Miscellaneous Section
## Boolean value, if true, Conky will be forked to background when started.
background no ## yes

## Adds spaces around certain objects to stop them from moving other things
## around, this only helps if you are using a mono font
## Options: right, left or none
use_spacer none

## Default and Minimum size is 256 - needs more for single commands that
## "call" a lot of text IE: bash scripts
text_buffer_size 5192

## Subtract (file slystem) buffers from used memory?
no_buffers yes

# Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value if
# you use $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0

## Use the Xdbe extension? (eliminates flicker)
## It is highly recommended to use own window with this one
## so double buffer won't be so big.
double_buffer yes

## ---------- End Miscellaneous Section
update_interval 1

lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre main

# ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\
TEXT
 ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\
 ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}\
${font Monofur:size=15}${color2}The Next 16 Hours${font} ${membar 0}
${image /media/5/Conky/images/black_1.png -p 560,11 -s 2x385}${image /media/5/Conky/images/yellow_1.png -p 560,11 -s 1x385}
${execpi 600 sed -n '1,26p' /media/5/Conky/1c_accuweather_images_hourly_test/altogether16}

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#687 2016-03-16 20:26:30

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

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

Hey, nice work S11!
How does that vertical line work? Is it lua?


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

#688 2016-03-16 20:56:17

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:

Hey, nice work S11!
How does that vertical line work? Is it lua?

No, they are 1x1pixel images one black and one yellow.  Called them in the blank line between the WEATHER line and the line calling the altogether scripts.  Black is 2 pixels wide x 385 high and then yellow 1 wide x 385 high over it.

${image /media/5/Conky/images/black_1.png -p 560,12 -s 2x385}${image /media/5/Conky/images/yellow_1.png -p 560,11 -s 1x385}

Images for Conky
- various 1x1 coloured images
- varios shades of semi-transparent black images, and
- the red+x.png (other colours as well) I use when testing.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#689 2016-03-16 21:03:03

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

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

Good, but bear in mind that the 8+8 forecast can sometimes be 0+8, 1+8, 2+8,...,7+8.
Accuweather only reports the past weather from midnight onwards, so if you use the script let's say at 05:00am, you will have 5hours past weather and 8 hours future weather: the vertical line, since it's not dynamically generated, will find itself at the wrong position.

The 16h forecast is perfect though...


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

#690 2016-03-16 23:00:35

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

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

OH SURE!  Throw a monkey wrench into the works.  sad

No problem, I'm still sleeping at 05:00 anyway.     smile smile

And what do you mean the 16 hour one looks perfect, so does the 8+8 one.
Of course it has the hours to fill it in properly in the sample above. ]:D

AHA!  ACC!**

I wonder if I can get ${if_match} to work

if 24-hour < 01 endif\
if_match 24-hour < 02 position images here endif\
if_match 24-hour < 03 position images here endif\
if_match 24-hour < 04 position images here endif\
if_match 24-hour < 05 position images here endif\
if_match 24-hour < 06 position images here endif\
if_match 24-hour < 07 position images here endif\
if_match 24-hour < 08 position images here else\
put images here (as seen above)

Actually, it will work, it's the spacing thing to work out.

OOPS! I see another monkey wrench here.

The clock reads 05:05 and five minutes earlier conky shifted the line to the "< 06" location, but conky hasn't updated the weather data since 04:47 and won't again until 05:17.   sad

**A ConkyChallange


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#691 2016-03-17 10:54:12

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)

Hello friends,

I did not really want to do it ...   wink

S11 >> draw_bg.lua has challenged me on conky1.10

[unklar@archhost ~]$ conky -v
conky 1.10.1_pre compiled Sun Dec  6 23:38:38 UTC 2015 for Linux 4.2.5-1-ARCH x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


 General:                                                                                                                                                                                                      
  * math                                                                                                                                                                                                       
  * hddtemp                                                                                                                                                                                                    
  * portmon                                                                                                                                                                                                    
  * IPv6                                                                                                                                                                                                       
  * Curl                                                                                                                                                                                                       
  * RSS                                                                                                                                                                                                        
  * Weather (METAR)                                                                                                                                                                                            
  * Weather (XOAP)                                                                                                                                                                                             
  * wireless                                                                                                                                                                                                   
  * support for IBM/Lenovo notebooks                                                                                                                                                                           
  * builtin default configuration                                                                                                                                                                              
  * old configuration syntax                                                                                                                                                                                   
  * Imlib2                                                                                                                                                                                                     
  * apcupsd                                                                                                                                                                                                    
  * iostats                                                                                                                                                                                                    
  * ncurses                                                                                                                                                                                                    
  * Internationalization support                                                                                                                                                                               
 X11:                                                                                                                                                                                                          
  * Xdamage extension                                                                                                                                                                                          
  * XDBE (double buffer extension)                                                                                                                                                                             
  * Xft                                                                                                                                                                                                        
  * ARGB visual                                                                                                                                                                                                
  * Own window                                                                                                                                                                                                 
                                                                                                                                                                                                               
 Music detection:                                                                                                                                                                                              
  * MPD                                                                                                                                                                                                        
  * MOC                                                                                                                                                                                                        
                                                                               
 Default values:                                                               
  * Netdevice: eth0                                                            
  * Local configfile: $HOME/.conkyrc                                           
  * Localedir: /usr/share/locale                                               
  * Maximum netdevices: 64                                                     
  * Maximum text size: 16384                                                   
  * Size text buffer: 256 

Config_snip

--# ---------- End Miscellaneous Section
	update_interval = 2,
	
	lua_load = '/home/unklar/LUA/draw-bg.lua',
	lua_draw_hook_pre = 'main'
-- ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}
-- ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\

};

conky.text = [[
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.5}\
${font Monofur:size=15}${color2}The Next 16 Hours${font} ${membar 1}${texeci 600 bash $HOME/1c_accuweather_images_hourly/1c}
${image $HOME/1_pixel_images/black_1.png -p 560,11 -s 2x388}${image $HOME/1_pixel_images/yellow_1.png -p 560,11 -s 1x388}
${execpi 600 sed -n '1,26p' $HOME/1c_accuweather_images_hourly/altogether16} 
]];

Error Msg

[unklar@archhost ~]$ conky: llua_load: /home/unklar/LUA/draw-bg.lua:79: module 'cairo' not found:
        no field package.preload['cairo']
        no file '/usr/share/lua/5.3/cairo.lua'
        no file '/usr/share/lua/5.3/cairo/init.lua'
        no file '/usr/lib/lua/5.3/cairo.lua'
        no file '/usr/lib/lua/5.3/cairo/init.lua'
        no file './cairo.lua'
        no file './cairo/init.lua'
        no file '/usr/lib/conky/libcairo.so'
        no file '/usr/lib/lua/5.3/cairo.so'
        no file '/usr/lib/lua/5.3/loadall.so'
        no file './cairo.so'
conky: desktop window (240000f) is subwindow of root window (4a5)
conky: window type - normal
conky: drawing to created window (0x3a00002)
conky: drawing to double buffer
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_draw_bg execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_draw_bg execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
wget: Kein Prozess gefunden
--2016-03-17 11:02:27--  http://www.accuweather.com/en/de/lichtenstein/09350/current-weather/171261
Auflösen des Hostnamens »www.accuweather.com (www.accuweather.com)« … 104.121.76.72, 104.121.76.82
Verbindungsaufbau zu www.accuweather.com (www.accuweather.com)|104.121.76.72|:80 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: nicht spezifiziert [text/html]
Wird in »»/home/unklar/1c_accuweather_images_hourly/curr_cond_raw«« gespeichert.
...

If
>> draw_bg.lua >> Line 79 >> require 'cairo'
from version 1.10
is removed, but then the whole thing is pointless?  tongue

With Conky1.9 that works excellently. big_smile

Offline

#692 2016-03-17 12:09:13

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

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

Hi unklar

Yea conky v1.10 isn't fit for public use - In My Humble Opinion.


Next: you are calling the script to work twice.  Not good.

lua_load = '/home/unklar/LUA/draw-bg.lua',
    lua_draw_hook_pre = 'main'
-- ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}
-- ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\

};

conky.text = [[
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.5}\


Above TEXT: this is a must:

lua_load /media/5/Conky/LUA/draw-bg.lua

Then to get it to work: 3 options, of which you ONLY USE ONE.
The first two go above TEXT as well :

lua_draw_hook_pre main 
lua_draw_hook_post main

_pre = before | _post = after:  the main conky is displayed  These DO NOT WORK WELL with images and ARGB set.

And (again with no ARGB) the one option after TEXT:

TEXT
 ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}\

and that is:

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height colour alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position l|r
3 = 0             y_position u|d
4 = 0             width
5 = 0             height
6 = 0x000000      colour
7 = 0.4           alpha

If you use the _pre or _post method you have the "corner_radius x_position y_position width height colour alpha" setting inside the actual LUA script and need to created separate files for different settings.


For me:

 lua_load /path/to/the_script/draw_bg.lua
 TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}\

is the only way it works in conky (v1.9) that has images while running a composite manager and ARGB turned off.

Again @unklar:  Grab the images I posted a link to a few posts back and resize one of the black 10x10 semi-transparent images and resize it to something slightly larger than conky window:

minimum_size 1040 300
maximum_width 1040

in this case 1050x320, maybe call it black_30_1040_320.png and call it up just after text:

TEXT
${image /path/to/black_30_1040_320.png}

if you find - and you probably will, that it doesn't cover the top and left sides by a few pixels that will be because of the "border" settings - simply add a negative position setting of a few pixels:

TEXT
${image /path/to/black_30_1040_320.png -p -5,-5}

By making the image the size you want and NOT resizing it in the ${image ...} command you are saving CPU resources.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#693 2016-03-17 13:01:36

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

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

@S11
If you knew the number of the past hours that are going to appear, would it be of any help?


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

#694 2016-03-17 14:17:23

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

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

YES!  Because then it wouldn't depend on the system time but on the "current" files collected and used.

So that would be from: 0 to 8 right?

I'd hug ya but my arms are too short to reach Greece.  smile
Please note that would be a brotherly man type hug.  cool
Or my wife will killseverly damage me.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#695 2016-03-17 14:49:50

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

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

Alright then.
In the script, the following lines (#413-#418)

while [[ $current_time != $test_hour ]] && (( $i <= 9 ))
	do
		((past_hours++))
		((i++))
		test_hour=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw0 | sed 's/^.*\://')
	done

are a loop to calculate the hours for which accuweather provides past weather info. The number of hours is stored in the past_hours variable.

If you add a couple more lines, ie.

while [[ $current_time != $test_hour ]] && (( $i <= 9 ))
	do
		((past_hours++))
		((i++))
		test_hour=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw0 | sed 's/^.*\://')
	done
rm $HOME/1c_accuweather_images_hourly/no_of_past_hours
echo $past_hours > $HOME/1c_accuweather_images_hourly/no_of_past_hours

you'd have a file called no_of_past_hours that contains the number you want.

Waiting for that hug.

Last edited by TeoBigusGeekus (2016-03-17 16:39:05)


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

#696 2016-03-17 15:59:09

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:

Alright then.

Waiting for that hug.

AWESOME!  Works as advertised!!!

Here's a Canuck Style Hug for ya!
Cool_Canuck_HUG.jpg
You are the best!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#697 2016-03-17 16:39:39

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

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

wink
Anytime buddy!


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

#698 2016-03-17 17:48:50

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

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

And it's done!

1. ran the 8-8.conky to get the updated data with the 'no_of_past_hours' file.
2. added a call to show the results of the 'no_of_past_hours' file. ( next 8 hours (8) )
2. removed the line calling the script.
3. manually edited the 'no_of_past_hours' file to get the location of the "line"

Under Construction at the 4 hour mark:
2016_03_17_13_59_50_Scrot11.jpg

a couple of other construction shots:
2016_03_17_14_06_03_Scrot11.jpg 2016_03_17_14_06_31_Scrot11.jpg

With 0 hours - between 00:00 and 01:00
2016_03_17_14_05_36_Scrot11.jpg

and a completed working 8-8.conky:
2016_03_17_14_14_08_Scrot11.jpg

And of course what does this (WARNING: check the paths)

TEXT
 ${texeci 600 bash /media/5/Conky/1c_accuweather_images_hourly_test/1c_test2}\
 ${lua conky_draw_bg 0 0 0 0 0 0x000000 0.5}\
${font Monofur:size=15}${color2}Weather for the last and the next 8 hours${font} ${membar 0}
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="0"}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="1"}\
${image /media/5/Conky/images/black_1.png -p 143,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 143,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="2"}\
${image /media/5/Conky/images/black_1.png -p 203,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 203,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="3"}\
${image /media/5/Conky/images/black_1.png -p 263,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 263,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="4"}\
${image /media/5/Conky/images/black_1.png -p 323,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 323,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="5"}\
${image /media/5/Conky/images/black_1.png -p 383,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 383,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="6"}\
${image /media/5/Conky/images/black_1.png -p 443,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 443,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="7"}\
${image /media/5/Conky/images/black_1.png -p 503,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 503,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="8"}\
${image /media/5/Conky/images/black_1.png -p 563,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 563,30 -s 1x366}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${execpi 600 sed -n '1,26p' /media/5/Conky/1c_accuweather_images_hourly_test/altogether8_plus_8}

I'll be testing this for a bit yet.
Teo - You Rock!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#699 2016-03-17 18:29:29

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

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

Looks awesome S11!
Nice work.


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

#700 2016-03-17 18:52:46

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

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

Your work, all I did was change the font and add a line.  smile

But it does look nice.

For people that don't want to use the lua background script, or can't, a 30% transparent image:

TEXT
${font Monofur:size=15}${color2}Weather for the last and the next 8 hours${font} ${membar 0}\
 ${image /media/5/Conky/images/bk_30_1100_450.png -p -5,-5}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="0"}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="1"}\
${image /media/5/Conky/images/black_1.png -p 143,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 143,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="2"}\
${image /media/5/Conky/images/black_1.png -p 203,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 203,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="3"}\
${image /media/5/Conky/images/black_1.png -p 263,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 263,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="4"}\
${image /media/5/Conky/images/black_1.png -p 323,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 323,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="5"}\
${image /media/5/Conky/images/black_1.png -p 383,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 383,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="6"}\
${image /media/5/Conky/images/black_1.png -p 443,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 443,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="7"}\
${image /media/5/Conky/images/black_1.png -p 503,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 503,30 -s 1x366}${else}\
${if_match "${execpi 600 sed -n '1p' /media/5/Conky/1c_accuweather_images_hourly_test/no_of_past_hours}"=="8"}\
${image /media/5/Conky/images/black_1.png -p 563,30 -s 2x366}${image /media/5/Conky/images/yellow_1.png -p 563,30 -s 1x366}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${execpi 600 sed -n '1,26p' /media/5/Conky/1c_accuweather_images_hourly_test/altogether8_plus_8}

2016_03_17_16_07_06_Scrot11.jpg

The image: bk_30_1100_450.png - looks like a grey nothing, but trust me, it is there.   cool


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

Board footer

Powered by FluxBB