Conky Support, Codes and Screenshots

dizzie

Next time, send me a PM, instead of letting the world know that imagecrap.us suck balls :)
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

Sector11

@dizzie
Next time, send me a PM, instead of letting the world know that imagecrap.us suck balls :)



Would that be golf balls, tennis balls, baseballs, hardballs, footballs etc etc .....

Only one way to fix this faux-pas:

11 Apr 13 | 11:24:58 ~
         $ vuze send cake dizzie

11 Apr 13 | 11:25:58 ~
         $ ...done

11 Apr 13 | 11:25:58 ~
         $


Stay Home

falldown



Simple conky to fit the new wall!  :)

Sector11

Boy, that's a tough one.  Take forever to duplicate that!  8)

You've just proved that "simple" can be beautiful! ;)

I can do simple too ...
... somewhere between the first conky command and the 267th command there has to be a simple one in there - someplace!  :D
Stay Home

Sector11

I have a new conky that is simple SIMPLE SiMpLe - consists of one line under TEXT - but you really need to see it with the right wallpaper to appreciate it properly:

TEXT
${font FFF Tusj:size=100}VSIDO${font}
Stay Home

blaze

great stuff Sector11, gave me a good `n` well needed  :D after a tough week
blazingaway

jedi

Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

Sector11

@ blaze - I was wondering if anyone would take the time to look.  I thought it was worth the  :D as well.

@ jedi - you're not alone.
Stay Home

lwfitz

Is there a way to show more that two colors in a net speed graph?
For instance my code is

${downspeedgraph eth0 20,75 0066CC CC0000 }

Which starts red and fades into blue but I would like to have red fade into orange-yellow-green-blue and then finally into purple......

Any ideas?
Don't Be A Dick!

VastOne

I know this is possible... I have seen it setup on #! and I believe Sector11 will have the answers
VSIDO      VSIDO Change Blog    

    I dev VSIDO

lwfitz

Thanks, yeah I know Ive seen something similar but for the life of me I cant find it. Sector11 always has the answer....  ??? ???
Don't Be A Dick!

Sector11

No I don't have the answer ... I "think" this might do the trick though woulf did a script: Bargraph widget.  He did that long before I even understood how to use a LUA script.  :D

Near the bottom 3/4 of the way down I see a multi-colour graph: green yellow white red blue

Not sure is mrpeachy did one as well or not.
Stay Home

lwfitz

Quote from: Sector11 on April 15, 2013, 06:17:01 PM
No I don't have the answer ... I "think" this might do the trick though woulf did a script: Bargraph widget.  He did that long before I even understood how to use a LUA script.  :D

Near the bottom 3/4 of the way down I see a multi-colour graph: green yellow white red blue

Not sure is mrpeachy did one as well or not.


Thanks buddy Ill check it out..... and you have the answer..... you just dont know what it is yet  8)
Don't Be A Dick!

lwfitz

My current config that Im working on




conky_system
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 285 1000
maximum_width 285
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes


## Set the path to your script here.
lua_load /home/luke/Conky/allcombined_2.lua

#lua_load ~/Conky/bargraph.lua
#lua_draw_hook_pre main_bars


## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left

#${lua draw_bg {10,0,0,0,0,0x000000,0.5}}

TEXT
${lua draw_bg {20,12,2,268,140,0xFFFFFF,.1,2,1}}${image /home/luke/Conky/red_2.png -p 0,-7}
${goto 25}${voffset 4}${font Pseudo APL:bold:size=10}CPU Average ${lua gradbar {125,27,"${cpu cpu0}",100,48,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -12}${cpu cpu0}${font Sans:bold:size=10}%       
#${font saxmono:bold:normal:size=10}${color1}k${voffset -1}${font}${color2} TEMP ${hwmon 1 temp 1}°C${lua gradbar {90,127,"${hwmon 1 temp 1}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,.5,0xFFFF33,.65,0xCC0000,1}}
${goto 25}${font Pseudo APL:bold:size=10}${voffset 1}CPU1 ${lua gradbar {72,42,"${cpu cpu1}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu1}${font Sans:bold:size=10}%       
${goto 25}${font Pseudo APL:bold:size=10}CPU2 ${lua gradbar {72,57,"${cpu cpu2}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu2}${font Sans:bold:size=10}%       
${goto 25}${font Pseudo APL:bold:size=10}CPU3 ${lua gradbar {72,72,"${cpu cpu3}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu3}${font Sans:bold:size=10}%       
${goto 25}${font Pseudo APL:bold:size=10}CPU4 ${lua gradbar {72,87,"${cpu cpu4}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu4}${font Sans:bold:size=10}%       
${goto 25}${font Pseudo APL:bold:size=10}CPU5 ${lua gradbar {72,102,"${cpu cpu5}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu5}${font Sans:bold:size=10}%       
${goto 25}${font Pseudo APL:bold:size=10}CPU6 ${lua gradbar {72,117,"${cpu cpu6}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu6}${font Sans:bold:size=10}%       
#${hr 2}



${lua draw_bg {20,12,165,268,75,0xFFFFFF,.1,2,1}}${goto 25}${font Pseudo APL:bold:size=10}RAM${goto 115}${mem}${goto 155} / ${memmax}
${lua gradbar {27,191,"${memperc}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${memperc}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}SWAP${goto 115}${swap}${goto 155} / ${swapmax}
${lua gradbar {27,220,"${swapperc}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${swapperc}${font Sans:bold:size=10}% 
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,235}


${lua draw_bg {20,12,275,268,200,0xFFFFFF,.1,2,1}}
${voffset -8}${goto 25}${font Pseudo APL:bold:size=10}${voffset 10}/${goto 105}${fs_used /}${goto 155} / ${fs_size /}
${lua gradbar {27,298,"${fs_used_perc /}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}/Home${goto 105}${fs_used  /home}${goto 155} / ${fs_size  /home}
${lua gradbar {27,328,"${fs_used_perc /home}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc  /home}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}External${goto 105}${fs_used /media/sdf5}${goto 155} / ${fs_size /media/sdf5}
${lua gradbar {27,358,"${fs_used_perc /media/sdf5}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdf5}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}Software${goto 105}${fs_used /media/sdc1}${goto 155} / ${fs_size /media/sdc1}
${lua gradbar {27,388,"${fs_used_perc /media/sdc1}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdc1}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}Storage${goto 105}${fs_used /media/storage}${goto 155} / ${fs_size /media/storage}
${lua gradbar {27,418,"${fs_used_perc /media/storage}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/storage}${font Sans:bold:size=10}% 
${goto 25}${font Pseudo APL:bold:size=10}Media${goto 105}${fs_used /media/sdd1}${goto 155} / ${fs_size /media/sdd1}
${lua gradbar {27,448,"${fs_used_perc /media/sdd1}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdd1}${font Sans:bold:size=10}% 
#${font Pseudo APL:bold:size=10}Storage${goto 105}${fs_used /media/storage}${goto 155} / ${fs_size /media/storage}
#${lua gradbar {5,457,"${fs_used_perc /media/storage}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/storage}${font Sans:bold:size=10}%${voffset 8} 
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,450}


${lua draw_bg {20,12,500,268,100,0xFFFFFF,.1,2,1}}
${voffset -4}${goto 25}${font Pseudo APL:bold:size=10}CPU Temp
${lua gradbar {27,520,"${platform it87.656 temp 1}",200,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${platform it87.656 temp 1}°
${goto 25}${font Pseudo APL:bold:size=10}System Temp
${lua gradbar {27,550,"${platform it87.656 temp 2}",200,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${platform it87.656 temp 2}°
${goto 25}${font Pseudo APL:bold:size=10}GPU Temp
${lua gradbar {27,580,"${nvidia temp}",220,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${nvidia temp}°${voffset 4}
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,570}

${lua draw_bg {20,12,629,268,103,0xFFFFFF,.1,2,1}}
${voffset 8}${goto 25}${font Pseudo APL:bold:size=10}NAME ${goto 120}   PID    CPU     MEM
${goto 25}${top name 1} ${alignr 25} ${top pid 1} ${top cpu 1} ${top mem 1}
${goto 25}${top name 2} ${alignr 25} ${top pid 2} ${top cpu 2} ${top mem 2}
${goto 25}${top name 3} ${alignr 25} ${top pid 3} ${top cpu 3} ${top mem 3}
${goto 25}${top name 4} ${alignr 25} ${top pid 4} ${top cpu 4} ${top mem 4}
${goto 25}${top name 5} ${alignr 25} ${top pid 5} ${top cpu 5} ${top mem 5}
#${top name 6} ${alignr 5} ${top pid 6} ${top cpu 6} ${top mem 6}
#${top name 7} ${alignr 5} ${top pid 7} ${top cpu 7} ${top mem 7}
#${top name 8} ${alignr 5} ${top pid 8} ${top cpu 8} ${top mem 8}%{voffset -8}
#${hr 2}   
#${voffset 10}${goto 50}${font Sans:size=22}${time %I:%M %p}
#${lua luacal {100,425,"Sans",10,0x00FF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0x00FF00,1," ",20,18,16,0}}
#${goto 15}${font Sans:bold:size=12}${time %d}${font}
#${goto 15}${time %B}
#${goto 15}${time %Y}
#${voffset 40}${hr 2}
#${voffset 10}${font Sans:size=10}Connection Type ${goto 220}${gw_iface}
#I.P${goto 173}${addr eth0}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,700}


${lua draw_bg {20,12,760,268,223,0xFFFFFF,.1,2,1}}
#${goto 25}Downloads
${goto 25}Down Speed${goto 125}${downspeed eth0}
${goto 25}Today:${alignr 25}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}
${goto 25}Week:${alignr 20}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $3 $4}'}
${goto 25}Month:${alignr 25}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}
${goto 20}${downspeedgraph eth0 30,250 FFFF00 CC0000 -t}
${goto 25}Up Speed${goto 125}${upspeed eth0}
${goto 25}Today: ${alignr 25}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
${goto 25}Week: ${alignr 20}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}
${goto 25}Month: ${alignr 25}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}
#${goto 25}Uploads
${goto 20}${upspeedgraph eth0 30,250 FFFF00 CC0000 000000 -t}





allcombined_2.lua (by mrpeachy)
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end

function conky_gradbar(bartab)
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_draw_bg(bgtab)
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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
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))
--the drawing part---------------------------
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)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luacal(caltab)
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)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--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)
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
for i=1,7 do
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

function conky_luaimage(imtab)
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)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--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))
--the drawing part---------------------------
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_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function

function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function




conky_weather
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 370 420
maximum_width 370
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 20
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
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

### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua


## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
#${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0xFFFFFF,0.05}}${image /home/luke/Conky/red_2.png -p 25,-7}
${lua draw_bg {20,0,18,370,405,0xFFFFFF,.1,2,1}}${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,18}${image /home/luke/Conky/red_3.png -p -7,0}

${goto 70}${font Pseudo APL:Bold:size=20}${texeci 500 bash $HOME/1b1_accuweather_images/1b1}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°F
${font Pseudo APL:bold:size=15}${goto 10}Dawn${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}${image /home/luke/1b1_accuweather_images/cc.png -p 130,15 -s 260x180}
${font Pseudo APL:bold:size=15}${goto 10}Dusk${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}
${font Pseudo APL:bold:size=15}${goto 10}Rain${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}
${font Pseudo APL:bold:size=15}${goto 10}Clouds${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
#${font Pseudo APL:Bold:size=14}${goto 10}Wind ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}

${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}${goto 260}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}



${image $HOME/1b1_accuweather_images/6.png -p 0,190 -s 115x79}${image $HOME/1b1_accuweather_images/11.png -p 122,190 -s 115x79}${image $HOME/1b1_accuweather_images/16.png -p 242,190 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°F${goto 280}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°F${voffset -9}

${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}${goto 260}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}
${image $HOME/1b1_accuweather_images/21.png -p 0,310 -s 115x79}${image $HOME/1b1_accuweather_images/last_2.png -p 122,310 -s 115x79}${image $HOME/1b1_accuweather_images/last_7.png -p 242,310 -s 115x79}



${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°F${goto 280}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°F${voffset -9}



The weather script is by TeoBigusGeekus, The script along with my
images can be downloaded here. Just extract the archive to your home folder. To get the correct url for your city just follow the read me in the archive.
Download here



conky_clock
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 450 200
maximum_width 450
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment bottom_middle
gap_x 975
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
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

### LUA Load ###
lua_load /home/luke/Conky/text_clock.lua
lua_draw_hook_post draw_text

TEXT
#${lua draw_bg {25,0,0,0,0,0x000000,0.3}}



text_clock.lua

--[[
text        - text to display, default = "Conky is good for you"
  use conky_parse to display conky value ie text=conly_parse("${cpu cpu1}")
            - coordinates below are relative to top left corner of the conky window
x           - x coordinate of first letter (bottom-left), default = center of conky window
y           - y coordinate of first letter (bottom-left), default = center of conky window
h_align - horizontal alignement of text relative to point (x,y), default="l"
  available values are "l": left, "c" : center, "r" : right
v_align - vertical alignment of text relative to point (x,y), default="b"
  available values "t" : top, "m" : middle, "b" : bottom
font_name   - name of font to use, default = Free Sans
font_size   - size of font to use, default = 14
italic      - display text in italic (true/false), default=false
oblique     - display text in oblique (true/false), default=false (I don' see the difference with italic!)
bold        - display text in bold (true/false), default=false
angle       - rotation of text in degrees, default = 0 (horizontal)
colour      - table of colours for text, default = plain white {{1,0xFFFFFF,1}}
  this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = beginning of text, 1= end of text)
              C=hexadecimal colour
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle of the text
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
  and so on ...
orientation - in case of gradient, "orientation" defines the starting point of the gradient, default="ww"
  there are 8 available starting points : "nw","nn","ne","ee","se","ss","sw","ww"
  (n for north, w for west ...)
  theses 8 points are the 4 corners + the 4 middles of text's outline
  so a gradient "nn" will go from "nn" to "ss" (top to bottom, parallele to text)
  a gradient "nw" will go from "nw" to "se" (left-top corner to right-bottom corner)
radial - define a radial gradient (if present at the same time as "orientation", "orientation" will have no effect)
  this parameter is a table with 6 numbers : {xa,ya,ra,xb,yb,rb}
  they define two circle for the gradient :
  xa, ya, xb and yb are relative to x and y values above
reflection_alpha    - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                      other values = starting opacity
reflection_scale    - scale of the reflection (default = 1 = height of text)
reflection_length   - length of reflection, define where the opacity will be set to zero
  calues from 0 to 1, default =1
skew_x,skew_y    - skew text around x or y axis
]]
require 'cairo'

function conky_draw_text()
    text_settings={

       {
        text="" ..conky_parse("${time %I:%M%P}"),
        x=100,
        y=150,
        colour={{0,0xCC0000,.75},{0.8,0xFFFFFF,0.6},{1,0xCC0000,0.75}},
        orientation="nn",
        font_name="LuxiMono",
        bold=true,
        font_size=80,
        },       
       {
        text="" .. conky_parse("${time %I:%M%P}"),
        x=99,
        y=149,
        colour={{0,0xFFFFFF,0.75},{.2,0xCC0000,0.4},{.8,0xFFFFFF,.75}},
        orientation="nn",
        font_name="LuxiMono",
        bold=true,
        font_size=80,
        },
        {
        text="" .. conky_parse("${time %D}"),
        x=138,
        y=189,
        colour={{0,0xCC0000,.75},{0.8,0xFFFFFF,0.6},{1,0xCC0000,0.75}},
        orientation="nn",
        font_name="LuxiMono",
        bold=true,
        font_size=40,
        },
       {
        text="" .. conky_parse("${time %D}"),
        x=137,
        y=190,
        colour={{0,0xFFFFFF,0.75},{.2,0xCC0000,0.4},{.8,0xFFFFFF,.75}},
        orientation="nn",
        font_name="LuxiMono",
        bold=true,
        font_size=40,
        },
}

if conky_window == nil then return end
if tonumber(conky_parse("$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)
   
    for i,v in pairs(text_settings) do
        display_text(v)
    end
   
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
end

function rgb_to_r_g_b(tcolour)
    colour,alpha=tcolour[2],tcolour[3]
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function display_text(t)
    if t.text==nil then t.text="Conky is good for you !" end
    if t.x==nil then t.x = conky_window.width/2 end
    if t.y==nil then t.y = conky_window.height/2 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
    if t.font_name==nil then t.font_name="Free Sans" end
    if t.font_size==nil then t.font_size=14 end
    if t.angle==nil then t.angle=0 end
    if t.italic==nil then t.italic=false end
    if t.oblique==nil then t.oblique=false end
    if t.bold==nil then t.bold=false end
    if t.radial ~= nil then
    if #t.radial~=6 then
    print ("error in radial table")
    t.radial=nil
    end
    end
    if t.orientation==nil then t.orientation="ww" end
    if t.h_align==nil then t.h_align="l" end
    if t.v_align==nil then t.v_align="b" end   
   
    cairo_save(cr)
    cairo_translate(cr,t.x,t.y)
    cairo_rotate(cr,t.angle*math.pi/180)
    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight =CAIRO_FONT_WEIGHT_NORMAL
    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
    cairo_select_font_face(cr, t.font_name, slant,weight)
    cairo_set_font_size(cr,t.font_size)
   
    for i=1, #t.colour do   
        if #t.colour[i]~=3 then
        print ("error in color table")
        t.colour[i]={1,0xFFFFFF,1}
        end
    end
    local te=cairo_text_extents_t:create()
    cairo_text_extents (cr,t.text,te)
    if #t.colour==1 then
        cairo_set_source_rgba(cr,rgb_to_r_g_b(t.colour[1]))
    else
local pat
    if t.radial==nil then
    local pts=linear_orientation(t,te)
    pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
else
pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
end

        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end
   
    local mx,my=0,0
   
    if t.h_align=="c" then
    mx=-te.width/2
    elseif t.h_align=="r" then
    mx=-te.width
end
    if t.v_align=="m" then
    my=-te.height/2-te.y_bearing
    elseif t.v_align=="t" then
    my=-te.y_bearing
end
cairo_move_to(cr,mx,my)

    cairo_show_text(cr,t.text)
    cairo_stroke(cr)
    cairo_restore(cr)
end


function linear_orientation(t,te)
local w,h=te.width,te.height
local xb,yb=te.x_bearing,te.y_bearing

    if t.h_align=="c" then
    xb=xb-w/2
    elseif t.h_align=="r" then
    xb=xb-w
    end
    if t.v_align=="m" then
    yb=-h/2
    elseif t.v_align=="t" then
    yb=0
    end
   
if t.orientation=="nn" then
p={xb+w/2,yb,xb+w/2,yb+h}
elseif t.orientation=="ne" then
p={xb+w,yb,xb,yb+h}
elseif t.orientation=="ww" then
p={xb,h/2,xb+w,h/2}
elseif vorientation=="se" then
p={xb+w,yb+h,xb,yb}
elseif t.orientation=="ss" then
p={xb+w/2,yb+h,xb+w/2,yb}
elseif vorientation=="ee" then
p={xb+w,h/2,xb,h/2}
elseif t.orientation=="sw" then
p={xb,yb+h,xb+w,yb}
elseif t.orientation=="nw" then
p={xb,yb,xb+w,yb+h}
end
return p
end











Don't Be A Dick!

Sector11

I have lots of answers - it's matching them with the right questions that I have problems with.  :D
Stay Home