SEARCH

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

You are not logged in.

#551 2012-12-29 15:15:28

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Hello TeoBigusGeekus and Sector11 im a big fan of your conky, its amazing what you two can produce,  I'm new to this stuff and wanted to use your int(1d1) for a canadian location because the USA use imperial and i want metric, anyhoo im having problems with it. i ran the script, and i see the files in the directory but the script itself can't find them, or the images. I chmod the dir to 0777 recursive. its the only conky that is running, cuz i havent figured out to run more than that at once(noob). Help?

Thank You Inadvance

PS. using Archlinux OS

$ sudo  ~/.conkyrc_acc_int_images
/home/rogue/.conkyrc_acc_int_images: line 2: own_window: command not found
/home/rogue/.conkyrc_acc_int_images: line 3: own_window_type: command not found
/home/rogue/.conkyrc_acc_int_images: line 4: own_window_transparent: command not found
/home/rogue/.conkyrc_acc_int_images: line 5: own_window_hints: command not found
/home/rogue/.conkyrc_acc_int_images: line 8: double_buffer: command not found
/home/rogue/.conkyrc_acc_int_images: line 11: use_spacer: command not found
/home/rogue/.conkyrc_acc_int_images: line 12: use_xft: command not found
/home/rogue/.conkyrc_acc_int_images: line 15: update_interval: command not found
/home/rogue/.conkyrc_acc_int_images: line 18: minimum_size: command not found
/home/rogue/.conkyrc_acc_int_images: line 19: maximum_width: command not found
/home/rogue/.conkyrc_acc_int_images: line 21: override_utf8_locale: command not found
/home/rogue/.conkyrc_acc_int_images: line 24: draw_shades: command not found
/home/rogue/.conkyrc_acc_int_images: line 27: draw_outline: command not found
/home/rogue/.conkyrc_acc_int_images: line 28: draw_borders: command not found
/home/rogue/.conkyrc_acc_int_images: line 30: xftfont: command not found
/home/rogue/.conkyrc_acc_int_images: line 31: uppercase: command not found
/home/rogue/.conkyrc_acc_int_images: line 34: stippled_borders: command not found
/home/rogue/.conkyrc_acc_int_images: line 37: border_margin: command not found
/home/rogue/.conkyrc_acc_int_images: line 40: border_width: command not found
/home/rogue/.conkyrc_acc_int_images: line 43: default_color: command not found
/home/rogue/.conkyrc_acc_int_images: line 45: own_window_colour: command not found
/home/rogue/.conkyrc_acc_int_images: line 46: own_window_transparent: command not found
/home/rogue/.conkyrc_acc_int_images: line 49: alignment: command not found
/home/rogue/.conkyrc_acc_int_images: line 55: gap_x: command not found
/home/rogue/.conkyrc_acc_int_images: line 56: gap_y: command not found
/home/rogue/.conkyrc_acc_int_images: line 58: imlib_cache_size: command not found
/home/rogue/.conkyrc_acc_int_images: line 61: TEXT: command not found
/home/rogue/.conkyrc_acc_int_images: line 62: ${font Arial:size=12}${color ffe595}WEATHER: bad substitution
/home/rogue/.conkyrc_acc_int_images: line 63: ${image $HOME/Accuweather_Conky_Int_Images/cc.png -p 0,60 -s 180x108}: bad substitution
/home/rogue/.conkyrc_acc_int_images: line 64: syntax error near unexpected token `('
/home/rogue/.conkyrc_acc_int_images: line 64: `${font Arial:size=10}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_Int_Images/messages}${font}${goto 200}${color ffe595}TEMP: $color${alignr}${execpi 600 sed -n '29p' $HOME/Accuweather_Conky_Int_Images/curr_cond}C (${execpi 600 sed -n '30p' $HOME/Accuweather_Conky_Int_Images/curr_cond}C)'

Last edited by RogueSurfer (2012-12-29 16:23:48)

Offline

Be excellent to each other!

#552 2012-12-29 16:49:43

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

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

RogueSurfer wrote:

Hello TeoBigusGeekus and Sector11 im a big fan of your conky, its amazing what you two can produce,  I'm new to this stuff and wanted to use your int(1d1) for a canadian location because the USA use imperial and i want metric, anyhoo im having problems with it. i ran the script, and i see the files in the directory but the script itself can't find them, or the images. I chmod the dir to 0777 recursive. its the only conky that is running, cuz i havent figured out to run more than that at once(noob). Help?

Thank You Inadvance

PS. using Archlinux OS

Welcome, one Canuck to another, RogueSurfer.

OH!!!  Don't put me in the same class as Teo, he's the genius and this is his script.  Not mine or even ours by a long shot!

I couldn't write something like this if I had too.

I'm just a "layout" guy that, like you, likes and appreciates Teo's hard work.

When you downloaded the script and extracted it to your home directory:

~/TeoBigusGeekus_Conky_Weather_Scripts_10-12-12/

move the subdirectory: ~/1d1_Accuweather_INT_Images/Accuweather_Conky_Int_Images

to: ~/Accuweather_Conky_Int_Images

and: ~/1d1_Accuweather_INT_Images/.conkyrc_acc_int_images

to: /.conkyrc_acc_int_images

now test it:

if you have a conky running:

killall conky && conky -c ~/.conkyrc_acc_int_images &

if not:

conky -c ~/.conkyrc_acc_int_images &

That will get you started, it won't be Canada but it will work if you did everything right.

More than one conky ... check out Conky PitStop (CPS) in my sig: Tips and Tricks section: Start/Stop Conky (en)

You edited it while I did this....  you do not need "sudo" to run this conky. ... or any for that matter.

Last edited by Sector11 (2012-12-29 16:59:05)


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

Offline

#553 2012-12-29 21:25:19

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Thank you Sector11 that worked beautifully mate thanks, now unto conkypitstop big_smile

Offline

#554 2012-12-29 21:37:38

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

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

^ And Teo's scripts have another happy customer.  big_smile


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

Offline

#555 2012-12-29 22:32:37

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Thank you Teo smile , Sector got that  Conky PitStop script to work smile  happy days ahead, thanks guys

Offline

#556 2012-12-29 22:48:32

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

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

RogueSurfer wrote:

Thank you Teo smile , Sector got that  Conky PitStop script to work smile  happy days ahead, thanks guys


Happy New Year!


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

Offline

#557 2012-12-29 23:17:53

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Offline

#558 2012-12-30 09:22:06

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

Thanks to both of you Sector11 and RogueSurfer for your kind words.
@RogueSurfer: your screenshot shows a problem with the forecast's current conditions. Is it corrected now?
If not, can you post your location?


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

#559 2012-12-30 13:05:02

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

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

Good morning Teo.  Hope Santa was good to you.  Obviously he missed Civil 3D and Archicad on Linux.

I didn't have time to address RogueSurfer's problem yesterday. Glad you're at it.

Wishing you and yours a Happy New Year!


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

Offline

#560 2012-12-30 13:24:27

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Good morning TeoBigusGeekus sir, my current stats is showing the information now, and now the info is cutoff on the right, im guessing its not the width of the conky itself, instead its how the information is pulled from stat, is there a way for me to tweak this so i can see the rest of it. Thank you for the help.

Here is a new shot http://db.tt/Lx3DwxMa

Last edited by RogueSurfer (2012-12-30 13:59:25)

Offline

#561 2012-12-30 14:52:44

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

Sector11 wrote:

Good morning Teo.  Hope Santa was good to you.  Obviously he missed Civil 3D and Archicad on Linux.

I didn't have time to address RogueSurfer's problem yesterday. Glad you're at it.

Wishing you and yours a Happy New Year!

Happy New Year to you too mate! May 2013 be a rocking year for you and anyone you love and care for.

RogueSurfer wrote:

Good morning TeoBigusGeekus sir, my current stats is showing the information now, and now the info is cutoff on the right, im guessing its not the width of the conky itself, instead its how the information is pulled from stat, is there a way for me to tweak this so i can see the rest of it. Thank you for the help.

Here is a new shot http://db.tt/Lx3DwxMa

My guess is that it is the width of the conky. Open your .conkyrc and change the value of the maximum_width variable.


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

#562 2012-12-30 14:57:59

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

TeoBigusGeekus wrote:
Sector11 wrote:

Good morning Teo.  Hope Santa was good to you.  Obviously he missed Civil 3D and Archicad on Linux.

I didn't have time to address RogueSurfer's problem yesterday. Glad you're at it.

Wishing you and yours a Happy New Year!

Happy New Year to you too mate! May 2013 be a rocking year for you and anyone you love and care for.

RogueSurfer wrote:

Good morning TeoBigusGeekus sir, my current stats is showing the information now, and now the info is cutoff on the right, im guessing its not the width of the conky itself, instead its how the information is pulled from stat, is there a way for me to tweak this so i can see the rest of it. Thank you for the help.

Here is a new shot http://db.tt/Lx3DwxMa

My guess is that it is the width of the conky. Open your .conkyrc and change the value of the maximum_width variable.

That was a good educated guess there mate, thank you

Offline

#563 2012-12-30 14:59:19

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

RogueSurfer wrote:
TeoBigusGeekus wrote:
Sector11 wrote:

Good morning Teo.  Hope Santa was good to you.  Obviously he missed Civil 3D and Archicad on Linux.

I didn't have time to address RogueSurfer's problem yesterday. Glad you're at it.

Wishing you and yours a Happy New Year!

Happy New Year to you too mate! May 2013 be a rocking year for you and anyone you love and care for.

RogueSurfer wrote:

Good morning TeoBigusGeekus sir, my current stats is showing the information now, and now the info is cutoff on the right, im guessing its not the width of the conky itself, instead its how the information is pulled from stat, is there a way for me to tweak this so i can see the rest of it. Thank you for the help.

Here is a new shot http://db.tt/Lx3DwxMa

My guess is that it is the width of the conky. Open your .conkyrc and change the value of the maximum_width variable.

That was a good educated guess there mate, thank you

You're welcome. Happy new year to you too my friend!


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

#564 2012-12-30 15:03:12

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

TeoBigusGeekus wrote:
RogueSurfer wrote:
TeoBigusGeekus wrote:

Happy New Year to you too mate! May 2013 be a rocking year for you and anyone you love and care for.


My guess is that it is the width of the conky. Open your .conkyrc and change the value of the maximum_width variable.

That was a good educated guess there mate, thank you

You're welcome. Happy new year to you too my friend!

Thank you, Happy new to you as well, may it bring peace and happiness to you and loved ones.

Offline

#565 2013-01-03 16:49:18

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

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

This actually took a few days to do, life kept getting in the way.  So to relax, I worked on a conky.

On the left is the default conky that comes with 1d1_Accuweather_INT_Images on the right a new layout.

Both are set to use General Urquiza, CABA, Argentina.
abxF0dOy.jpg

The conky:

# killall conky && conky -c /media/5/Conky/Accuweather/Teo_Clock_Gen_Urquiza_AccuW.conky &
#
# Thank you:
# Chronograph LUA - mrpeachy (originally 4 clocks - tweaked by Sector11)
# v9000 LUA weather - mrpeachy
# background - londonali1010, mrpeachy, dk75
# TeoBigusGeekus - for the weather scripts

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Teo Weather Clock General Urquiza

# 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

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0

#minimum_size 420 420  ## width, height
#maximum_width 420     ## width

### For use with The-Clock.lua
minimum_size 300 0  ## width, height
maximum_width 300     ## width

gap_x 10 #15        ### left &right
gap_y 10        ### up & down

### alignment values or top_left, bottom_right, etc
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment top_right

####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=11
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
#color1 C2CCFF # Not a clue - a blue #778899 #119 136 153	LightSlateGray
color1 AFEEEE #175 238 238	PaleTurquoise
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background 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 256

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

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes


imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

## default bar size
default_bar_size 200 20

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## draw-bg.lua - Above and After TEXT - requires a composite manager.
##
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
# ----------------------------------------------------------------------------
## OR Both above TEXT - No composite manager required.
#
#lua_load ~/Conky_WeatherCom_metric/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.3
#
# TEXT
### Teo Weather Clock ########################################################
lua_load /media/5/Conky/LUA/Teo_Weather_Clock.lua
lua_draw_hook_post main
##############################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}\
${lua conky_draw_bg 123 30 30 246 246 0xffffff 0.2}\
${texeci 500 bash /media/5/Conky/Accuweather/acc_int_images}\
${font monofur:size=24}${color7}${execi 600 sed -n '29p' /media/5/Conky/Accuweather/curr_cond}°${alignr}${color5}${execi 600 sed -n '30p' /media/5/Conky/Accuweather/curr_cond}°${font}
${color7}Temp${alignr 15}${color5}±${font}





${image /media/5/Conky/Accuweather/cc.png -p 102,120 -s 90x54}








${color}Today${alignr}${color1}Tonight${color}
${color5}↑ ${color2}${execi 600 sed -n '26p' /media/5/Conky/Accuweather/first_days}°${alignr}${color5}↓ ${color7}${execi 600 sed -n '31p' /media/5/Conky/Accuweather/first_days}°
${image /media/5/Conky/Accuweather/tod.png -p 0,280 -s 120x72}${image /media/5/Conky/Accuweather/ton.png -p 180,280 -s 120x72}



${color5}± ${execi 600 sed -n '27p' /media/5/Conky/Accuweather/first_days}°${alignr}± ${execi 600 sed -n '32p' /media/5/Conky/Accuweather/first_days}°
${goto 60} ${color5}SUN${goto 100}${color}↑ ${execi 600 sed -n '39p' /media/5/Conky/Accuweather/curr_cond}${goto 180}${color1}↓ ${execi 600 sed -n '40p' /media/5/Conky/Accuweather/curr_cond}
${goto 60}${color5}MOON ${goto 100}${color}↑ ${execi 600 sed -n '41p' /media/5/Conky/Accuweather/curr_cond}${goto 180}${color1}↓ ${color1}${execi 600 sed -n '42p' /media/5/Conky/Accuweather/curr_cond}
${color5}Humidity ${color7}${execi 600 sed -n '33p' /media/5/Conky/Accuweather/curr_cond}${alignr 5}${color5}Dew Point ${color7}${execi 600 sed -n '37p' /media/5/Conky/Accuweather/curr_cond}°${color}
${color5}Pressure ${color7}${execi 600 sed -n '34p' /media/5/Conky/Accuweather/curr_cond}${alignr 5}${color5}UV Index ${color7}${execi 600 sed -n '36p' /media/5/Conky/Accuweather/curr_cond}
${color5}Wind ${color7}${execi 600 sed -n '31p' /media/5/Conky/Accuweather/curr_cond} ${execi 600 sed -n '32p' /media/5/Conky/Accuweather/curr_cond}\
${alignr 5}${color5}Cloud Cover ${color7}${execi 600 sed -n '35p' /media/5/Conky/Accuweather/curr_cond}
${alignc}${color5}Visibility ${color7}${execi 600 sed -n '38p' /media/5/Conky/Accuweather/curr_cond}
 ${color1}${stippled_hr 5 1}
${color5}${execi 600 sed -n '5p' /media/5/Conky/Accuweather/first_days}${goto 113}${execi 600 sed -n '10p' /media/5/Conky/Accuweather/first_days}${goto 217}${execi 600 sed -n '15p' /media/5/Conky/Accuweather/first_days}
${image /media/5/Conky/Accuweather/6.png -p 0,475 -s 90x54}${image /media/5/Conky/Accuweather/11.png -p 110,475 -s 90x54}${image /media/5/Conky/Accuweather/16.png -p 210,475 -s 90x54}


↑ ${color2}${execi 600 sed -n '8p' /media/5/Conky/Accuweather/first_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '9p' /media/5/Conky/Accuweather/first_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '13p' /media/5/Conky/Accuweather/first_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '14p' /media/5/Conky/Accuweather/first_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '18p' /media/5/Conky/Accuweather/first_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '19p' /media/5/Conky/Accuweather/first_days}

${color5}${execi 600 sed -n '20p' /media/5/Conky/Accuweather/first_days}${goto 113}${execi 600 sed -n '1p' /media/5/Conky/Accuweather/last_days}${goto 217}${execi 600 sed -n '6p' /media/5/Conky/Accuweather/last_days}
${image /media/5/Conky/Accuweather/21.png -p 0,565 -s 90x54}${image /media/5/Conky/Accuweather/last_2.png -p 106,565 -s 90x54}${image /media/5/Conky/Accuweather/last_7.png -p 210,565 -s 90x54}


↑ ${color2}${execi 600 sed -n '23p' /media/5/Conky/Accuweather/first_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '24p' /media/5/Conky/Accuweather/first_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '4p' /media/5/Conky/Accuweather/last_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '5p' /media/5/Conky/Accuweather/last_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '9p' /media/5/Conky/Accuweather/last_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '10p' /media/5/Conky/Accuweather/last_days}

${color5}${execi 600 sed -n '11p' /media/5/Conky/Accuweather/last_days}${goto 113}${execi 600 sed -n '16p' /media/5/Conky/Accuweather/last_days}${goto 217}${execi 600 sed -n '21p' /media/5/Conky/Accuweather/last_days}
${image /media/5/Conky/Accuweather/last_12.png -p 0,655 -s 90x54}${image /media/5/Conky/Accuweather/last_17.png -p 106,655 -s 90x54}${image /media/5/Conky/Accuweather/last_22.png -p 210,655 -s 90x54}


↑ ${color2}${execi 600 sed -n '14p' /media/5/Conky/Accuweather/last_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '15p' /media/5/Conky/Accuweather/last_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '19p' /media/5/Conky/Accuweather/last_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '20p' /media/5/Conky/Accuweather/last_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '24p' /media/5/Conky/Accuweather/last_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '25p' /media/5/Conky/Accuweather/last_days}
 ${color1}${stippled_hr 5 1}
 ${color3}With ${color}${nodename} ${color3}for the past: ${color}${uptime_short}
 ${color3}Kernel: ${color}${kernel}
 ${color3}CPU ${color7}1: ${color}${if_match ${cpu cpu1}<10}  ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}\
${endif}${endif} %\
 ${color7}2: ${color}${if_match ${cpu cpu2}<10}  ${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100} ${cpu cpu2}\
${else}${cpu cpu2}\
${endif}${endif} %\
 ${color7}3: ${color}${if_match ${cpu cpu3}<10}  ${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100} ${cpu cpu3}\
${else}${cpu cpu3}\
${endif}${endif} %\
 ${color7}Avg: ${color}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}\
${endif}${endif} %
 ${color3}CPU: ${color}${platform f71882fg.2560 temp 1}°${goto 90}${color3}SDA: ${color}${execi 15 hddtemp -n /dev/sda}°${goto 167}${color3}GPU: ${color}${nvidia temp}°${goto 245}${color3}MB: ${color}${platform f71882fg.2560 temp 2}°
 ${color3}RAM: ${color}${mem} / ${memmax} / ${memperc}% ${alignr 5}${color3}Swap: ${color}${swap} ${color}/ ${color}${swapmax}
 ${color3}eth-0 ${color7}Down: ${color}${downspeedf eth0}${goto 200}${color7}Up:  ${color}${upspeedf eth0}
 ${color1}${stippled_hr 5 1}

Teo_Weather_Clock.lua - the 24 hour clock adapted for Teo's scripts.

--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
 21 Jun 2012 - Chronograph modifications by Sector11
 22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
 12 Nov 2012 - memory leak plugged - mrpeachy
 14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
 26 Nov 2012 - The Clock - Sector11 (small version)

use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

 -- INDEX use search|find with: -- ### sonething ###

 -- ### CLOCK POSITION - AND DEFAULTS ###
 -- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
 --     See lines 39 to 41 for overall size changes
 -- ### START DIAL B ### Day Names Dial ###
 --     See Lines 77 - 79 and 145 for changes
 -- ### START DIAL C ### Month Names Dial ###
 --     See Lines 143 -145 and 192 for changes
 -- ### START DIAL D ### Day Numbers Dial ###
 --     See Lines 226 & 257 for  changes
 -- ### START CLOCK A ###
 --     See Lines  &  and 456 & 483 changes
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
 -- CLOCK A HOUR HAND
 -- CLOCK A MINUTE HAND SETUP
 -- CLOCK A SECOND HAND SETUP
 -- PART SECOND HAND Lines: 503 519, 531

NOTE:  Putting ### CLOCK A ### last insures that it's functions are written
       over the other dials.
]]

require 'cairo'
 -- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=153, --from 135 = +40
center_y=153, --from 135
radius=140,
lang="English", -- English French Greek Spanish
hour=24, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
handday=false, -- DAY NAME hand - true or false
--handdaynum=false, -- DAY NUMBER hand - true or false
handmonth=false, -- MONTH NAME hand - true or false
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}

 -- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)

function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)

 -- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
 -- ############################ CLOCK 12|24 HR SELECTOR ###

 -- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
 -- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
 -- gap from clock border to minute marks
local b_to_m=0
 -- #################### SET BORDER OPTIONS FOR "CLOCKS" ###

 -- ### START DIAL B ### Day Names Dial ####################
 -- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=42
 -- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end

local day_number=tonumber(os.date("%w"))
if init.handday == true then
  for i=1,7 do
 -- work out points
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
else
  for i=1,7 do -- working out points
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active day names
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=27
  for i=1,7 do
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL B ###

 -- ### START DIAL C ### Month Names Dial ##################
 -- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=73
 -- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end

local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
  for i=1,12 do
 -- OUTER POINTS POSTION FOR -- ### START DIAL C ## TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
else
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,1) -- active month colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
    end
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=58
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	 else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
    end
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL C ###

 -- ### START DIAL D ### Day Numbers Dial ##################
 -- GET NUMBER OF DAYS IN CURRENT MONTH
 -- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
  febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
  febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
 -- MONTH TABLE to get number of days
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
 -- TEXT positioning DAY #'s
local center_x=init.center_x
local center_y=init.center_y
local radius=105
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
  for i=1,number_days do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    --only print even numbers
    if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
    text=string.format("%02d",i) --formats numbers to double digits
    elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
    text=string.format("%02d",i) --formats numbers to double digits
    else
    text=""
    end --odd even matching
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	else
	cairo_set_source_rgba (cr,1,1,1,0.35) -- dim inactive numbers
	end
     cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
     cairo_show_text (cr, text)
     cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=90
  for i=1,number_days do
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	else
	cairo_set_source_rgba (cr,1,1,1,0.35) -- dim the points
	end
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
 -- ######################################### END DIAL D ###

 -- ### START CLOCK A ######################################
 -- SET MARKS ###
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
 -- set mark length
local m_length_A=0 -- doesn't work but can't delete
 -- set mark width
local m_width_A=0 -- doesn't work but can't delete
 -- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
 -- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
 -- SETUP HOUR HANDS ###
 -- CLOCK A HOUR HAND
hh_length_A=90
 -- set hour hand width
hh_width_A=4
 -- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
 -- set hour hand color
 -- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
 -- SETUP MINUTE HANDS ###
 -- CLOCK A MINUTE HAND SETUP
 -- set length of minute hand
mh_length_A=123
 -- set minute hand width
mh_width_A=2
 -- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
 -- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work

 -- SETUP SECOND HAND ###
 -- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
 -- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
 -- set hour hand width
--sh_width_A=2
 -- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
 -- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red

 -- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
  local arc=(math.pi/180)*((360/60)*seconds)
  --calculate point 1
  local radius1=120
  local x1=0+radius1*math.sin(arc)
  local y1=0-radius1*math.cos(arc)
  --calculate point 2
  local radius2=130
  local x2=0+radius2*math.sin(arc)
  local y2=0-radius2*math.cos(arc)
  --draw line connecting points
  cairo_move_to (cr, center_x+x1,center_y+y1)
  cairo_line_to (cr, center_x+x2, center_y+y2)
  cairo_set_source_rgba (cr,255/255,0/255,0/255,1) -- PART SECOND HAND
  cairo_stroke (cr)
end

 -- CLOCK A ### 12 HR TIME ###
 -- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
 -- DRAWING CODE
 -- DRAW MARKS
 -- stuff that can be moved outside of the loop, needs only be set once
 -- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
 -- set line cap type
cairo_set_line_cap  (cr, m_cap)
 -- set line width
cairo_set_line_width (cr,m_width_A)
 -- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
 -- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
 -- drawing code using the value of i to calculate degrees
 -- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
 -- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- draw the line
cairo_stroke (cr)
end -- of for loop
 -- HOUR MARKS -- ???????????????????????????????????????????????????????????????
 -- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
 -- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
 -- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
 -- convert minutes to seconds
m_to_s=minutes*60
 -- get current seconds
seconds=tonumber(os.date("%S"))
 -- DRAW HOUR HAND ###
 -- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
 -- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
 -- set radius to calculate hand points
radius=hh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,0,1,1,0.7) -- active colour Hour Hand ================
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
 -- DRAW MINUTE HAND
 -- get minutes and seconds just as seconds
msecs=m_to_s+seconds
 -- calculate degrees for each second
msec_degs=msecs*0.1
 -- set radius to calculate hand points
radius=mh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,0,1,1,0.7) -- active colour Minute Hand ==============
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
 -- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "DS-Digital", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 22)
cairo_set_source_rgba (cr,1,1,1,1.0) -- HR Clock numbers
 -- TABLE OF TEXT -- in order
if init.hour == 12 then
  text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
  for i=1,12 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_set_source_rgba (cr,1,1,1,1.0) -- colour of HR Numbers
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=124 -- 12 HR Clock
  for i=1,12 do
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0.50)
    cairo_stroke (cr)
  end
end
if init.hour == 24 then
  text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
  for i=1,24 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=124 -- 24 HR Clock
  for i=1,24 do
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0.4)
    cairo_stroke (cr)
  end
end

 -- ############################################################################
 -- POSITION FOR TEXT HOUR NUMBERS
  if init.hour == 12 and init.second == true then
    text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
 -- INNER POINTS POSITION, radius smaller than text circle
    cairo_set_source_rgba (cr,1,1,1,0.07) -- does not work -- settings moved
    cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    for i=1,60 do
      local radius=124 -- dots for seconds Clock A (12 dial)
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
      if seconds == i-1 then
        cairo_set_source_rgba (cr,255/255,0/255,0/255,0.07) -- does not work - settings moved
      else
        if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
          cairo_set_source_rgba (cr,0,1,1,1) -- active colour
        else
          cairo_set_source_rgba (cr,0,1,1,0.0) -- dots for seconds A Clock
        end
      end
      cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
      cairo_stroke (cr)
    end
    radius=radius-3
    cairo_set_font_size (cr, 10)
    for i=1,60 do
 -- OUTTER POINTS POSTION FOR TEXT
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
      local text=text_days[i]--gets text from table
      if seconds == tonumber(text) then
      cairo_set_source_rgba (cr,0,1,1,1.0) -- active colour
      else
        cairo_set_source_rgba (cr,1,1,1,0.15) -- seconds numbers
      end
      cairo_text_extents(cr,text,extents)
      local width=extents.width
      local height=extents.height
      cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
      cairo_show_text (cr, text)
      cairo_stroke (cr)
    end
  end
 -- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
--[[ mrpeachy wrote:

    the numbers are drawn using a for loop somewhere, like this

    for i=1,12 do
    calculate position of number
    move_to(x,y)
    show_text(i)
    end

    change it to something like this

    for i=1,12 do
    calculate position of number
      if i==month_number then
      move_to(x,y)
      show_text(month_number)
      else
      move_to(x,y)
      show_text(i)
      end
    end ]]

draw-bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

 lua_load ~/wea_conky/draw_bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

OR Both above TEXT (no composite manager required - no blinking!)
@Mr Peachy
 lua_load ~/wea_conky/draw_bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
 TEXT

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

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

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

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

######### calendar function ##################################################

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf		or "mono"
local tfontsize=caltab.tfs	or 12
local tc=caltab.tc			or 0xffffff
local ta=caltab.ta			or 1
local bfont=caltab.bf		or "mono"
local bfontsize=caltab.bfs	or 12
local bc=caltab.bc			or 0xffffff
local ba=caltab.ba			or 1
local hfont=caltab.hf		or "mono"
local hfontsize=caltab.hfs	or 12
local hc=caltab.hc			or 0xff0000
local ha=caltab.ha			or 1
local spacer=caltab.sp		or " "
local gaph=caltab.gh		or 20
local gapt=caltab.gt		or 15
local gapl=caltab.gv		or 15
local sday=caltab.sd		or 0
local hstyle=caltab.hstyle	or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
    if i<=start_day then
    dnum[i]="  "
    else
    dn=i-start_day
        if dn=="nil" then dn=0 end
        if dn<=9 then dn=(spacer .. dn) end
        if i>x then dn="" end
        dnum[i]=dn
        dnumh[i]=dn
        if dn==(spacer .. today) or dn==today then
        dnum[i]=""
        end
        if dn==(spacer .. today) or dn==today then
        dnumh[i]=dn
        place=i
        else dnumh[i]="  "
        end
    end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function#######################################################

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

Offline

#566 2013-01-03 19:07:42

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

Awesome work as always Sector11!!!
I've added a link at the first page.


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

#567 2013-01-03 19:28:24

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

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

TeoBigusGeekus wrote:

Awesome work as always Sector11!!!
I've added a link at the first page.

I'm stretching my legs again ... hope to do more if "life" will allow.

Well, it will, but it's slowing me down a lot.  big_smile


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

Offline

#568 2013-01-05 00:34:35

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

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

Here's another one of Teo's scripts, shown with draw-bg.lua and various wallpapers.

1a_accuweather_conky_INT/accuweather_conky
adgjsWzg.jpg
Note: The change from Today to Tonight on the extreme right.  I waited for that to happen.

Using:

minimum_size 140 735  ## width, height
maximum_width 140   ## width

was important to set the size because of all the negative ${voffset} commands to being text up in line.

I have made some changes to the "accuw_script" so that it uses lowercase as well.

The Conky

# killall conky && conky -c /media/5/Conky/accuweather_conky/conkyrc_acc_int &
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph Full 2

# 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

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0

minimum_size 140 735  ## width, height
maximum_width 140   ## width

gap_x 10  ### left &right
gap_y 10  ### up & down

alignment tl #ml
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=12
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 C2CCFF #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background 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 256

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

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
### draw-bg.lua - Above and After TEXT - requires a composite manager ########
# ----------------------------------------------------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
# ============================================================================
## OR Both above TEXT - No composite manager required.
# ----------------------------------------------------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 12 0 0 0 0 0x000000 0.5
# TEXT
#######################################################  End LUA Settings  ###

update_interval 1

TEXT
${lua conky_draw_bg 12 0 0 0 0 0x000000 0.3}\
Looking Out ${hr 2}$color${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}
Now\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}${font}
${voffset -40}   ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/curr_cond}°


${execpi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°
    ↓ ${execpi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '7p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°
    ↓ ${execpi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°
    ↓ ${execpi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°
    ↓ ${execpi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '21p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°
    ↓ ${execpi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
    ↓ ${execpi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '6p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '7p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '9p' /media/5/Conky/accuweather_conky/last_days}°
    ↓ ${execpi 600 sed -n '10p' /media/5/Conky/accuweather_conky/last_days}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '11p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '12p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '14p' /media/5/Conky/accuweather_conky/last_days}°
    ↓ ${execpi 600 sed -n '15p' /media/5/Conky/accuweather_conky/last_days}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '16p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '17p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '19p' /media/5/Conky/accuweather_conky/last_days}°
    ↓ ${execpi 600 sed -n '20p' /media/5/Conky/accuweather_conky/last_days}°
          ${stippled_hr 5 1}
${execpi 600 sed -n '21p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600  sed -n '22p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}    ↑ ${execpi 600 sed -n '24p' /media/5/Conky/accuweather_conky/last_days}°
    ↓ ${execpi 600 sed -n '25p' /media/5/Conky/accuweather_conky/last_days}°

and the accuw_script

#!/bin/bash

#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo a
         ;;
         msu)
           echo b
         ;;
         psu)
           echo c
         ;;
         ic)
           echo c
         ;;
         h)
           echo c
         ;;
         mc)
           echo d
         ;;
         c)
           echo e
         ;;
         d)
           echo e
         ;;
         f)
           echo 0
         ;;
         s)
           echo h
         ;;
         mcs)
           echo g
         ;;
         psus)
           echo g
         ;;
         t)
           echo l
         ;;
         mct)
           echo k
         ;;
         psut)
           echo k
         ;;
         r)
           echo i
         ;;
         fl)
           echo p
         ;;
         mcfl)
           echo o
         ;;
         psfl)
           echo o
         ;;
         sn)
           echo r
         ;;
         mcsn)
           echo o
         ;;
         i)
           echo E
         ;;
         sl)
           echo u
         ;;
         fr)
           echo i
         ;;
         rsn)
           echo v
         ;;
         w)
           echo 6
         ;;
         ho)
           echo 5
         ;;
         co)
           echo E
         ;;
         cl)
           echo A
         ;;
         mcl)
           echo B
         ;;
         pc)
           echo C
         ;;
         pcs)
           echo G
         ;;
         pct)
           echo K
         ;;
        esac
}

#function: test_image_night
test_image_night () {
    case $1 in
		 su)
           echo a
         ;;
         msu)
           echo b
         ;;
         psu)
           echo c
         ;;
         c)
           echo f
         ;;
         d)
           echo f
         ;;
         f)
           echo f
         ;;
         s)
           echo h
         ;;
         psus)
           echo g
         ;;
         t)
           echo l
         ;;
         psut)
           echo k
         ;;
         r)
           echo i
         ;;
         fl)
           echo p
         ;;
         psfl)
           echo o
         ;;
         sn)
           echo r
         ;;
         i)
           echo E
         ;;
         sl)
           echo u
         ;;
         fr)
           echo i
         ;;
         rsn)
           echo v
         ;;
         ho)
           echo 5
         ;;
         co)
           echo E
         ;;
         cl)
           echo A
         ;;
         w)
           echo 6
         ;;
         mcl)
           echo B
         ;;
         pc)
           echo C
         ;;
         ic)
           echo B
         ;;
         h)
           echo B
         ;;
         mc)
           echo C
         ;;
         pcs)
           echo G
         ;;
         mcs)
           echo G
         ;;
         pct)
           echo K
         ;;
         mct)
           echo K
         ;;
         mcfl)
           echo O
         ;;
         mcsn)
           echo O
         ;;
        esac
}

kill -STOP $(pidof conky)
killall wget

#put your Accuweather address here
address="http://www.accuweather.com/en/ar/general-urquiza/1228994/weather-forecast/1228994"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O /media/5/Conky/accuweather_conky/curr_cond_raw "$curr_addr"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O /media/5/Conky/accuweather_conky/tod_ton_raw "$addr1"

addr2="$addr1"?day=6
wget -O /media/5/Conky/accuweather_conky/last_days_raw "$addr2"

#current conditions
if [[ -s /media/5/Conky/accuweather_conky/curr_cond_raw ]]; then

    sed -i '/detail-now/,/#details/!d' /media/5/Conky/accuweather_conky/curr_cond_raw
    egrep -i '"cond"|icon i-|detail-tab-panel' /media/5/Conky/accuweather_conky/curr_cond_raw > /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/&deg/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/curr_cond
	time=$(sed -n 1p /media/5/Conky/accuweather_conky/curr_cond)
    image=$(sed -n 2p /media/5/Conky/accuweather_conky/curr_cond)
	if [[ $time == day ]]; then
	    sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/curr_cond
	elif [[ $time == night ]]; then
	    sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/curr_cond
	fi

fi

#First 5 days
if [[ -s /media/5/Conky/accuweather_conky/tod_ton_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/tod_ton_raw
    egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/tod_ton_raw > /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/tod_ton
 	sed -i -e 's/Early AM/Early AM/' -e 's/Today/Today/' -e 's/Tonight/Tonight/' -e 's/Overnight/Overnight/' -e 's/Mon$/Monday/' -e 's/Tue$/Tuesday/' -e 's/Wed$/Wednesday/' -e 's/Thu$/Thursday/' -e 's/Fri$/Friday/' -e 's/Sat$/Saturday/' -e 's/Sun$/Sunday/' /media/5/Conky/accuweather_conky/tod_ton
    time=$(sed -n 1p /media/5/Conky/accuweather_conky/tod_ton)
    image=$(sed -n 2p /media/5/Conky/accuweather_conky/tod_ton)
	if [[ $time == Today ]]; then
	    sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
	elif [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
	    sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/tod_ton
        sed -i 3a- /media/5/Conky/accuweather_conky/tod_ton
	fi
    for (( i=7; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/tod_ton)
	      sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
	  done

fi

#Next 5 days
if [[ -s /media/5/Conky/accuweather_conky/last_days_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/last_days_raw
    egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/last_days_raw > /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/last_days
	sed -i -e 's/Mon$/Monday/' -e 's/Tue$/Tuesday/' -e 's/Wed$/Wednesday/' -e 's/Thu$/Thursday/' -e 's/Fri$/Friday/' -e 's/Sat$/Saturday/' -e 's/Sun$/Sunday/' /media/5/Conky/accuweather_conky/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/last_days)
	      sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/last_days
	  done

fi

kill -CONT $(pidof conky)

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

Offline

#569 2013-01-05 01:13:30

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

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

A few tweaks to the conky and the accuw_script and it's a little narrower:

1a_accuweather_conky_INT/accuweather_conky Version 2
acn3F9VW.jpg

The edited conky:

# killall conky && conky -c /media/5/Conky/accuweather_conky/conkyrc_acc_int &
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph Full 2

# 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

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0

minimum_size 100 735  ## width, height
maximum_width 100   ## width

gap_x 10  ### left &right
gap_y 10  ### up & down

alignment tl #ml
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=12
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 C2CCFF #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background 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 256

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

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
### draw-bg.lua - Above and After TEXT - requires a composite manager ########
# ----------------------------------------------------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
# ============================================================================
## OR Both above TEXT - No composite manager required.
# ----------------------------------------------------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 12 0 0 0 0 0x000000 0.5
# TEXT
#######################################################  End LUA Settings  ###

update_interval 1

TEXT
${lua conky_draw_bg 12 0 0 0 0 0x000000 0.3}\
Looking Out${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}
Now\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}${font}
${voffset -40} ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/curr_cond}°


${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '7p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°
      ${stippled_hr 5 1}
${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°
      ${stippled_hr 5 1}
${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°
      ${stippled_hr 5 1}
${execi 600 sed -n '21p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°
      ${stippled_hr 5 1}
${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°
      ${stippled_hr 5 1}
${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '7p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/last_days}°
      ${stippled_hr 5 1}
${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '12p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/last_days}°
      ${stippled_hr 5 1}
${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '17p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/last_days}°
      ${stippled_hr 5 1}
${execi 600 sed -n '21p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600  sed -n '22p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/last_days}°

The re-edited accuw_script

#!/bin/bash

#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo a
         ;;
         msu)
           echo b
         ;;
         psu)
           echo c
         ;;
         ic)
           echo c
         ;;
         h)
           echo c
         ;;
         mc)
           echo d
         ;;
         c)
           echo e
         ;;
         d)
           echo e
         ;;
         f)
           echo 0
         ;;
         s)
           echo h
         ;;
         mcs)
           echo g
         ;;
         psus)
           echo g
         ;;
         t)
           echo l
         ;;
         mct)
           echo k
         ;;
         psut)
           echo k
         ;;
         r)
           echo i
         ;;
         fl)
           echo p
         ;;
         mcfl)
           echo o
         ;;
         psfl)
           echo o
         ;;
         sn)
           echo r
         ;;
         mcsn)
           echo o
         ;;
         i)
           echo E
         ;;
         sl)
           echo u
         ;;
         fr)
           echo i
         ;;
         rsn)
           echo v
         ;;
         w)
           echo 6
         ;;
         ho)
           echo 5
         ;;
         co)
           echo E
         ;;
         cl)
           echo A
         ;;
         mcl)
           echo B
         ;;
         pc)
           echo C
         ;;
         pcs)
           echo G
         ;;
         pct)
           echo K
         ;;
        esac
}

#function: test_image_night
test_image_night () {
    case $1 in
		 su)
           echo a
         ;;
         msu)
           echo b
         ;;
         psu)
           echo c
         ;;
         c)
           echo f
         ;;
         d)
           echo f
         ;;
         f)
           echo f
         ;;
         s)
           echo h
         ;;
         psus)
           echo g
         ;;
         t)
           echo l
         ;;
         psut)
           echo k
         ;;
         r)
           echo i
         ;;
         fl)
           echo p
         ;;
         psfl)
           echo o
         ;;
         sn)
           echo r
         ;;
         i)
           echo E
         ;;
         sl)
           echo u
         ;;
         fr)
           echo i
         ;;
         rsn)
           echo v
         ;;
         ho)
           echo 5
         ;;
         co)
           echo E
         ;;
         cl)
           echo A
         ;;
         w)
           echo 6
         ;;
         mcl)
           echo B
         ;;
         pc)
           echo C
         ;;
         ic)
           echo B
         ;;
         h)
           echo B
         ;;
         mc)
           echo C
         ;;
         pcs)
           echo G
         ;;
         mcs)
           echo G
         ;;
         pct)
           echo K
         ;;
         mct)
           echo K
         ;;
         mcfl)
           echo O
         ;;
         mcsn)
           echo O
         ;;
        esac
}

kill -STOP $(pidof conky)
killall wget

#put your Accuweather address here
## address="http://www.accuweather.com/en/gr/chania/182654/weather-forecast/182654"
## address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
## address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"
address="http://www.accuweather.com/en/ar/general-urquiza/1228994/weather-forecast/1228994"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O /media/5/Conky/accuweather_conky/curr_cond_raw "$curr_addr"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O /media/5/Conky/accuweather_conky/tod_ton_raw "$addr1"

addr2="$addr1"?day=6
wget -O /media/5/Conky/accuweather_conky/last_days_raw "$addr2"

#current conditions
if [[ -s /media/5/Conky/accuweather_conky/curr_cond_raw ]]; then

    sed -i '/detail-now/,/#details/!d' /media/5/Conky/accuweather_conky/curr_cond_raw
    egrep -i '"cond"|icon i-|detail-tab-panel' /media/5/Conky/accuweather_conky/curr_cond_raw > /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/&deg/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' /media/5/Conky/accuweather_conky/curr_cond
    sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/curr_cond
	time=$(sed -n 1p /media/5/Conky/accuweather_conky/curr_cond)
    image=$(sed -n 2p /media/5/Conky/accuweather_conky/curr_cond)
	if [[ $time == day ]]; then
	    sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/curr_cond
	elif [[ $time == night ]]; then
	    sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/curr_cond
	fi

fi

#First 5 days
if [[ -s /media/5/Conky/accuweather_conky/tod_ton_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/tod_ton_raw
    egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/tod_ton_raw > /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/tod_ton
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/tod_ton
 	sed -i -e 's/Early AM/E-AM/' -e 's/Today/Day/' -e 's/Tonight/Nite/' -e 's/Overnight/O-nite/' -e 's/Mon$/Mon/' -e 's/Tue$/Tue/' -e 's/Wed$/Wed/' -e 's/Thu$/Thu/' -e 's/Fri$/Fri/' -e 's/Sat$/Sat/' -e 's/Sun$/Sun/' /media/5/Conky/accuweather_conky/tod_ton
    time=$(sed -n 1p /media/5/Conky/accuweather_conky/tod_ton)
    image=$(sed -n 2p /media/5/Conky/accuweather_conky/tod_ton)
	if [[ $time == Day ]]; then
	    sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
	elif [[ $time == Nite || $time == O-nite || $time == "E-AM" ]]; then
	    sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/tod_ton
        sed -i 3a- /media/5/Conky/accuweather_conky/tod_ton
	fi
    for (( i=7; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/tod_ton)
	      sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
	  done

fi

#Next 5 days
if [[ -s /media/5/Conky/accuweather_conky/last_days_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/last_days_raw
    egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/last_days_raw > /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/last_days
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/last_days
	sed -i -e 's/Mon$/Mon/' -e 's/Tue$/Tue/' -e 's/Wed$/Wed/' -e 's/Thu$/Thu/' -e 's/Fri$/Fri/' -e 's/Sat$/Sat/' -e 's/Sun$/Sun/' /media/5/Conky/accuweather_conky/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/last_days)
	      sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/last_days
	  done

fi

kill -CONT $(pidof conky)

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

Offline

#570 2013-01-05 10:26:24

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

Smooth man, thanks again!


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

#571 2013-01-05 14:12:19

RogueSurfer
Member
Registered: 2012-12-29
Posts: 14

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

Sector11, i wish i had your artistic mind, great work.

Offline

#572 2013-01-05 15:38:26

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

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

TeoBigusGeekus wrote:

Smooth man, thanks again!

Your welcome.  Thanks for the scripts.  OK, back patting finished. devil

I had to "thin it down", I'm looking at a horizontal version - still a head game at this time BUT it will happen - and soon.

RogueSurfer wrote:

Sector11, i wish i had your artistic mind, great work.

Practice! Five years of conky practice and +/- 1000 examples to "remind me of things"

Conky is the only thing I do really, I leave the "kernel compiling", script writing and programming to the smart ones.  And thankfully they let me use their work to make conky do things.

It's an unofficial partnership I appreciate.  And Teo, being the person he is, makes it a pleasant one.


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

Offline

#573 2013-01-05 16:06:11

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

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

Sector11 wrote:
TeoBigusGeekus wrote:

Smooth man, thanks again!

Your welcome.  Thanks for the scripts.  OK, back patting finished. devil

I had to "thin it down", I'm looking at a horizontal version - still a head game at this time BUT it will happen - and soon.

RogueSurfer wrote:

Sector11, i wish i had your artistic mind, great work.

Practice! Five years of conky practice and +/- 1000 examples to "remind me of things"

Conky is the only thing I do really, I leave the "kernel compiling", script writing and programming to the smart ones.  And thankfully they let me use their work to make conky do things.

It's an unofficial partnership I appreciate.  And Teo, being the person he is, makes it a pleasant one.

uJCZ7.jpg


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

#574 2013-01-05 16:58:05

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

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

TeoBigusGeekus wrote:

lol lol lol lol lol


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

Offline

Be excellent to each other!

#575 2013-01-06 01:07:33

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

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

And here it is ... What I was aiming for all along:

S11_VSIDO.conkyrc with a touch of Teo! - 1a_accuweather_conky_INT/accuweather_conky
adj5QLkS.jpg

The conky

# killall conky && conky -c /media/5/Conky/S11_VSIDO.conkyrc &
# Original by: VastOne on VSIDO

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont Monofur:bold:size=12
xftalpha 1.0
# text_buffer_size 256

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

own_window yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_transparent yes
# own_window_argb_visual yes
own_window_class Conky

# Stippled borders?
stippled_borders 0

# border margins
border_inner_margin 5

# border width
border_width 0

# Default colors and also border colors
default_color 00BFFF #  0 191 255	DeepSkyBlue
color0 FFDEAD #255 222 173	NavajoWhite
color1 7FFF00 #127 255   0	Chartreuse
color2 778899 #119 136 153	LightSlateGray
color3 FF8C00 #255 140   0	DarkOrange
color4 F0FFFF #240 255 255	Azure
color5 FFDEAD #255 222 173	NavajoWhite
color6 7B68EE #123 104 238	MediumSlateBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 FF0000 #255   0   0	Red

#default_shade_color black
#default_outline_color grey
own_window_colour 000000

# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 10

minimum_size 1150 0  ## width, height
#maximum_width 1000     ## width


# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off (no).
short_units yes

 lua_load /media/5/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
#
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.3}\
${image /media/5/Conky/images/debian4.png -p 0,0 -s 50x50}\
${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}\
        ${color}Kernel ${color4}${kernel}\
 ${color}MEM${color4}${if_match ${memperc}<10}  ${memperc}\
${else}${if_match ${memperc}<100} ${memperc}\
${else}${memperc}${endif}${endif}%\
 ${color}(${mem})\
 ${color}CPU${color4}${if_match ${platform f71882fg.2560 temp 1}<100} ${platform f71882fg.2560 temp 1}\
${else}${platform f71882fg.2560 temp 1}${endif}°\
 ${color}MB${color4}${if_match ${platform f71882fg.2560 temp 2}<100} ${platform f71882fg.2560 temp 2}\
${else}${platform f71882fg.2560 temp 2}${endif}°\
 ${color}HD${color4}${if_match ${execi 5 hddtemp -n /dev/sda}<100} ${execi 5 hddtemp -n /dev/sda}\
${else}${execi 5 hddtemp -n /dev/sda}${endif}${color1}°\
${color}${goto 680}Now\
${goto 760}${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 840}${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 920}${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1000}${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1080}${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}
        ${color}NET${color4} Dn: ${color2}${downspeedgraph eth0 12,150 00ff00 ff0000 -t -l}     ${color}Up: ${color2}${upspeedgraph eth0 12,150 ff0000 00ff00 -t -l}  ${color}Uptime ${color1}${uptime_short}\
${color3}${goto 680}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 760}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 840}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 920}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1000}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1080}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
        ${color}CPU: 1${color4}${if_match ${cpu cpu1}<10}  ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu0}${endif}${endif}%\
  ${color}2${color4}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
  ${color}3${color4}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
  ${color}4${color4}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
  ${color}Fan ${color4}${platform f71882fg.2560 fan 1} rpm\
${goto 680}↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 760}↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 840}↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 920}↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1000}↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1080}↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°\
${voffset -20}${goto 725}${font conkyweather:size=20}${color4}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}\
${goto 805}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 885}${execi 600  sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 965}${execi 600  sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1045}${execi 600  sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1125}${execi 600  sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}

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

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: zapp

Debian Logo