1,201

Re: My Conky Config

mrpeachy wrote:

if you want more variety in your graphs (and dont mind tinkering a bit with scripts) then I have updated an earlier post
http://crunchbanglinux.org/forums/post/56135/#p56135

Nice stuff mrpeachy, very nice indeed.

Last edited by Sector11 (2010-08-26 02:24:06)

Re: My Conky Config

Hi,

I had some time to tinker with conky a bit today and this is what I came up with. I like my desk clean and simple.

http://dl.dropbox.com/u/10650436/2010-08-27-210617_1920x1200_scrot.png

##############################################
#  Settings
##############################################
background yes
use_xft yes
xftfont HandelGotD:size=8
xftalpha 0.5
update_interval 4.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1920
maximum_width 1920
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
#default_color grey
default_color 707070
default_shade_color red
default_outline_color green
alignment bm
gap_x -60
gap_y -28
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT

${voffset -8}${font openlogos:size=12} u${font} ${voffset -3} ${kernel} ${voffset 0}${font StyleBats:size=12} A${font} ${voffset -3}CPU 1: ${cpu cpu0}% ${cpubar cpu0 8,40 467abb 467abb} ${voffset 0}${font StyleBats:size=12} A${font} ${voffset -3}CPU 2: ${cpu cpu1}% ${cpubar cpu1 8,40} ${voffset 0}${font StyleBats:size=12} g${font} ${voffset -3}RAM: $memperc% ${membar 8,40} ${voffset 0}${font StyleBats:size=12} j${font} ${voffset -3}SWAP: $swapperc% ${swapbar 8,40} ${voffset -3}${font Pie charts for maps:size=12} 7${font} ${voffset -3}Root: ${fs_bar 8,40 /} ${voffset -3}${font Pie charts for maps:size=12} 7${font} ${voffset -3}DATA1: ${fs_bar 8,40 /media/DATA1} ${voffset -3}${font Pie charts for maps:size=12} 7${font} ${voffset -3}DATA2: ${fs_bar 8,40 /media/DATA2} ${voffset 0}${font StyleBats:size=12} Z${font} ${voffset -3}HDD 1: ${execi 10 hddtemp /dev/sda |cut -c28-31} ${voffset 0}${font StyleBats:size=12} Z${font} ${voffset -3}HDD 2: ${execi 10 hddtemp /dev/sdb |cut -c34-37} ${voffset -3}${font PizzaDude Bullets:size=12} O${font} Out: ${upspeed eth0} kb/s ${upspeedgraph eth0 8,40 467abb 467abb} ${voffset -3}${font PizzaDude Bullets:size=12} U${font} In: ${downspeed eth0} kb/s ${downspeedgraph eth0 8,40 467abb 467abb} ${voffset -3}${font PizzaDude Bullets:size=12} a${font} Local IP: ${addr eth0} ${voffset 0}${font StyleBats:size=12} q${font} ${voffset -3}Uptime: ${uptime}

Mic

Mic

1,203

Re: My Conky Config

crunchmic wrote:

Hi,

I had some time to tinker with conky a bit today and this is what I came up with. I like my desk clean and simple.

Mic

Yes you do!  Would you share the wallpaper.

Re: My Conky Config

Sector11 wrote:
crunchmic wrote:

Hi,

I had some time to tinker with conky a bit today and this is what I came up with. I like my desk clean and simple.

Mic

Yes you do!  Would you share the wallpaper.

Sure, it was done by a friend of mine on deviantart.  wink

Get it here: http://tinyurl.com/3xn7or2

Mic

Mic

1,205

Re: My Conky Config

crunchmic wrote:

Sure, it was done by a friend of mine on deviantart.  wink

Get it here: http://tinyurl.com/3xn7or2

Mic

Thank you.

1,206

Re: My Conky Config

here is a concept for a conky display i have been thinking about for a while

http://blip.tv/file/4057207

the interesting part starts at 10 seconds smile

i just need to figure out if i can make the process automated and configurable

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

Re: My Conky Config

mrpeachy wrote:

here is a concept for a conky display i have been thinking about for a while

http://blip.tv/file/4057207

the interesting part starts at 10 seconds smile

i just need to figure out if i can make the process automated and configurable

THAT is totally slick!!
They should hand you some sort of Conky Lifetime Achievement Award!!

Wish I was better at conky. A lot of ideas I can't realize thanks to my Lua illiteracy :-(

Last edited by gutterslob (2010-08-29 00:28:37)

Point & Squirt

1,208

Re: My Conky Config

gutterslob wrote:

THAT is totally slick!!
They should hand you some sort of Conky Lifetime Achievement Award!!

Sorry I can't help... I'm Lua illiterate :-(

Thanks gutterslob! smile

right now it's in a concept stage... a bit of flim flammery contributing to make it work

but i hope to make it so that you can input any text, with some settings, and the lua works out everything else.

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,209

Re: My Conky Config

@ mrpeachy

WOW! ... I have to agree with gutterslob ..........

gutterslob wrote:

They should hand you some sort of Conky Lifetime Achievement Award!!

Conky has gone sooooooooo far beyond my abilities, because like Gutterslob, I am Lua illiterate.

Today I sit and watch what people like you are doing with conky ... and cloning a few tips here and there.

Last edited by Sector11 (2010-08-29 00:47:44)

1,210

Re: My Conky Config

@ sector11 - so you are saying that you can't teach an old dog new tricks? big_smile

here is an updated version of my animated text conky
thanks to iggykoopa it is now relatively simple for anyone to put anything they like in terms of output...
relatively compared to the last one, but it is still a bit tricky as you have to work out your timings
http://thumbnails26.imagebam.com/9537/81f8cf95367547.jpg
you can see it work here:
http://blip.tv/file/4059911

here is the code that makes it work

--animated text lua script by mrpeachy 2010
require 'cairo'

function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end


function number_to_words(text)
textlength=string.len(text)
textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
--for NUMBERS from 1 to 999
--for numbers 1 digit number----------
if textlength==1 then
    if texttable[1]=="1" then
    firstdigit="one"
    elseif texttable[1]=="2" then
    firstdigit="two"
    elseif texttable[1]=="3" then
    firstdigit="three"
    elseif texttable[1]=="4" then
    firstdigit="four"
    elseif texttable[1]=="5" then
    firstdigit="five"
    elseif texttable[1]=="6" then
    firstdigit="six"
    elseif texttable[1]=="7" then
    firstdigit="seven"
    elseif texttable[1]=="8" then
    firstdigit="eight"
    elseif texttable[1]=="9" then
    firstdigit="nine"
    elseif texttable[1]=="0" then
    firstdigit="zero"
    end
return firstdigit
end
--for 2 digit number------------------
if textlength==2 then
    if texttable[1]=="1" then
        seconddigit=""
        spacer=""
        if texttable[2]=="0" then
        firstdigit="ten"
        elseif texttable[2]=="1" then
        firstdigit="eleven"
        elseif texttable[2]=="2" then
        firstdigit="twelve"
        elseif texttable[2]=="3" then
        firstdigit="thirteen"
        elseif texttable[2]=="4" then
        firstdigit="fourteen"
        elseif texttable[2]=="5" then
        firstdigit="fifteen"
        elseif texttable[2]=="6" then
        firstdigit="sixteen"
        elseif texttable[2]=="7" then
        fisrtdigit="seventeen"
        elseif texttable[2]=="8" then
        firstdigit="eighteen"
        elseif texttable[2]=="9" then
        firstdigit="nineteen"
        end
    end   
    if texttable[1]>"1" then
        spacer=" "
        if texttable[1]=="2" then
        seconddigit="twenty"
        elseif texttable[1]=="3" then
        seconddigit="thirty"
        elseif texttable[1]=="4" then
        seconddigit="fourty"
        elseif texttable[1]=="5" then
        seconddigit="fifty"
        elseif texttable[1]=="6" then
        seconddigit="sixty"
        elseif texttable[1]=="7" then
        seconddigit="seventy"
        elseif texttable[1]=="8" then
        seconddigit="eighty"
        elseif texttable[1]=="9" then
        seconddigit="ninety"
        end    
        if texttable[2]=="1" then
        firstdigit="one"
        elseif texttable[2]=="2" then
        firstdigit="two"
        elseif texttable[2]=="3" then
        firstdigit="three"
        elseif texttable[2]=="4" then
        firstdigit="four"
        elseif texttable[2]=="5" then
        firstdigit="five"
        elseif texttable[2]=="6" then
        firstdigit="six"
        elseif texttable[2]=="7" then
        firstdigit="seven"
        elseif texttable[2]=="8" then
        firstdigit="eight"
        elseif texttable[2]=="9" then
        firstdigit="nine"
        elseif texttable[2]=="0" then
        firstdigit=""
        spacer=""
        end
     end
return ((seconddigit) .. (spacer) .. (firstdigit))
end
--for 3 digit numbers-----------------------------
if textlength==3 then
    if texttable[2]=="0" and texttable[3]=="0" then space="" end
    if texttable[2]>"0" or texttable[3]>"0" then space=" and " end
    if texttable[2]=="0" and texttable[3]>"0" then spacer="" end
    
    if texttable[1]=="1" then
    thirddigit="one hundred"
    elseif texttable[1]=="2" then
    thirddigit="two hundred"
    elseif texttable[1]=="3" then
    thirddigit="three hundred"
    elseif texttable[1]=="4" then
    thirddigit="four hundred"
    elseif texttable[1]=="5" then
    thirddigit="five hundred"
    elseif texttable[1]=="6" then
    thirddigit="six hundred"
    elseif texttable[1]=="7" then
    thirddigit="seven hundred"
    elseif texttable[1]=="8" then
    thirddigit="eight hundred"
    elseif texttable[1]=="9" then
    thirddigit="nine hundred"
    end
    if texttable[2]=="0" or texttable[2]>"1" then
        if texttable[3]=="1" then
        firstdigit="one"
        elseif texttable[3]=="2" then
        firstdigit="two"
        elseif texttable[3]=="3" then
        firstdigit="three"
        elseif texttable[3]=="4" then
        firstdigit="four"
        elseif texttable[3]=="5" then
        firstdigit="five"
        elseif texttable[3]=="6" then
        firstdigit="six"
        elseif texttable[3]=="7" then
        firstdigit="seven"
        elseif texttable[3]=="8" then
        firstdigit="eight"
        elseif texttable[3]=="9" then
        firstdigit="nine"
        elseif texttable[3]=="0" then
        firstdigit=""
        spacer=""
        end 
    end
    if texttable[2]=="1" then
        seconddigit=""
        spacer=""  
        if texttable[3]=="0" then
        firstdigit="ten"
        elseif texttable[3]=="1" then
        firstdigit="eleven"
        elseif texttable[3]=="2" then
        firstdigit="twelve"
        elseif texttable[3]=="3" then
        firstdigit="thirteen"
        elseif texttable[3]=="4" then
        firstdigit="fourteen"
        elseif texttable[3]=="5" then
        firstdigit="fifteen"
        elseif texttable[3]=="6" then
        firstdigit="sixteen"
        elseif texttable[3]=="7" then
        firstdigit="seventeen"
        elseif texttable[3]=="8" then
        firstdigit="eighteen"
        elseif texttable[3]=="9" then
        firstdigit="nineteen"
        end
    end
    if texttable[2] >"1" then
        spacer=" "    
        if texttable[2]=="2" then
        seconddigit="twenty"
        elseif texttable[2]=="3" then
        seconddigit="thirty"
        elseif texttable[2]=="4" then
        seconddigit="fourty"
        elseif texttable[2]=="5" then
        seconddigit="fifty"
        elseif texttable[2]=="6" then
        seconddigit="sixty"
        elseif texttable[2]=="7" then
        seconddigit="seventy"
        elseif texttable[2]=="8" then
        seconddigit="eighty"
        elseif texttable[2]=="9" then
        seconddigit="ninety"
        elseif texttable[2]=="0" then
        seconddigit=""
        end
    end
return ((thirddigit) .. (space) .. (seconddigit) .. (spacer) .. (firstdigit))
end
end--of function

function lengthreturn(n)
t1=n
end


function conky_draw_aniconk()
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 updates=tonumber(conky_parse('${updates}'))

if updates> 3 then

timer=(updates % 120)+1
timer2=(updates % 8)+1
if timer2==1 then
cpu=number_to_words(conky_parse("${cpu}"))
ram=number_to_words(conky_parse("${memperc}"))
end
if updates==4 then t1=1 end
-------------------------------------------------
timer=(updates % t1)+1
-------------------------------------------------
--settings for line 1
--enter text to be shown
line=("activating conky sys info...")
--enter animation cycle start time (in conky cycles)
start=0
--enter animation cycle length (to display entire string type "all")
length="all"
--enter static time after animation, to appear for remaning time type "remain"
pause="remain"
--enter position and font details
across=10
down=240
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 2
--enter text to be shown
line=("scanning system...")
--enter animation cycle start time (in conky cycles), if you want this to start after the line before finishes, type length
start=length
--enter animation cycle length (to display entire string type "all")
length="all"
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=260
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 3
--enter text to be shown
line=("processor at " .. cpu .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length
--enter animation cycle length
length=40
--enter static time after animation
pause=5
--enter position and font details
across=10
down=280
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 4
--enter text to be shown
line=("memory at " .. ram .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length-40
--enter animation cycle length
length=40
--enter static time after animation
pause=5
--enter position and font details
across=10
down=300
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 5
--enter text to be shown
line=("processor at " .. cpu .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length+pause
--enter animation cycle length
length=40
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=280
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 6
--enter text to be shown
line=("memory at " .. ram .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length-40
--enter animation cycle length
length=40
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=300
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 7
--enter text to be shown
line=("....end conky sys report")
--enter animation cycle start time (in conky cycles)
start=length
--enter animation cycle length
length="all"
--enter static time after animation
pause=1
--enter position and font details
across=10
down=320
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length
lengthreturn(length+pause)

end
end

plus you have to set your update interval in conky higher than once per second
in my example i used 4 cycles per second

there are a few kinks to be worked out and you will see plenty of error messages in the terminal until the script sorts itself out

Last edited by mrpeachy (2010-08-29 21:11:16)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,211

Re: My Conky Config

mrpeachy wrote:

@ sector11 - so you are saying that you can't teach an old dog new tricks? big_smile

here is an updated version of my animated text conky

No not quite. This old dog switched from the other OS to Linux with almost no problem - an open mind takes out a LOT of those "system specific" problems.

I'm simply saying that with the inclusion of Lua and and Cairo bindings in conky, I'm "behind the times", as I know nothing about them.  Didn't say I can't learn it, but I will say this it would be an uphill struggle for me.

Years ago I could do some programming in C-64 and DOS Basic and was quite often approached for BATch file help, but I have never gone beyond that.

Well except for the "basic" conky stuff, if you check my conkys, they are almost all comprised of others work adapted to my liking.  big_smile

Last edited by Sector11 (2010-08-30 00:02:36)

1,212

Re: My Conky Config

http://omploader.org/tNWZsMA
pursuing my idea of animation in conky I've made the above... you can see it in action here:

vid wasn't working too well for me so i uploaded it again
http://blip.tv/file/4083824

it serves no purpose whatsoever, but if you ever played games on the zx spectrum you will recognize what this is.

everything is drawn using cairo in lua.  You can change the size of Willy and everything stays in proportion *chuckle*
you can also easily change how far he walks before repeating

Last edited by mrpeachy (2010-09-05 05:05:50)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

Re: My Conky Config

^ Manic Miner!

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

1,214

Re: My Conky Config

mrpeachy wrote:

pursuing my idea of animation in conky I've made the above... you can see it in action here:
http://blip.tv/file/4080802

It serves a GREAT purpose.  Proving it can be done!

A journey of a 1000 miles begins with a single step.

Now you or someone else will find a proper use for it and make it useful.

Mean time: KUDOS! for that first step.

Last edited by Sector11 (2010-09-04 14:15:24)

1,215

Re: My Conky Config

mrpeachy wrote:

@ sector11 - so you are saying that you can't teach an old dog new tricks? big_smile

here is an updated version of my animated text conky
thanks to iggykoopa it is now relatively simple for anyone to put anything they like in terms of output...
relatively compared to the last one, but it is still a bit tricky as you have to work out your timings
http://thumbnails26.imagebam.com/9537/81f8cf95367547.jpg
you can see it work here:
http://blip.tv/file/4059911

here is the code that makes it work

--animated text lua script by mrpeachy 2010
require 'cairo'

function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end


function number_to_words(text)
textlength=string.len(text)
textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
--for NUMBERS from 1 to 999
--for numbers 1 digit number----------
if textlength==1 then
    if texttable[1]=="1" then
    firstdigit="one"
    elseif texttable[1]=="2" then
    firstdigit="two"
    elseif texttable[1]=="3" then
    firstdigit="three"
    elseif texttable[1]=="4" then
    firstdigit="four"
    elseif texttable[1]=="5" then
    firstdigit="five"
    elseif texttable[1]=="6" then
    firstdigit="six"
    elseif texttable[1]=="7" then
    firstdigit="seven"
    elseif texttable[1]=="8" then
    firstdigit="eight"
    elseif texttable[1]=="9" then
    firstdigit="nine"
    elseif texttable[1]=="0" then
    firstdigit="zero"
    end
return firstdigit
end
--for 2 digit number------------------
if textlength==2 then
    if texttable[1]=="1" then
        seconddigit=""
        spacer=""
        if texttable[2]=="0" then
        firstdigit="ten"
        elseif texttable[2]=="1" then
        firstdigit="eleven"
        elseif texttable[2]=="2" then
        firstdigit="twelve"
        elseif texttable[2]=="3" then
        firstdigit="thirteen"
        elseif texttable[2]=="4" then
        firstdigit="fourteen"
        elseif texttable[2]=="5" then
        firstdigit="fifteen"
        elseif texttable[2]=="6" then
        firstdigit="sixteen"
        elseif texttable[2]=="7" then
        fisrtdigit="seventeen"
        elseif texttable[2]=="8" then
        firstdigit="eighteen"
        elseif texttable[2]=="9" then
        firstdigit="nineteen"
        end
    end   
    if texttable[1]>"1" then
        spacer=" "
        if texttable[1]=="2" then
        seconddigit="twenty"
        elseif texttable[1]=="3" then
        seconddigit="thirty"
        elseif texttable[1]=="4" then
        seconddigit="fourty"
        elseif texttable[1]=="5" then
        seconddigit="fifty"
        elseif texttable[1]=="6" then
        seconddigit="sixty"
        elseif texttable[1]=="7" then
        seconddigit="seventy"
        elseif texttable[1]=="8" then
        seconddigit="eighty"
        elseif texttable[1]=="9" then
        seconddigit="ninety"
        end    
        if texttable[2]=="1" then
        firstdigit="one"
        elseif texttable[2]=="2" then
        firstdigit="two"
        elseif texttable[2]=="3" then
        firstdigit="three"
        elseif texttable[2]=="4" then
        firstdigit="four"
        elseif texttable[2]=="5" then
        firstdigit="five"
        elseif texttable[2]=="6" then
        firstdigit="six"
        elseif texttable[2]=="7" then
        firstdigit="seven"
        elseif texttable[2]=="8" then
        firstdigit="eight"
        elseif texttable[2]=="9" then
        firstdigit="nine"
        elseif texttable[2]=="0" then
        firstdigit=""
        spacer=""
        end
     end
return ((seconddigit) .. (spacer) .. (firstdigit))
end
--for 3 digit numbers-----------------------------
if textlength==3 then
    if texttable[2]=="0" and texttable[3]=="0" then space="" end
    if texttable[2]>"0" or texttable[3]>"0" then space=" and " end
    if texttable[2]=="0" and texttable[3]>"0" then spacer="" end
    
    if texttable[1]=="1" then
    thirddigit="one hundred"
    elseif texttable[1]=="2" then
    thirddigit="two hundred"
    elseif texttable[1]=="3" then
    thirddigit="three hundred"
    elseif texttable[1]=="4" then
    thirddigit="four hundred"
    elseif texttable[1]=="5" then
    thirddigit="five hundred"
    elseif texttable[1]=="6" then
    thirddigit="six hundred"
    elseif texttable[1]=="7" then
    thirddigit="seven hundred"
    elseif texttable[1]=="8" then
    thirddigit="eight hundred"
    elseif texttable[1]=="9" then
    thirddigit="nine hundred"
    end
    if texttable[2]=="0" or texttable[2]>"1" then
        if texttable[3]=="1" then
        firstdigit="one"
        elseif texttable[3]=="2" then
        firstdigit="two"
        elseif texttable[3]=="3" then
        firstdigit="three"
        elseif texttable[3]=="4" then
        firstdigit="four"
        elseif texttable[3]=="5" then
        firstdigit="five"
        elseif texttable[3]=="6" then
        firstdigit="six"
        elseif texttable[3]=="7" then
        firstdigit="seven"
        elseif texttable[3]=="8" then
        firstdigit="eight"
        elseif texttable[3]=="9" then
        firstdigit="nine"
        elseif texttable[3]=="0" then
        firstdigit=""
        spacer=""
        end 
    end
    if texttable[2]=="1" then
        seconddigit=""
        spacer=""  
        if texttable[3]=="0" then
        firstdigit="ten"
        elseif texttable[3]=="1" then
        firstdigit="eleven"
        elseif texttable[3]=="2" then
        firstdigit="twelve"
        elseif texttable[3]=="3" then
        firstdigit="thirteen"
        elseif texttable[3]=="4" then
        firstdigit="fourteen"
        elseif texttable[3]=="5" then
        firstdigit="fifteen"
        elseif texttable[3]=="6" then
        firstdigit="sixteen"
        elseif texttable[3]=="7" then
        firstdigit="seventeen"
        elseif texttable[3]=="8" then
        firstdigit="eighteen"
        elseif texttable[3]=="9" then
        firstdigit="nineteen"
        end
    end
    if texttable[2] >"1" then
        spacer=" "    
        if texttable[2]=="2" then
        seconddigit="twenty"
        elseif texttable[2]=="3" then
        seconddigit="thirty"
        elseif texttable[2]=="4" then
        seconddigit="fourty"
        elseif texttable[2]=="5" then
        seconddigit="fifty"
        elseif texttable[2]=="6" then
        seconddigit="sixty"
        elseif texttable[2]=="7" then
        seconddigit="seventy"
        elseif texttable[2]=="8" then
        seconddigit="eighty"
        elseif texttable[2]=="9" then
        seconddigit="ninety"
        elseif texttable[2]=="0" then
        seconddigit=""
        end
    end
return ((thirddigit) .. (space) .. (seconddigit) .. (spacer) .. (firstdigit))
end
end--of function

function lengthreturn(n)
t1=n
end


function conky_draw_aniconk()
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 updates=tonumber(conky_parse('${updates}'))

if updates> 3 then

timer=(updates % 120)+1
timer2=(updates % 8)+1
if timer2==1 then
cpu=number_to_words(conky_parse("${cpu}"))
ram=number_to_words(conky_parse("${memperc}"))
end
if updates==4 then t1=1 end
-------------------------------------------------
timer=(updates % t1)+1
-------------------------------------------------
--settings for line 1
--enter text to be shown
line=("activating conky sys info...")
--enter animation cycle start time (in conky cycles)
start=0
--enter animation cycle length (to display entire string type "all")
length="all"
--enter static time after animation, to appear for remaning time type "remain"
pause="remain"
--enter position and font details
across=10
down=240
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 2
--enter text to be shown
line=("scanning system...")
--enter animation cycle start time (in conky cycles), if you want this to start after the line before finishes, type length
start=length
--enter animation cycle length (to display entire string type "all")
length="all"
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=260
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 3
--enter text to be shown
line=("processor at " .. cpu .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length
--enter animation cycle length
length=40
--enter static time after animation
pause=5
--enter position and font details
across=10
down=280
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 4
--enter text to be shown
line=("memory at " .. ram .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length-40
--enter animation cycle length
length=40
--enter static time after animation
pause=5
--enter position and font details
across=10
down=300
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 5
--enter text to be shown
line=("processor at " .. cpu .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length+pause
--enter animation cycle length
length=40
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=280
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 6
--enter text to be shown
line=("memory at " .. ram .. " percent....................................................")
--enter animation cycle start time (in conky cycles)
start=length-40
--enter animation cycle length
length=40
--enter static time after animation
pause="remain"
--enter position and font details
across=10
down=300
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length

--settings for line 7
--enter text to be shown
line=("....end conky sys report")
--enter animation cycle start time (in conky cycles)
start=length
--enter animation cycle length
length="all"
--enter static time after animation
pause=1
--enter position and font details
across=10
down=320
fontsize=12
font="Mono"
---------------------------------------------------
if length=="all" then length=string.len(line) end
remain=t1-length-start
if pause=="remain" then pause=remain end
sub=string.gsub(line, ".", "%1|")
split=string.split(sub, "|")
time=start+length+pause
tab={}
for i=1,table.getn(split) do
   temp = ""
   for ii=1,i do
     temp = (temp .. split[ii])
     tab[i]=temp
  end
end
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr, 1, 1, 1, 1)
if timer>start and timer<=start+length then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[timer-start])
end
if timer>start+length and timer<=start+length+pause then
cairo_move_to (cr, across, down)
cairo_show_text (cr, tab[length])
end
length=start+length
lengthreturn(length+pause)

end
end

plus you have to set your update interval in conky higher than once per second
in my example i used 4 cycles per second

there are a few kinks to be worked out and you will see plenty of error messages in the terminal until the script sorts itself out

It would be nice with a blinking square cursor like in a terminal. Also blinking alone before starting the writing.

1,216

Re: My Conky Config

bastiano wrote:

It would be nice with a blinking square cursor like in a terminal. Also blinking alone before starting the writing.

Your absolutely right bastiano.  I had a flashing cursor in mind when i was thinking about the concept.  I just didn't get round to putting it in.

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,217

Re: My Conky Config

http://omploader.org/tNWZ6Nw

here is an idea for visualizing cpu usage (or any usage i guess)

it shows the current and, in this case, past 100 values for cpu as a transparent square on the 10 by 10 grid.
overlaying squares so that the brighter squares show you what % numbers your cpu has been at the most.

you can color things up too like so,

http://omploader.org/tNWZ6ZA

or have just one color

increasing the range of the recorded value will probably lead to something more colorful
this is with 250 saved numbers
http://omploader.org/tNWZ6bA

here is what it looks like (poor quality vid from recordmydesktop) ...and having recordmydesktop running, and switching conky to 4 updates per second has pushed all the squares to the bottom few rows!  But if you watch you will see the color change occurring as older cpu numbers change according to a gradient.

http://blip.tv/file/4083814

here is the lua script which does it

--[[conky squares by mrpeachy (2010)  if you want more that 1 square from this script then there are some things to change.  
I have done my best to provide adequate instructions through the script  setup begins at line 150]]

require 'cairo'
function bg(hori, vert, thick, br, bg, bb, ba)
across=hori-(thick*9)
down=vert+block
block=thick*10
cairo_translate (cr, across, down)
cairo_set_line_width (cr, 1)
cairo_set_source_rgba (cr, br, bg, bb, 1)
cairo_rectangle (cr, 0,0,block,block)
cairo_stroke (cr)
cairo_translate (cr, -across, -down)
end

function squaredraw(cr, num, hori, vert, thick, red, green, blue, alpha)
block=thick
down=vert
start=hori
row=1
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=2
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=3
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=4
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=5
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=6
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=7
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=8
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=9
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end
row=10
for i=((row*10)-9),(row*10) do
if num==i then
across=start+(i*block)-((10*row)*block)
down=down+(block*row)
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, red, green, blue, alpha)
cairo_rectangle (cr, 0,0,block,block)
cairo_fill (cr)
cairo_translate (cr, -across, -down)
end
end

end--of function

function conky_square()
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 updates=tonumber(conky_parse('${updates}'))
if updates==1 then 
--------TABLE SETUP--------------
--to have more than 1 squares of this type running you will need to add more table sets to this section

length_cpugraph=100 --this is how many values to record
cpugraph={} --this is the table that will hold your data
cpured={} -- these tables hold the data for the color and alphga gradients
cpugreen={}
cpublue={}
cpualpha={}
        
--tables must be setup in the space above----
-------END TABLE SETUP-----------------------  
    end
    if updates> 3 then

--square settings entered below---------------------------------------------
----------------------------------------------------------------
--You will need one square setup for each table set you used
----------------------------------------------------------------
length=length_cpugraph --from table setup above
----------------------------------------------------------------
hori=200
vert=100
--thick=block size 
thick=20
--color 1 and alpha 1
linered=0
linegreen=1
lineblue=1
linealpha=0.1
--color 2 and alpha 2
linered2=1
linegreen2=0
lineblue2=1
linealpha2=0.1
----------------------------------------------------------------------------------------------------------------------------------------------------
--do not edit the below 4 lines
rd=(linered-linered2)/length
gd=(linegreen-linegreen2)/length
bd=(lineblue-lineblue2)/length
ad=(linealpha-linealpha2)/length
----------------------------------------------------------------------------------------------------------------------------------------------------
--CALCULATIONS -- you will have to edit this section and change all the instances 
--of cpugraph, cpured, cpugreen etc, to whatever names you used in the table setup section
--you could cut this section to a blank document and do a find and replace.
for i = 1, tonumber(length) do
if cpugraph[i+1]==nil then cpugraph[i+1]=0 end
cpugraph[i]=cpugraph[i+1]    
if i==length then
cpugraph[length]=tonumber(conky_parse('${cpu}'))
end
for i = 1, tonumber(length) do
cpured[i]=linered-(rd*i)
end
for i = 1, tonumber(length) do
cpugreen[i]=linegreen-(gd*i)
end
for i = 1, tonumber(length) do
cpublue[i]=lineblue-(bd*i)
end
for i = 1, tonumber(length) do
cpualpha[i]=linealpha-(ad*i)
end
--END OF CALCULATIONS
--------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------
--ENTER TABLE NAMES BELOW---------------------------------------------------------
---------------------------------------------------------------------------------
table1=cpugraph[i]  --format should be nameoftable[i]
table2=cpured[i] --table that contains red data
table3=cpugreen[i]--table that contains green data
table4=cpublue[i]--table that contains blue data
table5=cpualpha[i]--table that contains alpha data
--call line drawing function
squaredraw(cr, table1, hori, vert, thick, table2, table3, table4, table5)
end 
--square settings entered above----------------------------------------------------------------------------------------

--call background
bg(hori, vert, thick, linered, linegreen, lineblue, linealpha)

cairo_destroy(cr)
cairo_surface_destroy(cs)
end
end

Last edited by mrpeachy (2010-09-05 05:09:59)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,218

Re: My Conky Config

^ This is another beauty, mrpeachy.

1,219

Re: My Conky Config

bastiano wrote:

^ This is another beauty, mrpeachy.

Could not agree more.  mrpeachy does great stuff.

1,220

Re: My Conky Config

heres a bit of conky trickery you might like

obviously a prototpe to test an idea to make conky a little more interactive

http://blip.tv/file/4086245

or

http://blip.tv/file/get/Jmcdowall-conky … rol466.ogv

Last edited by mrpeachy (2010-09-06 01:22:47)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,221

Re: My Conky Config

working some more on my interactive conky

i have a lua/cairo generated calendar! yay
complete with current day indicator

http://omploader.org/tNWdpeA

ill post a short clip of how it works in a bit - here

http://blip.tv/file/4088310

Last edited by mrpeachy (2010-09-06 19:40:37)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,222

Re: My Conky Config

mrpeachy wrote:

working some more on my interactive conky

i have a lua/cairo generated calendar! yay
complete with current day indicator

http://omploader.org/tNWdpeA

ill post a short clip of how it works in a bit

Hi Mr Conky,

How do you get the interactive display? here is the method I use, associated with a ob shortcut, Is there someting more simple ?

flag="/tmp/flag-fip"
if [ -f $flag ]; then
    for p in  `tail $flag`
    do
        kill $p
    done
    rm $flag
else
    vlc --intf=http http://www.tv-radio.com/station/fip_mp3/fip_mp3-128k.m3u &
    echo $! > $flag
    conky -c ~/.config/openbox/bureau/conkyrc-fip  &
    echo $! >> $flag
fi

this one launch a radio stream and a conky associated with it (posted here http://ubuntuforums.org/showpost.php?p= … unt=12525)

1,223

Re: My Conky Config

@ wlourf
well the method i thought up is embarassingly untechnical smile

I have my lua script watching text files like this:

read1 = io.open("/tmp/test.txt", "r")
input1 = read1:read("*lines")

then my commands from the menu simply edits the text files smile

touch /tmp/test.txt; echo "1" > /tmp/test.txt

then if's in the lua script to change the display

currently i am just executing terminal commands from the menu, which causes the terminal to pop up briefly
executing scripts that change the text files would be better

clip is now posted above also

Last edited by mrpeachy (2010-09-06 19:46:22)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,224

Re: My Conky Config

mrpeachy wrote:

@ wlourf
well the method i thought up is embarassingly untechnical smile

I have my lua script watching text files like this:

read1 = io.open("/tmp/test.txt", "r")
input1 = read1:read("*lines")

then my commands from the menu simply edits the text files smile

touch /tmp/test.txt; echo "1" > /tmp/test.txt

then if's in the lua script to change the display

currently I am just executing terminal commands from the menu, which causes the terminal to pop up briefly
executing scripts that change the text files would be better

clip is now posted above also

ah that's nice for displaying only a part of a Lua script (I save it !)

It's a long time i haven't read this thread, you made some nice stuffs recently !

I've seen your idea for a bliking cursor,
here is mine attempt, I've posted it on french forums some months ago but I think you don't read it !

It's nice but quite boring after a while :
conkyrc with an updtae of 0.25s

# -- Conky settings -- #
background no
update_interval 0.25

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_title console box

border_inner_margin 0
border_outer_margin 0

minimum_size 500 300

alignment bl
gap_x 0
gap_y 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 1

uppercase no
default_color 000000

# -- Lua Load -- #
#set FULL path of the script
lua_load  ~/conky/console/console.lua
lua_draw_hook_pre console_box

TEXT

Lua script, setup file to read at line 18 :

--[[Console Box by wlourf v.1.0 27/05/2010

needs conky 1.7.2 ou + 

In the conky, before TEXT section:
lua_load ~/scripts/console.lua
lua_draw_hook_pre console_box

]]

require 'cairo'



function conky_console_box()

    settings={
        txt_file="/home/ll/conky/console/mytext.txt", --mandatory
        font_name="Courier New",--optional, default="Courier New"
        font_size=10,            --optional, default=12
        font_color=0x000000,    --optional, default=0x00FF00 (green)
        font_alpha=1,         --optional, default=0.5
        show_cursor=true,       --optional, default=true
        blink_cursor=true,      --optional, default=false
    }

--END OF PARAMETRES ------------------


    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)
    
    start_console_like(settings)
        
    cairo_destroy(cr)
    cairo_surface_destroy(cs)

end

function start_console_like(t)

    --controle le fichier en entrée
    if txt==nil then
        if t.txt_file ==nil then print "invalid input file"; return end
        local file = io.open(t.txt_file,"r")    
        txt_init = file:read("*a")
        txt=txt_init
        io.close()
    end    

    --defaults    
    if t.font_name==nil then t.font_name="Courier New" end
    if t.font_size==nil then t.font_size=12 end
    if t.font_color==nil then t.font_color=0x00FF00 end
    if t.font_alpha==nil then t.font_alpha=0.5 end
    if t.show_cursor==nil then t.show_cursor=true end
    if t.blink_cursor==nil then t.blink_cursor=false end
    
    --init globals variables
    if y_offset==nil then y_offset=1 end    --nb of lines
    if txt_array==nil then txt_array={} end --text lines in tables
    if f_letter==nil then f_letter=1 end    --first letter
    if txt_offset==nil then txt_offset=0 end --offset for new lines    
    if count==nil then count=0 end            --count resets
    
    --cairo initialisation
    cairo_select_font_face(cr, t.font_name, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    cairo_set_font_size(cr,t.font_size)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(t.font_color,t.font_alpha))
    local fe=cairo_font_extents_t:create()
    cairo_font_extents (cr,fe)

    --compute txt to display    
    local u=tonumber((conky_parse("$updates")))-txt_offset
    if u>#txt then 
        f_letter=1;count=count+1
        txt_offset=count*(u-1);
        u=1;
        y_offset=1; txt_array={}; txt=txt_init 
    end
    
    --compute txt position
    local te=cairo_text_extents_t:create()
    cairo_text_extents (cr,txt:sub(f_letter,u),te)
    if (te.width>conky_window.width and flag_new_line) or txt:sub(u,u)=="\n"  then
        y_offset=y_offset+1
        flag_new_line=false
        f_letter=u
        if txt:sub(u,u)=="\n" then txt=txt:gsub("\n", "",1) end
    else
        txt_array[y_offset]=txt:sub(f_letter,u)
        flag_new_line=true
    end

    --display text
    for i=1,y_offset do
        cairo_move_to(cr,1,fe.ascent*i)
        cairo_show_text(cr,txt_array[i])    
    end
    
    --show cursor
    if t.show_cursor then
        blink=not blink
        if not t.blink_cursor then blink=true end
        if blink then 
            line=txt_array[y_offset]
            if line~=nil then
                space=""
                if (line:sub(#line,#line)) == " " then space="." end
                cairo_text_extents (cr,line:gsub(" ","."),te)
                cairo_rectangle(cr,    1+te.width,fe.ascent*(y_offset-1),10,fe.ascent+fe.descent)
                cairo_fill(cr)
            end
        end
    end
end

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

http://uppix.net/1/b/8/f91a82c4de16520ad44a674861dd6.png

I carry on my readings smile

1,225

Re: My Conky Config

wlourf wrote:

ah that's nice for displaying only a part of a Lua script (I save it !)

It's a long time i haven't read this thread, you made some nice stuffs recently !

I've seen your idea for a bliking cursor,
here is mine attempt, I've posted it on french forums some months ago but I think you don't read it !

can't say i browse many French language forums! smile

and thank you very much wlourf

i wish i knew more of the ins and outs of codewriting though... im getting stuck with lua not doing what i want it to.

if you fancy a lua challenge, how about writing some code to wrap text in lua...

ive seen some examples elsewhere but cant get them to work for me.

i have a vague idea how to go about it... but i dont want to get bogged down working on it

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.