SEARCH

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

You are not logged in.

#5326 2013-05-10 12:54:50

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

Be excellent to each other!

#5327 2013-05-10 15:36:15

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Offline

#5328 2013-05-10 18:43:34

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

@easysid

wow, that looks amazing. nice drawing smile

i have a little problem. the function that draws a bar works if i use values that give me percents (for example memperc).  i have a problem if i want to use 'downspeedf' or 'upspeedf'. sometimes the indicator is bigger then the background.

what about setting up a 'max-value'? do u have an idea how i could solve this problem?

you call the function like this:

draw_bar({var="cpu",dev="cpu1", w=100,h=20, x=15,y=400, bgc=0xffff00,indc=0xff0000,lc=0x000000,la=0.3,lw=5, r=10})

the function looks like this:

function draw_bar(db) -- draw simple bar
------------------------------------------------------------------------
var=db.var
dev=db.dev or ""
width,height=db.w,db.h
across,down=db.x,db.y
bgc,inc,lc=db.bgc,db.indc,db.lc
------------------------------------------------------------------------
bga=db.bga or 1
ina=db.inda or 1
la=db.la or 1
------------------------------------------------------------------------
lw=db.lw
rotate=db.r or 0
justify=db.j or "l"
------------------------------------------------------------------------
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>5 then -- starts the display

--indicator calculation
if not dev then dev=''; end

conum=conky_parse("${"..var..' '..dev.."}")
conum=tonumber(conum)

local inum=(((width-lw)/100)*(conum or 0))

-- justify bar ---------------------------------------------------------
if justify=="r" then -- sometimes very useful
across=across-width
elseif justify=="l" then
across=across
end

-- background bar ------------------------------------------------------
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(bgc, bga));
cairo_rectangle (cr, 0, 0, (width-lw), (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--indicator bar --------------------------------------------------------
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(inc,ina));
cairo_rectangle (cr, 0, 0, inum, (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--boundary line --------------------------------------------------------
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_line_width (cr, lw);
cairo_set_source_rgba (cr, col(lc,la));
cairo_rectangle (cr, -lw/2, -lw/2, width, height)
cairo_stroke (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
	end
end

please help me.

Offline

#5329 2013-05-10 19:47:08

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

# -- Lua Load -- #
lua_load ~/.draw_bg.lua
#lua_draw_hook_pre draw_bg

lua_load ~/.bargraph_small.lua
lua_draw_hook_post main_bars

imlib_cache_size 0

color1 0099CC
color2 9933CC
color3 669900
color4 FF8800
color5 CC0000
color6 AAAAAA
color7 484848

TEXT
${lua conky_draw_bg}${execi 300 curl -s "http://weathe... ... ...

Offline

#5330 2013-05-10 22:32:40

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

Re: Conky v1.9 Thread

Last edited by Sector11 (2013-05-10 22:33:10)

Offline

#5331 2013-05-11 01:57:26

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

Re: Conky v1.9 Thread

^ i think sector11 is using a different version of the draw_bg script from packrat
packrat is using the VD version, while sector11 is using the version i modified with help from DK75

might make a difference, but might not smile

Last edited by mrpeachy (2013-05-11 01:58:33)

Offline

#5332 2013-05-11 02:16:44

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

Re: Conky v1.9 Thread

Offline

#5333 2013-05-11 04:38:28

xtn5021
New Member
Registered: 2012-12-13
Posts: 7

Re: Conky v1.9 Thread

Last edited by xtn5021 (2013-05-11 04:39:57)

Offline

#5334 2013-05-11 05:24:33

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

 minimum_size 200 5

Offline

#5335 2013-05-11 06:50:48

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Last edited by easysid (2013-05-11 07:03:14)

Offline

#5336 2013-05-11 07:16:09

xtn5021
New Member
Registered: 2012-12-13
Posts: 7

Re: Conky v1.9 Thread

 minimum_size 200 5

Offline

#5337 2013-05-11 14:53:56

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Offline

#5338 2013-05-11 16:27:50

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

Offline

#5339 2013-05-11 17:35:10

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Offline

#5340 2013-05-11 18:34:29

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

this should work:

${execi 300 vnstat -i wlan0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}

but it doesn't display the current status sad but i can see the amount of downloaded data if i use the vnstat-code for the day resp. the week.

the curious thing is that it worked before sad any idea?

Offline

#5341 2013-05-11 19:19:32

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

Re: Conky v1.9 Thread

Last edited by Sector11 (2013-05-12 01:36:45)

Offline

#5342 2013-05-13 14:14:30

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Offline

#5343 2013-05-13 14:58:03

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Offline

#5344 2013-05-13 15:04:10

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

Re: Conky v1.9 Thread

Offline

#5345 2013-05-13 15:06:46

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

Re: Conky v1.9 Thread

Offline

#5346 2013-05-13 15:33:06

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Last edited by ragamatrix (2013-05-13 15:34:33)

Offline

#5347 2013-05-13 17:55:06

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

Re: Conky v1.9 Thread

Last edited by Sector11 (2013-05-13 18:00:34)

Offline

#5348 2013-05-14 04:58:23

Sir Stooper
New Member
Registered: 2013-05-14
Posts: 2

Re: Conky v1.9 Thread

Simple Conky question here.  I've tried looking around but cannot seem to find an answer to display GPU temps from two GPUs.  I have the display set for the one GPU, but I have recently added a second.  here is the existing code:

${color2}${font led:size=10}GPU ${font}$hr
${color}Temperature ${alignr} ${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C

In nvidia settings, they are listed as GPU 0 and GPU 1.

Thanks for any and all help!

Offline

#5349 2013-05-14 12:24:07

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

Re: Conky v1.9 Thread

${color2}${font led:size=10}GPU ${font}$hr
${color}Temperature ${alignr} ${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C

Offline

Be excellent to each other!

#5350 2013-05-14 15:31:23

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

i can not show the status of vnstat (month). this my code:

function os_capture(cmd, raw) -- parse shell in lua
	local f = assert(io.popen(cmd, 'r'))
	local s = assert(f:read('*a'))
	f:close()
	if raw then return s end
	s = string.gsub(s, '^%s+', '')
	s = string.gsub(s, '%s+$', '')
	s = string.gsub(s, '[\n\r]+', ' ')
	return s
end

function command(value,device,del,se)
	local ms=nil
	
if value=="cpu" then
	cmd=[[cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq]]
	ms=os_capture(cmd, raw) -- excecute function (see above)
elseif value=="today" then
	cmd=[[vnstat -i ]]..device..[[ | grep "today" | awk '{print $2 $3}']]
	todayVnstat=os_capture(cmd, raw)
	ms=conky_parse("${if_up "..device.."}"..parse(todayVnstat,del,se).."${else}n/a${endif}")
elseif value=="week" then
	cmd=[[vnstat -i ]]..device..[[ -w | grep "current week" | awk '{print $3 $4}']]
	weekVnstat=os_capture(cmd, raw)
	ms=conky_parse("${if_up "..device.."}"..parse(weekVnstat,del,se).."${else}n/a${endif}")
elseif value=="month" then
	cmd=[[vnstat -i ]]..device..[[ -m | mawk '$0 ~ "'`date +"%b.+%y"`'" {print $3, $4}']]
	monthVnstat = os_capture(cmd, raw)
	ms=conky_parse("${if_up "..device.."}"..parse(monthVnstat,del,se).."${else}n/a${endif}")
end

return ms
end

i hope that it's 'only' a write error. do u see what's wrong?

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

Debian Logo