SEARCH

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

You are not logged in.

#4226 2012-12-03 03:04:05

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: Conky v1.9 Thread

Sector11 wrote:
jed wrote:
Sector11 wrote:

I just want the # of new mails so I use::

${execi 90 conkyEmail --servername=pop3.mailserver --servertype=POP --port=110 --username=USER --password=LIKE_I'LL_TELL}

Holy freakin' crap man, thats MY password as well!!!   cool
I'll check it out tomorrow.  Thanks so much for the help, as usual gotta get pulled out of the deep end!

Awwwwwwww now I gotta go change mine again!

I would suggest I'M_NOT_TELLING


You can find my work here

Make everything ok button

Offline

Be excellent to each other!

#4227 2012-12-03 03:17:41

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

Re: Conky v1.9 Thread

ansem_of_nexus wrote:

I would suggest I'M_NOT_TELLING

Already changed it to: 7734otog ]:D


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

Offline

#4228 2012-12-03 03:23:03

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Sector11 wrote:
ansem_of_nexus wrote:

I would suggest I'M_NOT_TELLING

Already changed it to: 7734otog ]:D

I hate having to turn the computer upside down to read something!  Great password...  And, to stay on topic, Conky, Conky, Conky! 8o


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#4229 2012-12-03 03:26:37

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Am I the only one to have to suffer through this dilemma?  I've looked at so many conky's the last few months, and experimented and tweaked them that I now can't decide what I want on the desktop!  There are so many conkys and so little time!  Of course, then someone pointed out the world of Lua.  What's a person to do?  yikes


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#4230 2012-12-03 06:50:14

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

rusty_jones wrote:

With baseball just around the corner, i'm trying to setup a standings and info conky for the Phillies. when I run the py scripts I get Info, when I run them from conky nothing.

Here is my Conky_baseball

# Conky settings #
background no
update_interval 300 #Update interval in seconds, it's up to you.

# --- Window Layout & Options --- #
own_window yes
own_window_transparent yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
use_xft yes
alignment top_right
gap_x 1300 
gap_y 35
# --- Colours, Sizes, Fonts & Margins --- #
minimum_size 1600 1600 #these may not need to be this big but it doesn't really matter
maximum_width 450 #this should be right if you use the same data I do.
stippled_borders 3
border_inner_margin 9
border_width 9
default_color grey

draw_outline no
draw_borders no
#font Monospace:size=8:weight=bold
uppercase no
draw_shades no

TEXT
${color CA1F2C}${font freemono:size=10}Philadelphia Phillies ${hr 2}
${color FFFFFF}${font freemono:size=8}${exec ~/.conky/baseball/Phillies_results.py}
${color CA1F2C}${font freemono:size=10}Today's Games ${hr 2}
${color FFFFFF}${font freemono:size=8}${exec ~/.conky/baseball/scores.py}
${color CA1F2C}${font freemono:size=10}MLB Standings ${hr 2}
${color CA1F2C}${font freemono:size=9} Wild Card ${hr 1}
${color FFFFFF}${font freemono:size=8}${exec ~/.conky/baseball/standings_wild.py}
#${color CA1F2C}${font freemono:size=9} American League ${hr 1}
#${color FFFFFF}${font freemono:size=8}${exec ~/.conky/baseball/standings_al.py}
${color CA1F2C}${font freemono:size=9} National League ${hr 1}
${color FFFFFF}${font freemono:size=8}${exec ~/.conky/baseball/standings_nl.py}

This is Phillies_results.py

#!/usr/bin/env python
import os
results = "lynx -nonumbers -nolist -dump http://m.4info.com/search?searchQuery=Philadelphia+Phillies | egrep -i -B2 -A8 'Status'"
cmd = os.popen("lynx -nonumbers -dump %s" % results)
output = cmd.read()
cmd.close()
print output

scores.py

#!/usr/bin/env python
import os
scores = "http://wap.mlb.com/scores/ | egrep -e 'vs| - '"
cmd = os.popen("lynx -nonumbers -dump %s" % scores)
output = cmd.read()
cmd.close()
print output

standings.py

#!/usr/bin/env python
import os
filename = "http://scores.espn.go.com/mlb/standings | egrep -A19 'National League'"
cmd = os.popen("lynx -nonumbers -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

Standings_wild.py

#!/usr/bin/env python
import os
filename = "http://espn.go.com/mlb/standings/_/type/wild-card | egrep -A11 'NATI'"
cmd = os.popen("lynx -nonumbers -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

And this is my terminal output

──> conky -c /rusty/.conky_baseball &
[2] 19832
Conky: invalid configuration file '/rusty/.conky_baseball'

[1]   Done                    conky -c /rusty/.conky_baseball
Conky: desktop window (e00029) is subwindow of root window (10e)
Conky: window type - override
Conky: drawing to created window (0x2000001)
Conky: drawing to double buffer

Any Ideas.


This is what Im getting

tZ2ptZw

Heres my output when I start it

luke@crunchbang-asus:~$ ~/Conky/conky_start.sh
luke@crunchbang-asus:~$ Conky: desktop window (d8) is root window
Conky: window type - override
Conky: drawing to created window (0x2800001)
Conky: drawing to double buffer

Being that my script writing skills are that of a 5 year old Im not much help with what arclance pointed out but I can test the hell out of anything you want big_smile
were you ever able to get things running ok?

Last edited by lwfitz (2012-12-03 06:53:38)

Offline

#4231 2012-12-03 12:44:42

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

Re: Conky v1.9 Thread

jed wrote:
Sector11 wrote:
ansem_of_nexus wrote:

I would suggest I'M_NOT_TELLING

Already changed it to: 7734otog ]:D

I hate having to turn the computer upside down to read something!  Great password...  And, to stay on topic, Conky, Conky, Conky! 8o

But but but - we are talking conky - conkyEmail and passwords.  Did you get the gmail sorted.

kaivalagi, conkeyEmail author, uses it with gmail so it shouldn't be a problem


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

Offline

#4232 2012-12-03 12:50:15

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

Re: Conky v1.9 Thread

jed wrote:

Am I the only one to have to suffer through this dilemma?  I've looked at so many conky's the last few months, and experimented and tweaked them that I now can't decide what I want on the desktop!  There are so many conkys and so little time!  Of course, then someone pointed out the world of Lua.  What's a person to do?  yikes

How many desktops do you have?  Put different ones on different desktops.


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

Offline

#4233 2012-12-03 14:27:53

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

Heres my output when I start it

luke@crunchbang-asus:~$ ~/Conky/conky_start.sh
luke@crunchbang-asus:~$ Conky: desktop window (d8) is root window
Conky: window type - override
Conky: drawing to created window (0x2800001)
Conky: drawing to double buffer
lwfitz wrote:

Being that my script writing skills are that of a 5 year old Im not much help with what arclance pointed out but I can test the hell out of anything you want big_smile
were you ever able to get things running ok?

That is exactly what I got without any screen print. I've run each line individually and don't get anything to print out.

Offline

#4234 2012-12-03 15:43:30

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Sector11 wrote:
jed wrote:
Sector11 wrote:

Already changed it to: 7734otog ]:D

I hate having to turn the computer upside down to read something!  Great password...  And, to stay on topic, Conky, Conky, Conky! 8o

But but but - we are talking conky - conkyEmail and passwords.  Did you get the gmail sorted.

kaivalagi, conkeyEmail author, uses it with gmail so it shouldn't be a problem

Doh!  Facepalm!  Using IMAP instead of POP.  Just need to check the accounts to see if their is mail in them.  Switching to POP fixes the issue.  Thanks for the help.  Like Forest says, "stupid is as stupid does"!  :8


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#4235 2012-12-03 20:00:16

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

How can I go about dropping the the white text below the weather?

http://imgbox.com/adsJv86j

This is the conky_weather:

##############################################
#  Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Mono:size=8
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 600 680
maximum_width 700
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 10
update_interval 1

lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/v9000/s11template.lua

TEXT

${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

Any help would be appreciated.

Offline

#4236 2012-12-03 20:09:17

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Conky v1.9 Thread

Change:

${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

To:

${offset 500}${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
${offset 500}${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

If you want to move it down, use voffset.

You will have to make conky bigger too, to accommodate it. Or use 2 conkys, smaller text, etc.,

Edit: If offset doesn't work before the color, put it immediately after

Last edited by dura (2012-12-03 20:15:10)

Offline

#4237 2012-12-03 20:47:43

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

Re: Conky v1.9 Thread

@ dura and rusty_jones

dura wrote:

Change:

${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

To:

${offset 500}${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
${offset 500}${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

If you want to move it down, use voffset.

You will have to make conky bigger too, to accommodate it. Or use 2 conkys, smaller text, etc.,

Edit: If offset doesn't work before the color, put it immediately after

It will work before the colour.

Take Note: remove the # from the colour command.  It's a "comment" marker in conky.

${color  #CA1F2C} to ${color  CA1F2C}

Also if you don't turn fonts off with ${font}, you don't need that second call for ${font freemono:size=12}

${offset 500}${color  CA1F2C}${font freemono:size=12} National League ${hr 1}
${offset 500}${color  FFFFFF}${exec ~/.conky/baseball/standings_nl.py}

This may or may not apply in this case I know it does in other instances:
Be careful with that ${offset}, it works from where the command is issued and will probably only work in the first line of the output.

Check this out: Goto/offset/voffset


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

Offline

#4238 2012-12-03 20:51:08

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Conky v1.9 Thread

Oh yeah. That.

Offline

#4239 2012-12-03 21:09:02

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

Re: Conky v1.9 Thread

When you live on a rock there are certain things you need to know.
abeOt5v8.jpg --> like: time, weather and computer stuff!
Bunch of people to thank for this,

An extremely interesting clock!

conky:

# killall conky && conky -c /media/5/Conky/jed_greyclock_conkyrc &
# from jed
# — Conky settings — #

background yes

update_interval 1
#total_run_times 0
#net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 256
imlib_cache_size 0


# — Window specifications — #
own_window_type normal #override
own_window_class Conky
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

border_inner_margin 0
border_outer_margin 0

minimum_size 600 840
maximum_width 460

alignment br
gap_x 10
gap_y 30



# — Graphics settings — #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# — Text settings — #
use_xft yes
xftfont DS\-Digital:size=12
xftalpha 1.0

default_color 227992 ##dark red A84C47 ##opaque white FFFFFF
default_shade_color gray
default_outline_color black

color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #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

uppercase no
use_spacer right

# — Lua Load — #
lua_load /media/5/Conky/LUA/greyclock.lua
lua_draw_hook_post main
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load /media/5/Conky/LUA/chrono-full_jed.template.lua
#lua_load /media/5/Conky/LUA/crono_full_2.template.lua
lua_load /media/5/Conky/LUA/draw-bg.lua

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

chrono-full_jed.template.lua - now modified

--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbang.org/forums/viewtopic.php?id=16100

 the file:
 http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbang.org/forums/viewtopic.php?id=17246
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="monofur"--font must be in quotes
default_font_size=16
default_color=0xffffff	--white
default_alpha=1		--fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE

--[[ forecast
datay=450  --375
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=35
imgy=575
imgyy=60 -- imgy+(imgyy*1)
]]
-- forecast
datay=450
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=45
imgy=575
imgyy=60 -- imgy+(imgyy*1)

ih=60
iw=60
-- ======================================================================
-- SUN & MOON RISE ------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=10,y=25,txt="Sunrise"})
      out({c=0xFAFAEC,a=1,x=20,y=40,txt=sun_rise_24[1]})
   out({c=0xC0C0C0,a=1,x=382,y=25,txt="Moonrise"})
      out({c=0xC0C0C0,a=1,x=392,y=40,txt=moon_rise_24[1]})
-- SUN & MOON SET -------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=10,y=410,txt="Sunset"})
      out({c=0xFAFAEC,a=1,x=15,y=425,txt=sun_set_24[1]})
   out({c=0xC0C0C0,a=1,x=382,y=410,txt="Moonset"})
      out({c=0xC0C0C0,a=1,x=392,y=425,txt=moon_set_24[1]})
-- ======================================================================
-- MOON PHASE - CENTRE --------------------------------------------------
   image({x=170,y=170,w=120,h=120,file=moon_icon[1]})
-- image({x=170,y=170,w=120,h=120,file="/media/5/Conky/images/red+.png"})
   out({c=0xFFFFFF,a=1.0,x=190,y=235,txt=moon_phase[1]})

-- ======================================================================
-- CURRENT FOR TODAY - SEE TOP LEFT -------------------------------------
   image({x=110,y=100,w=60,h=60,file=now["weather_icon"]})
-- image({x=110,y=100,w=60,h=60,file="/media/5/Conky/images/red+.png"})
   out({c=0xFAFAEC,a=1,x=120,y=100,txt="T "})
      out({c=0xFF8C00,fs=14,a=1,x=135,y=100,txt=now["temp"].."°"})
   out({c=0xC0C0C0,a=1,x=120,y=170,txt="± "})
      out({c=0xC0C0C0,fs=14,a=1,x=135,y=170,txt=now["feels_like"].."°"})

-- FORECAST TODAY - SEE TOP RIGHT ---------------------------------------
   image({x=285,y=100,w=60,h=60,file=weather_icon[1]})
-- image({x=285,y=100,w=60,h=60,file="/media/5/Conky/images/red+.png"})
   out({c=0xFF8C00,fs=14,a=1,x=295,y=100,txt="↑"})
     out({c=0xFF8C00,fs=14,a=1,x=305,y=100,txt=high_temp[1].."°"})
   out({c=0xC0C0C0,fs=14,a=1,x=295,y=170,txt="↓"})
     out({c=0xC0C0C0,fs=14,a=1,x=305,y=170,txt=low_temp[1].."°"})

-- ======================================================================
-- WIND INFORMATION - SEE BOTTOM ----------------------------------------
   image({x=185,y=290,w=90,h=90,file=now["wind_icon"]})
-- image({x=185,y=290,w=90,h=90,file="/media/5/Conky/images/red+.png"})
   out({c=0xffffff,a=0.5,x=158,y=341,txt=now["wind_deg"]})
   out({c=0xffffff,a=0.5,x=273,y=341,txt=now["wind_nesw"]})
--   out({c=0xffffff,a=1,x=333,y=295,txt="@"})
      out({c=0xffffff,a=0.5,x=200,y=390,txt=now["wind_km"].."3"})

-- ======================================================================
-- BOTTOM LEFT
-- Barometric Pressure
   out({c=0xFAFAEC,a=1,x=30,y=450,txt=" BP:"})
	out({c=0xC0C0C0,a=1,x=60,y=450,txt=now["pressure_mb"].." mb"})
-- Humidity -------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=90,y=495,txt="Hum:"})
      out({c=0xC0C0C0,a=1,x=135,y=495,txt=now["humidity"].."%"})
-- Dew Point ------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=90,y=520,txt="DP:"})
      out({c=0xC0C0C0,a=1,x=135,y=520,txt=now["dew_point"].."°"})
-- ======================================================================
-- BOTTOM RIGHT
-- Ceiling
-- out({c=0xFAFAEC,a=1,x=265,y=315,txt="Ceil:"})
--    out({c=0x227992,a=1,x=300,y=315,txt=now["ceiling"]})
-- Chance of Rain -------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=270,y=495,txt="Rain:"})
      out({c=0xC0C0C0,a=1,x=325,y=495,txt=precipitation[1].."%"})
-- Cloud Cover
   out({c=0xFAFAEC,a=1,x=270,y=520,txt="Cloud:"})
      out({c=0xC0C0C0,a=1,x=325,y=520,txt=cloud_cover[1].."%"})
-- ======================================================================
-- BOTTOM CENTRE
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=330,y=450,txt="UV:"})
   out({c=0xC0C0C0,a=1,x=360,y=450,txt=uv_index_num[1]})
      out({c=0xC0C0C0,a=1,x=380,y=450,txt=uv_index_txt[1]})

-- ======================================================================
-- FORECAST FOR NEXT 3 HOURS --------------------------------------------
-- image({x=5,y=353,w=340,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})
--out({c=0x227992,a=1,f="Arial",fs=16,x=10,y=448,txt="Next 3 Hours"})
-- out({c=0x227992,a=1,f="Arial",fs=16,x=35,y=463,txt="Hours"})
-- 1st hour
out({c=0xFF9600,x=31,y=470,txt=now["fc_hour1_time_24"]..":00"})
  image({w=60,h=60,x=20,y=475,file=now["fc_hour1_wicon"]})
-- image({w=60,h=60,x=20,y=475,file="/media/5/Conky/images/red+.png"})
out({c=0xAFAFAF,x=40,y=550,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xFF9600,x=212,y=470,txt=now["fc_hour2_time_24"]..":00"})
  image({w=60,h=60,x=200,y=475,file=now["fc_hour2_wicon"]})
-- image({w=60,h=60,x=200,y=475,file="/media/5/Conky/images/red+.png"})
out({c=0xAFAFAF,x=221,y=550,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xFF9600,x=392,y=470,txt=now["fc_hour3_time_24"]..":00"})
  image({w=60,h=60,x=380,y=475,file=now["fc_hour3_wicon"]})
-- image({w=60,h=60,x=380,y=475,file="/media/5/Conky/images/red+.png"})
out({c=0xAFAFAF,x=401,y=550,txt=now["fc_hour3_temp"] .."°"})

-- ======================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=datafx1*0.4,y=datay+(datayy*8),txt=forecast_day_short[2]})
 out({c=0x9ACD32,a=1,x=datafx1*2.4,y=datay+(datayy*8),txt=forecast_date[2]})
  out({c=0x9ACD32,a=1,x=datafx1*4.0,y=datay+(datayy*8),txt=forecast_month_short[2]})
image({w=iw,h=ih,x=imgx*0.6,y=imgy,file=weather_icon[2]})
-- image({w=iw,h=ih,x=imgx*0.6,y=imgy,file="/media/5/Conky/images/red+.png"})
out({c=0xFF8C00,a=1,x=datafx1*0.4,y=datay+(datayy*9.5),txt=high_temp[2]})
out({c=0x00BFFF,a=1,x=datafx1*0.4,y=datay+(datayy*11),txt=low_temp[2]})
 out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*9.0),txt=sun_rise_24[2]})
 out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*10.1),txt=sun_set_24[2]})
  out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*11.5),txt=moon_rise_24[2]})
  out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*12.5),txt=moon_set_24[2]})
-- Forecast day 3 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=datafx1*8.3,y=datay+(datayy*8),txt=forecast_day_short[3]})
 out({c=0x9ACD32,a=1,x=datafx1*10.5,y=datay+(datayy*8),txt=forecast_date[3]})
  out({c=0x9ACD32,a=1,x=datafx1*12.2,y=datay+(datayy*8),txt=forecast_month_short[3]})
image({w=iw,h=ih,x=imgx*4.15,y=imgy,file=weather_icon[3]})
-- image({w=iw,h=ih,x=imgx*4.15,y=imgy,file="/media/5/Conky/images/red+.png"})
out({c=0xFF8C00,a=1,x=datafx1*8.2,y=datay+(datayy*9.5),txt=high_temp[3]})
out({c=0x00BFFF,a=1,x=datafx1*8.2,y=datay+(datayy*11),txt=low_temp[3]})
 out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*9.0),txt=sun_rise_24[3]})
 out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*10.1),txt=sun_set_24[3]})
  out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*11.5),txt=moon_rise_24[3]})
  out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*12.5),txt=moon_set_24[3]})
-- Forecast day 4 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=datafx1*16.0,y=datay+(datayy*8),txt=forecast_day_short[4]})
 out({c=0x9ACD32,a=1,x=datafx1*18.1,y=datay+(datayy*8),txt=forecast_date[4]})
  out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=iw,h=ih,x=imgx*7.52,y=imgy,file=weather_icon[4]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
out({c=0xFF8C00,a=1,x=datafx1*15.8,y=datay+(datayy*9.5),txt=high_temp[4]})
out({c=0x00BFFF,a=1,x=datafx1*15.8,y=datay+(datayy*11),txt=low_temp[4]})
 out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*9.0),txt=sun_rise_24[4]})
 out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*10.1),txt=sun_set_24[4]})
  out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*11.5),txt=moon_rise_24[4]})
  out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*12.5),txt=moon_set_24[4]})
-- ======================================================================
-- Forecast day 5 -- x = l|r  y = u|d
  out({c=0x9ACD32,a=1,x=datafx1*0.4,y=datay+(datayy*14.5),txt=forecast_day_short[5]})
   out({c=0x9ACD32,a=1,x=datafx1*2.4,y=datay+(datayy*14.5),txt=forecast_date[5]})
    out({c=0x9ACD32,a=1,x=datafx1*4.0,y=datay+(datayy*14.5),txt=forecast_month_short[5]})
  image({w=iw,h=ih,x=imgx*0.6,y=imgy+(imgyy*1.6),file=weather_icon[5]})
--  image({w=iw,h=ih,x=imgx*0.6,y=imgy+(imgyy*1.6),file="/media/5/Conky/images/red+.png"})
  out({c=0xFF8C00,a=1,x=datafx1*0.4,y=datay+(datayy*16.2),txt=high_temp[5]})
  out({c=0x00BFFF,a=1,x=datafx1*0.4,y=datay+(datayy*17.7),txt=low_temp[5]})
   out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*15.5),txt=sun_rise_24[5]})
   out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*16.6),txt=sun_set_24[5]})
    out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*18.0),txt=moon_rise_24[5]})
    out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*18.9),txt=moon_set_24[5]})
-- Forecast day 6 -- x = l|r  y = u|d
  out({c=0x9ACD32,a=1,x=datafx1*8.3,y=datay+(datayy*14.5),txt=forecast_day_short[6]})
   out({c=0x9ACD32,a=1,x=datafx1*10.5,y=datay+(datayy*14.5),txt=forecast_date[6]})
    out({c=0x9ACD32,a=1,x=datafx1*12.2,y=datay+(datayy*14.5),txt=forecast_month_short[6]})
  image({w=iw,h=ih,x=imgx*4.18,y=imgy+(imgyy*1.6),file=weather_icon[6]})
--  image({w=iw,h=ih,x=imgx*4.18,y=imgy+(imgyy*1.6),file="/media/5/Conky/images/red+.png"})
  out({c=0xFF8C00,a=1,x=datafx1*8.2,y=datay+(datayy*16.2),txt=high_temp[6]})
  out({c=0x00BFFF,a=1,x=datafx1*8.2,y=datay+(datayy*17.7),txt=low_temp[6]})
  out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*15.5),txt=sun_rise_24[6]})
  out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*16.6),txt=sun_set_24[6]})
  out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*18.0),txt=moon_rise_24[6]})
  out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*18.9),txt=moon_set_24[6]})
-- Forecast day 7 -- x = l|r  y = u|d
  out({c=0x9ACD32,a=1,x=datafx1*16.0,y=datay+(datayy*14.5),txt=forecast_day_short[7]})
   out({c=0x9ACD32,a=1,x=datafx1*18.1,y=datay+(datayy*14.5),txt=forecast_date[7]})
    out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*14.5),txt=forecast_month_short[7]})
  image({w=iw,h=ih,x=imgx*7.49,y=imgy+(imgyy*1.6),file=weather_icon[7]})
--  image({w=iw,h=ih,x=imgx*7.49,y=imgy+(imgyy*1.6),file="/media/5/Conky/images/red+.png"})
  out({c=0xFF8C00,a=1,x=datafx1*15.8,y=datay+(datayy*16.2),txt=high_temp[7]})
  out({c=0x00BFFF,a=1,x=datafx1*15.8,y=datay+(datayy*17.7),txt=low_temp[7]})
  out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*15.5),txt=sun_rise_24[7]})
  out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*16.6),txt=sun_set_24[7]})
  out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*18.0),txt=moon_rise_24[7]})
  out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*18.9),txt=moon_set_24[7]})
-- ======================================================================
-- Forecast day 8 -- x = l|r  y = u|d
    out({c=0x9ACD32,a=1,x=datafx1*0.4,y=datay+(datayy*21),txt=forecast_day_short[8]})
     out({c=0x9ACD32,a=1,x=datafx1*2.5,y=datay+(datayy*21),txt=forecast_date[8]})
      out({c=0x9ACD32,a=1,x=datafx1*4.2,y=datay+(datayy*21),txt=forecast_month_short[8]})
    image({w=iw,h=ih,x=imgx*0.6,y=imgy+(imgyy*3.2),file=weather_icon[8]})
--    image({w=iw,h=ih,x=imgx*0.6,y=imgy+(imgyy*3.2),file="/media/5/Conky/images/red+.png"})
    out({c=0xFF8C00,a=1,x=datafx1*0.4,y=datay+(datayy*22.5),txt=high_temp[8]})
    out({c=0x00BFFF,a=1,x=datafx1*0.4,y=datay+(datayy*24),txt=low_temp[8]})
    out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*21.9),txt=sun_rise_24[8]})
    out({c=0xFAFAEC,a=1,x=datafx1*4.6,y=datay+(datayy*22.9),txt=sun_set_24[8]})
    out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*24.4),txt=moon_rise_24[8]})
    out({c=0xC0C0C0,a=1,x=datafx1*4.6,y=datay+(datayy*25.4),txt=moon_set_24[8]})
-- Forecast day 9 -- x = l|r  y = u|d
    out({c=0x9ACD32,a=1,x=datafx1*8.3,y=datay+(datayy*21),txt=forecast_day_short[9]})
     out({c=0x9ACD32,a=1,x=datafx1*10.5,y=datay+(datayy*21),txt=forecast_date[9]})
      out({c=0x9ACD32,a=1,x=datafx1*12.2,y=datay+(datayy*21),txt=forecast_month_short[9]})
    image({w=iw,h=ih,x=imgx*4.14,y=imgy+(imgyy*3.2),file=weather_icon[9]})
--    image({w=iw,h=ih,x=imgx*4.14,y=imgy+(imgyy*3.2),file="/media/5/Conky/images/red+.png"})
    out({c=0xFF8C00,a=1,x=datafx1*8.2,y=datay+(datayy*22.5),txt=high_temp[9]})
    out({c=0x00BFFF,a=1,x=datafx1*8.2,y=datay+(datayy*24),txt=low_temp[9]})
     out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*21.9),txt=sun_rise_24[9]})
     out({c=0xFAFAEC,a=1,x=datafx1*12.6,y=datay+(datayy*22.9),txt=sun_set_24[9]})
      out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*24.4),txt=moon_rise_24[9]})
      out({c=0xC0C0C0,a=1,x=datafx1*12.6,y=datay+(datayy*25.4),txt=moon_set_24[9]})
-- Forecast day 10 -- x = l|r  y = u|d
    out({c=0x9ACD32,a=1,x=datafx1*16.0,y=datay+(datayy*21),txt=forecast_day_short[10]})
     out({c=0x9ACD32,a=1,x=datafx1*18.1,y=datay+(datayy*21),txt=forecast_date[10]})
      out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*21),txt=forecast_month_short[10]})
    image({w=iw,h=ih,x=imgx*7.55,y=imgy+(imgyy*3.2),file=weather_icon[10]})
--    image({w=iw,h=ih,x=imgx*7.55,y=imgy+(imgyy*3.2),file="/media/5/Conky/images/red+.png"})
    out({c=0xFF8C00,a=1,x=datafx1*15.8,y=datay+(datayy*22.5),txt=high_temp[10]})
    out({c=0x00BFFF,a=1,x=datafx1*15.8,y=datay+(datayy*24),txt=low_temp[10]})
     out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*21.9),txt=sun_rise_24[10]})
     out({c=0xFAFAEC,a=1,x=datafx1*20.3,y=datay+(datayy*22.9),txt=sun_set_24[10]})
      out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*24.4),txt=moon_rise_24[10]})
      out({c=0xC0C0C0,a=1,x=datafx1*20.3,y=datay+(datayy*25.4),txt=moon_set_24[10]})

--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

what I call: greyclock.lua - a modified version of: cups_n_saucers.lua

--==============================================================================
--  				Cups and Saucers
--                               Lua conky script
--
--  author  : Abu Yahya (abuyahya) - http://tiny.cc/whbpow
--  license : Distributed under the terms of GNU GPL v3
--  30.05.2012
-- v.1.0.1
--==============================================================================
-- got this from jed who said some striiped the above info
-- I put it back in - Thanks to abuyahya for a nice clock.
-- greyclock.lua

require 'cairo'
--------------------------------------------------------------------------------
----Adjustable Settings
coffee_table = {
			-- HOUR HAND
	{
	name='time',					arg='%I.%M',
	max_value=12,					x=230,	y=230,

	cup_radius=112,				cup_wall_thickness=90,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,

	handle_length=70,				handle_circ=5,
	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.6,

	graduation_radius=184,			graduation_thickness=8,
	graduation_mark_circ=1.5,		graduation_mark_angle=30,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.5,

	saucer_thickness=6,				thick_saucer_circ=11/12,
	saucer_radius=195,				thin_saucer_circ=11/12,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.0,
	inner_saucer=true,

	txt_weight=0,					txt_size=8.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.0,
	caption='',					caption2='',
	},
			-- DOT IN CENTRE
   {
	name='time',					arg='%H',
	max_value=12,					x=230,	y=230,

	cup_radius=2,					cup_wall_thickness=3,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,

	handle_length=40,				handle_circ=4,
	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,

	graduation_radius=187,			graduation_thickness=1,
	graduation_mark_circ=0.5,		graduation_mark_angle=3,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.5,

	saucer_thickness=6,				thick_saucer_circ=11/12,
	saucer_radius=195,				thin_saucer_circ=11/12,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.0,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.0,
	inner_saucer=true,

	txt_weight=0,					txt_size=8.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.0,
	caption='',					caption2='',
	},
			-- MINUTE HAND
	{
	name='time',					arg='%M',
	max_value=60,					x=230,	y=230,

	cup_radius=118,				cup_wall_thickness=120,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,

	handle_length=110,				handle_circ=3,
	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.6,

	graduation_radius=183,			graduation_thickness=10,
	graduation_mark_circ=2.5,		graduation_mark_angle=90,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.5,

	saucer_thickness=6,				thick_saucer_circ=11/12,
	saucer_radius=220,				thin_saucer_circ=11/12,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.0,
	inner_saucer=true,

	txt_weight=0,					txt_size=8.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.0,
	caption='',					caption2='',
	},
			-- SECOND HAND
	{
	name='time',					arg='%S',
	max_value=60,					x=230,	y=230,

	cup_radius=120,				cup_wall_thickness=120,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,

	handle_length=118,				handle_circ=1,
	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.5,

	graduation_radius=185,			graduation_thickness=6,
	graduation_mark_circ=0.5,		graduation_mark_angle=6,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.5,

	saucer_thickness=5,				thick_saucer_circ=1,
	saucer_radius=205,				thin_saucer_circ=11/12,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.4,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.4,
	inner_saucer=true,

	txt_weight=0,					txt_size=8.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.0,
	caption='',					caption2='',
	},
			-- CPU CIRCLE - TOP
	{
	name='cpu',					arg='cpu0',
	max_value=100,					x=350,	y=230,

	cup_radius=20,					cup_wall_thickness=40,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=35,			graduation_thickness=3,
	graduation_mark_circ=2,			graduation_mark_angle=36,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

	saucer_thickness=6,				thick_saucer_circ=0.85,
	saucer_radius=40,				thin_saucer_circ=0.85,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-20,						ytxt= -12,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption='CPU ',				caption2=' %',
	},
--[[ -- BOTTOM RIGHT - LEFT OF WIND!
    {
    name='cpu',					arg='cpu1',
    max_value=100,					x=120,	y=320,

    cup_radius=20,					cup_wall_thickness=40,
    cup_bg_clr=0xFFFFFF,				cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,				cup_fg_alpha=0.0,
    cup_start_angle=0,

    handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
    handle_length=40,				handle_circ=4,

    xtxt=-20,						ytxt= -8,
    txt_weight=0,					txt_size=8.0,
    txt_fg_clr=0xFFFFFF,				txt_fg_alpha=0.8,
    caption=' 1 ',					caption2=' %',

    graduation_radius=25,			graduation_thickness=3,
    graduation_mark_circ=2,			graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

    saucer_thickness=3,				thick_saucer_circ=0.85,
    saucer_radius=30,				thin_saucer_circ=0.85,
    saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
    },

    {
    name='cpu',					arg='cpu2',
    max_value=100,					x=120,	y=320,

    cup_radius=20,					cup_wall_thickness=40,
    cup_bg_clr=0xFFFFFF,				cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,				cup_fg_alpha=0.0,
    cup_start_angle=0,

    handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
    handle_length=40,				handle_circ=4,

    xtxt=-20,						ytxt= 3,
    txt_weight=0,					txt_size=8.0,
    txt_fg_clr=0xFFFFFF,				txt_fg_alpha=0.8,
    caption=' 2 ',					caption2=' %',

    graduation_radius=25,			graduation_thickness=3,
    graduation_mark_circ=2,			graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

    saucer_thickness=3,				thick_saucer_circ=0.85,
    saucer_radius=30,				thin_saucer_circ=0.85,
    saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
    },

    {
    name='cpu',					arg='cpu3',
    max_value=100,					x=120,	y=320,

    cup_radius=20,					cup_wall_thickness=40,
    cup_bg_clr=0xFFFFFF,				cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,				cup_fg_alpha=0.0,
    cup_start_angle=0,

    handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
    handle_length=40,				handle_circ=4,

    xtxt=-20,						ytxt= 14,
    txt_weight=0,					txt_size=8.0,
    txt_fg_clr=0xFFFFFF,				txt_fg_alpha=0.8,
    caption=' 3 ',					caption2=' %',

    graduation_radius=25,			graduation_thickness=3,
    graduation_mark_circ=2,			graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

    saucer_thickness=3,				thick_saucer_circ=0.85,
    saucer_radius=30,				thin_saucer_circ=0.85,
    saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
    },
]]

			-- CPU CIRCLE - TOP
	{
	name='freq_g',					arg='/',
	max_value=5,					x=350,	y=230,

	cup_radius=12,					cup_wall_thickness=23,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=25,			graduation_thickness=6,
	graduation_mark_circ=4,			graduation_mark_angle=30,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.0,

	saucer_thickness=6,				thick_saucer_circ=0.75,
	saucer_radius=45,				thin_saucer_circ=0.75,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-20,						ytxt= 0,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption='',					caption2=' GHz',
	},
			-- CPU CIRCLE - TOP
	{
	name='hwmon',					arg='temp 1',
	max_value=100,					x=350,	y=230,

	cup_radius=12,					cup_wall_thickness=23,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=35,			graduation_thickness=6,
	graduation_mark_circ=2,			graduation_mark_angle=36,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

	saucer_thickness=6,				thick_saucer_circ=0.85,
	saucer_radius=40,				thin_saucer_circ=0.85,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-15,						ytxt= 12,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption='',					caption2=' ºC',
	},
			-- RAM CIRCLE
	{
	name='memperc',				arg='/',
	max_value=100,					x=230,	y=105,

	cup_radius=12,					cup_wall_thickness=23,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=35,			graduation_thickness=6,
	graduation_mark_circ=2,			graduation_mark_angle=36,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

	saucer_thickness=6,				thick_saucer_circ=0.85,
	saucer_radius=40,				thin_saucer_circ=0.85,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha= 0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-25,						ytxt=0,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption='RAM ',				caption2=' %',
},
			-- MEMORY CIRCLE
{
	name='fs_used_perc',			arg='/home',
	max_value=100,					x=105,	y=230,

	cup_radius=12,					cup_wall_thickness=27,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=35,			graduation_thickness=6,
	graduation_mark_circ=2,			graduation_mark_angle=36,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.6,

	saucer_thickness=6,				thick_saucer_circ=0.85,
	saucer_radius=40,				thin_saucer_circ=0.85,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-30,						ytxt= 12,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption=' FS H: ',				caption2=' %',
},
			-- MEMORY CIRCLE
{
	name='fs_used_perc',			arg='/',
	max_value=100,					x=105,	y=230,

	cup_radius=12,					cup_wall_thickness=27,
	cup_bg_clr=0xFFFFFF,			cup_bg_alpha=0.0,
	cup_fg_clr=0xFFFFFF,			cup_fg_alpha=0.0,
	cup_start_angle=0,

	handle_fg_clr=0xFFFFFF,			handle_fg_alpha=0.0,
	handle_length=40,				handle_circ=4,

	graduation_radius=25,			graduation_thickness=4,
	graduation_mark_circ=4,			graduation_mark_angle=36,
	graduation_fg_clr=0xFFFFFF,		graduation_fg_alpha=0.0,

	saucer_thickness=6,				thick_saucer_circ=0.85,
	saucer_radius=45,				thin_saucer_circ=0.85,
	saucer_fg_clr=0xFFFFFF,			saucer_fg_alpha=0.3,
	saucer_mark_fg_clr=0xFFFFFF,		saucer_mark_fg_alpha=0.5,
	inner_saucer=true,

	xtxt=-30,						ytxt= -5,
	txt_weight=0,					txt_size=10.0,
	txt_fg_clr=0xFFFFFF,			txt_fg_alpha=0.8,
	caption=' FS /: ',				caption2=' %',
	},
}

--Fixed code -do not edit unless you know what you are doing------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- converts color in hexa to decimal
function rgb_to_r_g_b(clr, alpha)
	return ((clr / 0x10000) % 0x100) / 255., ((clr / 0x100) % 0x100) / 255., (clr % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
------------------------------------------------------------------------
local function draw_coffee_table(display, data, value)
	 max_value = data['max_value']
	 x, y = data['x'], data['y']
	 if x==nil then x=conky_window.width/2 end
	 if y==nil then y=conky_window.height/2 end
	 cup_radius = data['cup_radius']
	 if cup_radius==nil then cup_radius=conky_window.width/4 end
	 cup_wall_thickness = data['cup_wall_thickness']
	 if cup_wall_thickness==nil then cup_wall_thickness=20 end
	 handle_length, handle_circ = data['handle_length'], data['handle_circ']
	 if handle_length==nil then handle_length=20 end
	 if handle_circ==nil then handle_circ=1 end
	 cup_start_angle = data['cup_start_angle']
	 if cup_start_angle == nil then cup_start_angle =0 end
	 total_angle = data['total_angle']
	 if total_angle == nil then total_angle=360 end
	 cup_sector_angle = (math.abs(total_angle))/max_value
	 cup_end_angle = total_angle + cup_start_angle
	 cup_bg_clr, cup_bg_alpha = data['cup_bg_clr'], data['cup_bg_alpha']
	 if cup_bg_clr==nil then cup_bg_clr =0xffffff end
	 cup_fg_clr, cup_fg_alpha = data['cup_fg_clr'], data['cup_fg_alpha']
	 if cup_fg_clr==nil then cup_fg_clr =0xffffff end
	 if cup_fg_alpha==nil then cup_fg_alpha=0 end
	 handle_fg_clr, handle_fg_alpha = data['handle_fg_clr'], data['handle_fg_alpha']
	 if handle_fg_clr==nil then handle_fg_clr = 0xffffff end
	 if handle_fg_alpha==nil then handle_fg_alpha=0 end

	 saucer_radius = data['saucer_radius']
	 if saucer_radius==nil then saucer_radius=conky_window.width/2 end
	 total_saucer_angle=data['total_saucer_angle']
	 if total_saucer_angle==nil then total_saucer_angle=360 end
	 saucer_sector_angle=(math.abs(total_saucer_angle))/max_value
	 saucer_thickness = data['saucer_thickness']
	 if saucer_thickness==nil then saucer_thickness=6 end
	 saucer_fg_clr = data['saucer_fg_clr']
	 if saucer_fg_clr ==nil then saucer_fg_clr=0 end
	 saucer_fg_alpha = data['saucer_fg_alpha']
	 if saucer_fg_alpha ==nil then saucer_fg_alpha=0 end

	 saucer_mark_fg_alpha = data['saucer_mark_fg_alpha']
	 if saucer_mark_fg_alpha ==nil then saucer_mark_fg_alpha=0 end
	 saucer_mark_fg_clr = data['saucer_mark_fg_clr']
	 if saucer_mark_fg_clr ==nil then saucer_mark_fg_clr=0xffffff end
	 thick_saucer_circ = data['thick_saucer_circ']
	 if thick_saucer_circ==nil then thick_saucer_circ =0.9 end
	 thin_saucer_circ = data['thin_saucer_circ']
	 if thin_saucer_circ==nil then thin_saucer_circ =0.9 end
	 inner_saucer = data['inner_saucer']

	 graduation_radius = data['graduation_radius']
	 if graduation_radius ==nil then graduation_radius = conky_window.width/3 end
	 graduation_thickness, graduation_mark_circ = data['graduation_thickness'], data['graduation_mark_circ']
	 if graduation_thickness ==nil then graduation_thickness = 2 end
	 if graduation_mark_circ ==nil then graduation_mark_circ = 1 end
	 graduation_mark_angle = data['graduation_mark_angle']
	 if graduation_mark_angle == nil then graduation_mark_angle = total_angle/10 end
	 graduation_fg_clr, graduation_fg_alpha = data['graduation_fg_clr'], data['graduation_fg_alpha']
	 if graduation_fg_clr ==nil then graduation_fg_clr= 0xffffff end
	 if graduation_fg_alpha==nil then graduation_fg_alpha =0 end


	 txt_weight, txt_size = data['txt_weight'], data['txt_size']
	 if txt_weight == nil then txt_weight=1 end
	 if txt_size == nil then txt_size=8 end
	 txt_fg_clr, txt_fg_alpha = data['txt_fg_clr'], data['txt_fg_alpha']
	 if txt_fg_clr ==nil then txt_fg_clr= 0xffffff end
	 if txt_fg_alpha==nil then txt_fg_alpha =0 end
	 caption = data['caption']
	 if caption==nil then caption='' end
	 caption2 = data['caption2']
	 if caption2==nil then caption2='' end
	 xtxt, ytxt= data ['xtxt'], data['ytxt']
	 if xtxt ==nil then xtxt=0 end
	 if ytxt ==nil then ytxt=0 end

--convert degree to rad and rotate (0 degree is top/north)
	function angle_to_position(start_angle, current_angle)
	  if total_angle < 0 then
		local pos = start_angle - current_angle
		return ( ( pos * (math.pi / 180) ) - (math.pi / 2) )
	  else
		local pos = current_angle + start_angle
		return ( ( pos * (math.pi / 180) ) - (math.pi / 2) )
	  end
	end
--cup centre background
  if cup_bg_alpha >0   then
	if total_angle < 0 then
	  cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_end_angle, 0))
	else
	  cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, cup_end_angle))
	end
	cairo_set_source_rgba(display, rgb_to_r_g_b(cup_bg_clr, cup_bg_alpha))
	cairo_set_line_width(display, cup_wall_thickness)
	cairo_stroke(display)
  end
--cup wall fg
  if cup_fg_alpha > 0 then
   local fg_stop_arc = (cup_sector_angle * value)
	if total_angle < 0 then
	cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
	else
	cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
	end
	cairo_set_source_rgba(display, rgb_to_r_g_b(cup_fg_clr, cup_fg_alpha))
	cairo_set_line_width(display, cup_wall_thickness)
	cairo_stroke(display)
  end
-- cup handle
  if handle_fg_alpha>0 then
	local start_handle = (cup_sector_angle * value) - (handle_circ*0.5)
	local stop_handle = (cup_sector_angle * value) +  (handle_circ*0.5)
	if total_angle < 0 then
	cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
	else
	cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
	end
	cairo_set_line_width(display, handle_length)
	cairo_set_source_rgba(display, rgb_to_r_g_b(handle_fg_clr, handle_fg_alpha))
	cairo_stroke(display)
  end
--saucers
---thick saucer
	if saucer_fg_alpha > 0 and (thin_saucer_circ >0 or thick_saucer_circ > 0)
	  then
	if value < (max_value/2)
		then j = value + ((max_value*total_saucer_angle)/720)
		else j = value - ((max_value*total_saucer_angle)/720)
	end

	local start_saucer = (saucer_sector_angle * j) - (value*saucer_sector_angle*0.5*thick_saucer_circ)
	local stop_saucer = (saucer_sector_angle * j) + (value*saucer_sector_angle*0.5*thick_saucer_circ)
	if total_angle < 0 then
	cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
	else
	cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
	end
	cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
	cairo_set_line_width(display, saucer_thickness)
	cairo_stroke(display)
	--thin saucer
	  if inner_saucer == true
	  then rt = (saucer_radius - 0.5) + (0.5 * saucer_thickness)
	  else rt = (saucer_radius + 0.5) - (0.5 * saucer_thickness)
	  end
	local start_thin_saucer = (saucer_sector_angle * j) - (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
	local stop_thin_saucer = (saucer_sector_angle * j) + (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
	if total_angle < 0 then
	cairo_arc_negative(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
	else
	cairo_arc(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
	end
	cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
	cairo_set_line_width(display, 1)
	cairo_stroke(display)
   end
--saucer mark
	if saucer_mark_fg_alpha > 0 then
	local start_cm = (saucer_sector_angle * value) - (handle_circ *0.5 )
	local stop_cm = (saucer_sector_angle * value) + (handle_circ *0.5 )
	if total_angle < 0 then
	  cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
	else
	  cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
	end
	cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_mark_fg_clr, saucer_mark_fg_alpha))
		cairo_set_line_width(display, saucer_thickness)
		cairo_stroke(display)
	end
--graduation mark
	 if graduation_radius > 0 and graduation_thickness > 0 and graduation_mark_angle > 0 then
		number_graduation = (math.abs(total_angle) +1)/ graduation_mark_angle
		local start_arc_grad = 0
		local stop_arc_grad = 0
	local i = 0
		while i < number_graduation do
			local start_arc_grad = (graduation_mark_angle * (i)) - (graduation_mark_circ *0.5)
			local stop_arc_grad = (graduation_mark_angle * (i)) + (graduation_mark_circ *0.5)
			if total_angle < 0 then
		  cairo_arc_negative(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
		else
		  cairo_arc(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
		end
		cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_clr,graduation_fg_alpha))
			cairo_set_line_width(display, graduation_thickness)
		cairo_stroke(display)
			i = i + 1
		end
	end
-- text
  if txt_fg_alpha>0 then
	cairo_select_font_face (display, "hooge 05_53", CAIRO_FONT_SLANT_NORMAL, txt_weight);
	cairo_set_font_size (display,txt_size)
	cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_clr, txt_fg_alpha))
	cairo_move_to (display,x+xtxt,y+ytxt)
	cairo_show_text (display, caption ) cairo_show_text (display,value)cairo_show_text (display, caption2 )
	cairo_stroke (display)
  end
end
-------------------------------------------------------------------------------
-- loads data and displays table_settings

function display_coffee_table(display)
	local function load_coffee_table(display, data)
		local str, value = '', 0
	if data['name'] == 'time2' then
		local max_value = data['max_value']
			str = string.format('${time %s}', data['arg'])
			str = conky_parse(str)
			local value2 = tonumber(str:sub(0,2))
		if value2 == max_value then value2 = 0 end
		value = value2 + (tonumber(str:sub(4,5))/60)
	else
			str = string.format('${%s %s}',data['name'], data['arg'])
			str = conky_parse(str)
			value = tonumber(str)
		end
		if value == nil then value = 0 end
		draw_coffee_table(display, data, value)
	end
	for i in pairs(coffee_table) do
		load_coffee_table(display, coffee_table[i])
	end
end
-------------------------------------------------------------------------------
runscheck = 0 -- fix for draw shades running script twice on every update
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)
	local display = cairo_create(cs)
	local updates = conky_parse('${updates}')
	update_num = tonumber(updates)
	if update_num > 5 then
	  cairo_set_antialias (display, CAIRO_ANTIALIAS_SUBPIXEL)
	  display_coffee_table(display)
	  cairo_set_antialias (display, CAIRO_ANTIALIAS_DEFAULT)
	end
	cairo_surface_destroy(cs)
	cairo_destroy(display)
end

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

Offline

#4240 2012-12-03 21:21:07

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

Thanks, that worked like a charm.

In this script can you tell me what "-A19" means?

#!/usr/bin/env python
import os
filename = "http://scores.espn.go.com/mlb/standings | egrep -A19 'National League'"
cmd = os.popen("lynx -nonumbers -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

Offline

#4241 2012-12-03 21:27:38

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Conky v1.9 Thread

^

-A NUM, --after-context=NUM
              Print NUM  lines  of  trailing  context  after  matching  lines.
              Places   a  line  containing  a  group  separator  (--)  between
              contiguous groups of matches.  With the  -o  or  --only-matching
              option, this has no effect and a warning is given.

Number of lines to print.

Offline

#4242 2012-12-03 21:44:36

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 132
Website

Re: Conky v1.9 Thread

Sector11...mrpeachy...anyone!

I am working on the code (you have no idea how silly THAT sounds) to replace the Hour number on the clock face with the current Month name in sector11's chrono.

Here is what I believe to be the correct code section, with my changes/additions, though NOT the correct as it does not run. I know less than nothing about LUA (or any other language for that matter) and am basically trying to bodge my way through this. Ergo, the quiestion is this:

AM I close? If not, where to go. If so, what will it take to make it work?

 -- ### 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, "Planewalker", 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","1","2","3","4","5","6","7","8","9","10","11",}
  text_months={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",}
  --[[local this_month=tonumber(os.date("%m"))
  if init.handmonth == true then]]
    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))
    if i==month_number then
    local textm=text_months[i]--gets text from table
    cairo_text_extents(cr,textm,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_textm (cr, text)
    cairo_set_source_rgba (cr,1,1,1,1.0)
    cairo_stroke (cr)
    else]]
 -- 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)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=101 -- 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.5)
    cairo_stroke (cr)
  end
end

Any help would be much appreciated and my thanks in advance.  wink

EDIT:

My oversight...

The entire script:

--[[ 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
 -- ### 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 84 - 87 and 131 for changes
 -- ### START DIAL C ### Month Names Dial ###
 --     See Lines 150 -153 and 198 for changes
 -- ### START DIAL D ### Day Numbers Dial ###
 --     See Lines 234 & 265 for  changes
 -- ### START CLOCK A ###
 --     See Lines  &  and 441 & 467 changes
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
 -- CLOCK A HOUR HAND
 -- CLOCK A MINUTE HAND SETUP
 -- CLOCK A SECOND HAND SETUP

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=135,
center_y=135,
radius=118,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
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=22
 -- FONT
cairo_select_font_face (cr, "Planewalker", 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.0) -- 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=7
  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.0) -- 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 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
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
local center_x=init.center_x
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Planewalker", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 16)
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("%01d",i) --formats numbers to single digit
   -- 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("%01d",i) --formats numbers to single digit
    --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.2) -- 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=70
  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.2) -- 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=66
 -- 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=100
 -- 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=100
  local x1=0+radius1*math.sin(arc)
  local y1=0-radius1*math.cos(arc)
  --calculate point 2
  local radius2=107
  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, "Planewalker", 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","1","2","3","4","5","6","7","8","9","10","11",}
  text_months={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",}
  --[[local this_month=tonumber(os.date("%m"))
  if init.handmonth == true then]]
    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))
    if i==month_number then
    local textm=text_months[i]--gets text from table
    cairo_text_extents(cr,textm,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_textm (cr, text)
    cairo_set_source_rgba (cr,1,1,1,1.0)
    cairo_stroke (cr)
    else]]
 -- 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)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=101 -- 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.5)
    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=101 -- 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.5)
    cairo_stroke (cr)
  end
end

 -- ############################################################################
 -- POSITION FOR TEXT HOUR NUMBERS
  if init.hour == 12 and init.second == true then
    text_days={"","1","2","3","4","","6","7","8","9","","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.2) -- does not work -- settings moved
    cairo_select_font_face (cr, "Planewalker", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    for i=1,60 do
      local radius=100 -- dots for seconds A Clock
      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.3) -- 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.5) -- 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.0) -- 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
 -- ############################################################################
 -- ### START DIAL C ### Month Names Dial ##################
 -- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=117
 -- FONT
cairo_select_font_face (cr, "Planewalker", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 24)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_months={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_months={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_months={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_months={"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 D ## TEXT
    local point=(math.pi/180)*((360/12)*(i))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_months[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.0) -- non-active month names
    end
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_months[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=100
  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.0) -- dots for non-active month names
    end
    local point=(math.pi/180)*((360/12)*(i))
    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 ###
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function

Last edited by DrakarNoir (2012-12-03 22:01:56)


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#4243 2012-12-03 22:50:25

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Made a few changes

tZ2p6eA

Offline

#4244 2012-12-03 22:53:09

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

Can someone explain the "A11" in this script in relation to the web site? How they got the "A11>"

#!/usr/bin/env python
import os
filename = "http://espn.go.com/mlb/standings/_/type/wild-card | egrep -A11 'AMER'"
cmd = os.popen("lynx -nonumbers -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

Offline

#4245 2012-12-03 22:59:26

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Conky v1.9 Thread

-A NUM, --after-context=NUM
              Print NUM  lines  of  trailing  context  after  matching  lines.
              Places   a  line  containing  a  group  separator  (--)  between
              contiguous groups of matches.  With the  -o  or  --only-matching
              option, this has no effect and a warning is given.

grep identifies lines matching a pattern, from files you tell it to look at. The pattern you have specified in your python script relates to baseball standings- AMER - which I guess is American baseball team standings. The A11 is the number of lines you have asked grep to print out of the file it skims- espn.go.com.

If you want less info printed out, change A11 to A4 or something. Or have a look at http://www.bbc.co.uk/football

See:

man egrep

Last edited by dura (2012-12-03 23:03:22)

Offline

#4246 2012-12-03 23:02:16

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Conky v1.9 Thread

@rusty_jones:  from the egrep man page:

   Context Line Control
       -A NUM, --after-context=NUM
              Print  NUM  lines of trailing context after matching lines.  Places a line
              containing a group separator (--) between contiguous  groups  of  matches.
              With the -o or --only-matching option, this has no effect and a warning is
              given.

Apparently the space between the -A and the number is not strictly necessary.

EDIT: ...apparently dura is faster on the draw than I...

Last edited by pvsage (2012-12-03 23:03:16)

Offline

#4247 2012-12-03 23:12:09

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Sector11 wrote:

Bunch of people to thank for this,

Well, thanks for the thanks, though I'm not too sure I deserve any!  I set one up for conkygooglecalendar/conkyemail with a list of the current days TV schedule of shows I want to watch if I'm not working on conky of course!  (M?)mrpeachy's v9000 weather script mixed with gcal and conkyforecast for the SR/SS times, and finally a system conky that shows pertinent sys info.  (and yes I had to go back and add in the 'greyclock' again.

Much thanks to mrpeachy, Sector11, McLovin, Kaivalagi and the rest of you that've helped me along my conky journey!  Screen-shot below... ( I'm sure there are a lot more folks that I could thank for all this, and I don't mean to disrespect any of you.  I've received nothing but help and kindness from all of you, so a BIG THANK-YOU to everyone! )

After giving it some thought, I thought, hey, what I have is just to "Plain"!  So what do you think, is this too busy? hehehe 8)

Last edited by jed (2012-12-04 03:16:06)


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#4248 2012-12-04 00:40:15

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

thank you all

Offline

#4249 2012-12-04 01:20:54

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

DrakarNoir wrote:

Sector11...mrpeachy...anyone!

I am working on the code (you have no idea how silly THAT sounds) to replace the Hour number on the clock face with the current Month name in sector11's chrono.

Here is what I believe to be the correct code section, with my changes/additions, though NOT the correct as it does not run. I know less than nothing about LUA (or any other language for that matter) and am basically trying to bodge my way through this. Ergo, the quiestion is this:

AM I close? If not, where to go. If so, what will it take to make it work?

hmm i'm looking through didier-t's script and (no offense meant) it is really overly complicated to do what it is doing

i am well acquainted with messy code myself and all the work that has gone into the chronograph design by the various contributers has created a good looking conky... but someone needs to clean this clock smile

but that may be easier said than done since there are now so many variations of the script around and everyone wants to do thier own tweak of it!

here is a short demo function which does the number-with-month replacement

require 'cairo'

function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function conky_main()
if conky_window == nil then return end
local updates=tonumber(conky_parse("${updates}"))
if updates<=3 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)
--hours, with month displayed instead of hour, 12 hour clock
mx=150
my=150
radius=90
cairo_select_font_face (cr, "mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 14)
cairo_set_source_rgba (cr,1,1,1,1)
month_number=tonumber(os.date("%m"))
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i))
local x=mx+radius*(math.sin(point))
local y=my-radius*(math.cos(point))
	if i==month_number then
	local text=os.date("%b")--month name
	cairo_text_extents(cr,text,extents)
   	local w=extents.width
    	local h=extents.height
	cairo_move_to(cr,x-(w/2),y-(h/2))
	cairo_show_text(cr,text)
	cairo_stroke (cr)
	else--if i does not = month_number
	local text=string.format("%02d",i)
	cairo_text_extents(cr,text,extents)
   	local w=extents.width
    	local h=extents.height
	cairo_move_to(cr,x-(w/2),y-(h/2))
	cairo_show_text(cr,text)
	cairo_stroke (cr)
	end--if
end--for loop
end-- end main function

Screenshot_at_2012_12_03_19_19_33.jpg

Last edited by mrpeachy (2012-12-04 03:05:51)

Offline

Be excellent to each other!

#4250 2012-12-04 01:41:19

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: Conky v1.9 Thread

This is my conky_weather script that works. under the TEXT area I put a couple of lines that retrieve baseball standings will baseball is in season. That also works.

I'm also trying to do that for football.  the first line works. the second line is a copy of the baseball standings, so it should also work, but it's not returning the standings.

so here is the conky and the py files.

conky_weather

##############################################
#  Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Mono:size=8
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 600 680
maximum_width 700
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 10
update_interval 1

lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/v9000/s11template.lua

TEXT

${voffset 550}${offset -06}${color  #EFEFEF}${font freemono:size=12} National Football League ${hr 1}
${voffset 10}${offset -24}${color   #EFEFEF}${font freemono:size=12}${exec home/rusty/.conky/football/standings_nfl.py}

#${voffset 530}${offset -06}${color  #CA1F2C}${font freemono:size=12} National League ${hr 1}
#${voffset 10}${offset -24}${color  #FFFFFF}${font freemono:size=12}${exec ~/.conky/baseball/standings_nl.py}

standings_nfl.py

#!/usr/bin/env python
import os
filename = "http://espn.go.com/nfl/standings | egrep -A20 'National Football League'"
cmd = os.popen("lynx -nonumbers -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

Last edited by rusty_jones (2012-12-04 01:50:30)

Offline

Board footer

Powered by FluxBB

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

Debian Logo