SEARCH

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

You are not logged in.

#3426 2012-10-21 23:18:49

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

Re: Conky v1.9 Thread

McLovin wrote:

@Sector11
I'm gonna have to try that out, I still have a config, and my keys never stopped working, (even though weather.com supposedly ended support), but if there is no keys or anything needed anymore, then that's gonna make life so much easier.

Good - please try it, I'd love to have more confirmation.


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

Offline

Help fund CrunchBang, donate to the project!

#3427 2012-10-21 23:23:37

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

Re: Conky v1.9 Thread

lwfitz wrote:

Under a load
tZnl4Ng


No load
tZnl4Nwl]

More changes to come Im sure.........

Now that looks really good!  What did you do to put your computer under so much load?  I can't for the life of me get my 3 cpus to come anywhere near 'pink' let alone red.


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

Offline

#3428 2012-10-21 23:28:52

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

Re: Conky v1.9 Thread

mrpeachy wrote:

^if you look at the chronograph lua you will have the centers of all the dials set as variables\
then drawing circles in lua is easy
set up a the color then

cairo_arc(cr,middle_x,middle_y,radius,0,2*math.pi)
cairo_fill(cr)

but it is important to draw the circle BEFORE you draw the hands, dots and titles, otherwise it will cover them up

Saw this this morning just before going out for the day. Got a full schedule coming up but have this in a --[[ block ]] in the script to look at as soon as I get a moment.

Thank you.


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

Offline

#3429 2012-10-21 23:39:03

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

Re: Conky v1.9 Thread

Sector11 wrote:
lwfitz wrote:

Under a load
tZnl4Ng


No load
tZnl4Nwl]

More changes to come Im sure.........

Now that looks really good!  What did you do to put your computer under so much load?  I can't for the life of me get my 3 cpus to come anywhere near 'pink' let alone red.


Thanks a lot! I benchmarked the cpu and then quickly took a screenshot cool When I used to use wine I could get the cpu to get up there but that was with a core 2 quad.

Offline

#3430 2012-10-22 02:50:02

McLovin
#! CrunchBanger
From: my computer chair
Registered: 2009-02-28
Posts: 105
Website

Re: Conky v1.9 Thread

Sector11 wrote:
McLovin wrote:

@Sector11
I'm gonna have to try that out, I still have a config, and my keys never stopped working, (even though weather.com supposedly ended support), but if there is no keys or anything needed anymore, then that's gonna make life so much easier.

Good - please try it, I'd love to have more confirmation.

Yup, I can confirm that this is working, I have it set up slightly differently, I set the cache to /tmp/ rather than in my home folder, as for some reason, with it set to use my home folder, it wouldn't work, but once I did that, it works perfectly, and it seems to parse the weather a bit quicker as well, which is nice.

Also, Sector11, I was curious, is there a submit section on the CPS for users to submit set-ups to be shown? I just think that CPS is a good place to chare conky configs to world

Last edited by McLovin (2012-10-22 02:50:42)


8o Got /? | The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.

Offline

#3431 2012-10-22 02:53:26

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

@Sector11 ... I have never set it up at all before, so I may be a good litmus test too..

Send me where I need to be to set it up and I will give it a whirl.. Is it part of Teo's, his accuweather script?

Also, I am all for seeing McLovin showcased on C.P.S.! cool


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#3432 2012-10-22 07:10:28

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Sector11 wrote:

Now that looks really good!  What did you do to put your computer under so much load?  I can't for the life of me get my 3 cpus to come anywhere near 'pink' let alone red.

CPU Burn or Phoronix Test Suite


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#3433 2012-10-22 07:32:55

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

Re: Conky v1.9 Thread

dk75 wrote:
Sector11 wrote:

Now that looks really good!  What did you do to put your computer under so much load?  I can't for the life of me get my 3 cpus to come anywhere near 'pink' let alone red.

CPU Burn or Phoronix Test Suite


Yep I used CPU Burn

Offline

#3434 2012-10-22 10:08:54

huffpuff
Member
Registered: 2011-02-12
Posts: 17

Re: Conky v1.9 Thread

Hi Folks

I'm posting this here because it's not really a crunchbang issue but it might be a conky issue and crunchbangers are pretty good with conky issues [in my experience!]

I have conky running on several crunchbang installs including waldorf but recently in having a look at the new Ubuntu offering [12.10] I tried porting my conky stuff to the lovely unity [not serious]. All was fine except for the appearance of a rectangle between my temp readout and the degree symbol. I have tried everything to get rid of this but failed.

It is not a utf8 locale thing because that is configured as on the debian and from my researches there is a suggestion it is the conky rendering of a possible newline character from my script output.

I am using simple bash scripts with curl, grep, and sed deployed to pull out specific data from rss feeds.

Why this rectangle should appear on ubuntu qq and not crunchbang has got me baffled. I have tried stripping out the newlines in the bash script using sed [assuming this is the problem] but to no avail. I have tried changing execi to texeci etc. But to no avail. Font changes ditto. Grrrr.

The annoying thing is I am not intending to stick with the ubuntu - I just hate not getting to the bottom of something.

Can anyone help put me out of my misery?

Offline

#3435 2012-10-22 12:20:25

joek
#! Junkie
Registered: 2011-09-06
Posts: 497

Re: Conky v1.9 Thread

It might be useful if you paste your conkyrc file here...

Quickly checking the Ubuntu bug reports, I can't see any for conky which look useful...

Offline

#3436 2012-10-22 12:55:14

huffpuff
Member
Registered: 2011-02-12
Posts: 17

Re: Conky v1.9 Thread

Oh right well here it is:

# Conky settings #
background no
update_interval 1

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

#temperature_unit fahrenheit

# Window specifications #

own_window yes
own_window_type normal
own_window_argb_visual yes
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 10
border_outer_margin 0

minimum_size 210 260
maximum_width 210

alignment tr
gap_x 35
gap_y 275

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

# Text settings #
use_xft yes
xftfont caviar dreams:size=9
xftalpha 1

uppercase no

#temperature_unit celsius


default_color FFFFFF

# Lua Load  #
lua_load ~/.conky/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT
${voffset 8}${color FF6600}${font caviar dreams:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font caviar dreams:size=38}${time %e}${font}
${color FFFFFF}${voffset -30}${color FFFFFF}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font caviar dreams:size=20}${time %Y}${font}${color FF6600}${hr}
${voffset 140}${font caviar dreams:size=10}${alignr}HOME${font}
${font Arial:size=12}${color FFFFFF}${alignr}${execi 60 conkytmp}°C${font}
${image ~/.conky/new-ubuntu-logo.png -p 54,125 -s 70x20}

${color FFFFFF}${goto 20}${voffset 30}${cpu cpu0}%
${color FF6600}${goto 20}CPU
${color FFFFFF}${goto 45}${voffset 20}${memperc}%
${color FF6600}${goto 45}RAM
${color FFFFFF}${goto 70}${voffset 20}${fs_used_perc /}%
${color FF6600}${goto 70}Disk
${color FFFFFF}${goto 95}${voffset 20}${downspeed eth0}
${color FFFFFF}${goto 95}${upspeed eth0}
${color FF6600}${goto 95}Net



${color FFFFFF}${font caviar dreams:size=8}Uptime: ${uptime_short}
${color FFFFFF}${font caviar dreams:size=8}Processes: ${processes}
${color FFFFFF}${font caviar dreams:size=8}Running: ${running_processes}


${color FF6600}${font caviar dreams:size=8}${alignr}${nodename}
${color FF6600}${font caviar dreams:size=8}${alignr}${pre_exec cat /etc/issue.net}  $machine
${color FF6600}${font caviar dreams:size=8}${alignr}Kernel: ${kernel}

And also the bash script:

# This script depends on curl.

#RSS Setup
URI=http://rss.wunderground.com/auto/rss_full/global/stations/03865.xml?units=metric #URI of RSS Feed


#Environment Setup
EXEC="/usr/bin/curl -s" #Path to curl

#Work Start
$EXEC $URI | grep Temperature: |\
sed -e 's/°C//g' |\
sed -e 's/<description>//g' |\
sed -e 's/<!\[CDATA\[Temperature\://g' |\
sed -e 's/| Humidity\:.*>//g' |\
sed 's/^[ \t]*//;s/[ \t]*$//' |\
sed 's/ //g'

I 'spose it's not the end of the world [yet]. I have also opened the bash script in geany to remove spaces and make sure it is unix not windows encoding, etc. But that darned rectangle persists.....

Offline

#3437 2012-10-22 13:02:03

huffpuff
Member
Registered: 2011-02-12
Posts: 17

Re: Conky v1.9 Thread

Oh and the conky looks like this:

http://i.imgur.com/angPT.jpg

You may just spot the annoying rectangle. I changed the font to arial so it looks less ghastly.

Offline

#3438 2012-10-22 13:17:22

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

New Conky setup thanks to a post from bent-stick here in the screenshot thread

screenshot-10222012-081130am.php

Link to conky here


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#3439 2012-10-22 18:08:42

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

Re: Conky v1.9 Thread

VastOne wrote:

New Conky setup thanks to a post from bent-stick here in the screenshot thread

screenshot-10222012-081130am.php

Link to conky here

Looks awesome!


@mrpeachy

I have another question about the allcombined.lua

Im attempting to call the lua gradbar for my drive temp using

${lua gradbar {10,150,"${hddtemp /dev/sda}",150,48,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}

and it seems to work but then flashes and in the terminal I get this error

Conky: llua_do_call: function conky_gradbar execution failed: /home/luke/conky/allcombined.lua:43: attempt to perform arithmetic on local 'number' (a string value)

Offline

#3440 2012-10-22 19:04:05

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

Re: Conky v1.9 Thread

lwfitz wrote:

@mrpeachy

I have another question about the allcombined.lua

Im attempting to call the lua gradbar for my drive temp using

${lua gradbar {10,150,"${hddtemp /dev/sda}",150,48,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}

and it seems to work but then flashes and in the terminal I get this error

Conky: llua_do_call: function conky_gradbar execution failed: /home/luke/conky/allcombined.lua:43: attempt to perform arithmetic on local 'number' (a string value)

that sounds like you need a tonumber in there
i think the script your using has these lines in the gradbar function

local number=bartab[3]
local number=conky_parse(number)

change to

local number=bartab[3]
local number=tonumber(conky_parse(number))

im surprised that i hadn't put that in there when i wrote it hmm

Last edited by mrpeachy (2012-10-22 19:08:09)

Offline

#3441 2012-10-22 19:11:05

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

Re: Conky v1.9 Thread

mrpeachy wrote:
lwfitz wrote:

@mrpeachy

I have another question about the allcombined.lua

Im attempting to call the lua gradbar for my drive temp using

${lua gradbar {10,150,"${hddtemp /dev/sda}",150,48,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}

and it seems to work but then flashes and in the terminal I get this error

Conky: llua_do_call: function conky_gradbar execution failed: /home/luke/conky/allcombined.lua:43: attempt to perform arithmetic on local 'number' (a string value)

that sounds like you need a tonumber in there
i think the script your using has these lines in the gradbar function

local number=bartab[3]
local number=conky_parse(number)

change to

local number=bartab[3]
local number=tonumber(conky_parse(number))

im surprised that i hadn't put that in there when i wrote it hmm


No luck. I get this

Conky: llua_do_call: function conky_gradbar execution failed: /home/luke/conky/allcombined.lua:23: attempt to call global 'tonumber_parse' (a nil value)Conky: 

Im using just the stock allcombined.lua that you created, not the one edited for my gpu

--[[ 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=tonumber_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

btw after I made that change my cpu temp gradbar wouldnt load either

Last edited by lwfitz (2012-10-22 19:12:02)

Offline

#3442 2012-10-22 20:49:02

huffpuff
Member
Registered: 2011-02-12
Posts: 17

Re: Conky v1.9 Thread

Bit voodooey but problem solved now. cheers.

Offline

#3443 2012-10-22 21:32:56

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

Re: Conky v1.9 Thread

@lwfitz - you didnt get it quite right

i see this

local number=tonumber_parse(number)

but should be this

local number=tonumber(conky_parse(number))

Offline

#3444 2012-10-22 23:00:28

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

Re: Conky v1.9 Thread

mrpeachy wrote:

@lwfitz - you didnt get it quite right

i see this

local number=tonumber_parse(number)

but should be this

local number=tonumber(conky_parse(number))

Hmmmmm so I did...... sorry about that. Ill test when I get home and then Im sure Ill have more questions about something else big_smile

Offline

#3445 2012-10-22 23:58:44

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

Re: Conky v1.9 Thread

Just got home...

RE: ConkyForecast

McLovin wrote:

Yup, I can confirm that this is working, I have it set up slightly differently, I set the cache to /tmp/ rather than in my home folder, as for some reason, with it set to use my home folder, it wouldn't work, but once I did that, it works perfectly, and it seems to parse the weather a bit quicker as well, which is nice.

That sounds like a positive.  I'll have to check that out as well.

McLovin wrote:

Also, Sector11, I was curious, is there a submit section on the CPS for users to submit set-ups to be shown? I just think that CPS is a good place to chare conky configs to world

Cpnky PitStop is a closed wiki, for the same reason you see this: Conky Wiki. The Conky Wiki was open and anyone could contribute at one time and thousands did. Unfortunately they were spammers.

But I see no problem putting your conky on CPS.  big_smile


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

Offline

#3446 2012-10-23 00:45:53

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

Re: Conky v1.9 Thread

I no longer get the error but my conky the lua gradbar and the hddtemp output are flashing. The come into the conky fine and then the gradbar disappears and the hddtemp output gives me an N/A then they come back and do it all over again.

The isometric bars being called into that conky are fine and the draw_bg being called from the same all combined is fine;

Heres the conky and the allcombined

conkyrc

  use_xft yes
  update_interval 1
  total_run_times 0
  cpu_avg_samples 4
  no_buffers no
  double_buffer yes
  override_utf8_locale yes

  alignment middle_right
  gap_x 10
  gap_y 65
  minimum_size 500 250
  maximum_width 250

  own_window yes
  own_window_type desktop
  own_window_transparent yes
  own_window_hints undecorated,below,skip_taskbar,skip_pager
  draw_borders no

  xftfont Ubuntu:bold:size=10
  draw_shades yes
  draw_outline yes
  default_shade_color white
  default_outline_color black
  uppercase no
  
  draw_graph_borders yes
  draw_shades no

draw_outline no # amplifies text if yes
default_outline_color black

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

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

text_buffer_size 1024
temperature_unit fahrenheit

###  LUA Settings  #############################################################
lua_load ~/conky/bars.lua
lua_draw_hook_pre draw_shape

lua_load /home/luke/conky/allcombined.lua

short_units yes
## 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
TEXT
#${lua tex_bg {50,0,0,280,440,"/home/luke/images/wallpapers/black_4.png"}}
${lua draw_bg {20,0,0,0,0,0x000000,0.5}}
 ${font StarJedi:bold:size=20}Drives
 
 ${voffset -5}${font StarJediHollow:bold:size=17}${goto 170}${hddtemp /dev/sda}${voffset -4}${font}°${voffset -7}${font StarJediHollow:bold:size=17}F ${lua gradbar {10,150,"${hddtemp /dev/sda}",150,48,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}

allcombined.lua

--[[ 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
conky_start=1
function conky_gpu()
    if conky_window == nil then return end
    local updates=tonumber(conky_parse('${updates}'))
    if updates<=5 then return "" end --as this function may use conky_parse("${cpu}")
    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)
    --#########################################################################################################
    --setup timer
    local interval=10
    local timer=(updates % interval)
    if timer==0 or conky_start==1 then
        local file = io.popen("aticonfig --adapter=0 --od-gettemperature | grep 'Temperature' | cut --characters 36-38")
        gpuc = tonumber(file:read("*a"))
        file:close()
        conky_start=nil
    end--of timer
    --convert C to F
    --°C  x  9/5 + 32 = °F
    local gpuf=(gpuc*(9/5))+32
    --call bar function
    conky_gradbar ({5,52,gpuf,190,80,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1})
    --#########################################################################################################
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    --return gpuf to conky
    return gpuf
end-- end main function ###################################################################################

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
--#########################################################################################################
if bartab[1]==nil then

--convert to table
bartab=loadstring("return" .. bartab)()
end
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=tonumber(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

Offline

#3447 2012-10-23 00:49:22

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

Re: Conky v1.9 Thread

VastOne wrote:

@Sector11 ... I have never set it up at all before, so I may be a good litmus test too..

Send me where I need to be to set it up and I will give it a whirl.. Is it part of Teo's, his accuweather script?

Also, I am all for seeing McLovin showcased on C.P.S.! cool

It has nothing to do with Teo's scripts, it's kaivalagi's python script. Most people have moved on to other scripts now, but conkyForecast was used world wide and has language files to translate weather.com outputs into 14 other languages, Chinese being one of them, English being the default is the 15th language.  For some of us longtime conky users, having conkyForecast working again would be like a car lover owning a mint condition '56 Chevy or you owning a '54 Fender Stratocaster. cool

Send me where I need to be: That would be ConkyForecast - Method 2 is fine - grab the .deb for "Hardy" - trust me, they all the same. Check out the "Expanded Usage Details" in the first post.  Or just use this link to grab the DEB for conkyforecast_2.24_all.deb (3.2 MiB), this version also has the conkyForecastWU version as well.

Grab the ~/.conkyForecast.config file without ID & KEY in my earlier post and the conky and template as well if you wish for testing purposes.

Last edited by Sector11 (2012-10-23 00:50:19)


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

Offline

#3448 2012-10-23 01:06:03

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

Re: Conky v1.9 Thread

lwfitz wrote:

I no longer get the error but my conky the lua gradbar and the hddtemp output are flashing. The come into the conky fine and then the gradbar disappears and the hddtemp output gives me an N/A then they come back and do it all over again.

The isometric bars being called into that conky are fine and the draw_bg being called from the same all combined is fine;

Heres the conky and the allcombined

local number=tonumber(conky_parse(number))

if the output from ${hddtemp /dev/sda} is sometimes n/a then that would cause the script problems
try this

local number=tonumber(conky_parse(number)) or 0

since using tonumber on a string would return a nil value, instead of passing the nil value on it passes on 0 instead

Last edited by mrpeachy (2012-10-23 01:08:03)

Offline

#3449 2012-10-23 01:08:57

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

@ Sector11... I have it now and will set it up... Thank you.

Interesting and quite accurate conky insight here on our General Chat thread


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

Help fund CrunchBang, donate to the project!

#3450 2012-10-23 01:18:42

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

Re: Conky v1.9 Thread

mrpeachy wrote:

if the output from ${hddtemp /dev/sda} is sometimes n/a then that would cause the script problems
try this

local number=tonumber(conky_parse(number)) or 0

since using tonumber on a string would return a nil value, instead of passing the nil value on it passes on 0 instead

Unfortunately no change. This is what its doing
tZnprMg

tZnprMw

Offline

Board footer

Powered by FluxBB

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

Debian Logo