SEARCH

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

You are not logged in.

#4601 2013-01-15 09:07:40

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

Re: Conky v1.9 Thread

Last edited by lwfitz (2013-01-15 18:31:11)

Offline

Be excellent to each other!

#4602 2013-01-15 10:38:18

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

Re: Conky v1.9 Thread

do u have an idea why the image is created but won't open? it seems that it's broken (image doesn't contain any datas).

function webcam(wb)
-- call of the function
-- webcam({posx=0,posy=0,url='http://www.eso.org/public/webcams/vlt.jpg',hdd='/tmp/vlt.jpg'})
x=(wb.posx or 0)
y=(wb.posy or 0)
w=(wb.w or 200)
h=(wb.h or 200)
s=wb.url
s=string.gsub(s, ".*/(.*)", "%1")
--print("Substring:", s)
file="/tmp/"..s
intervall=(wb.iv or 60)
-- unique nummer: math.randomseed( os.time() )
-- or math.random

local updates = tonumber(conky_parse('${updates}'))
if (math.mod(updates, intervall) == 0) then
os.execute("wget  -q -O "..file..' "'..s..'"')
end --#
-- load image from harddisk
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(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(x, y)
imlib_free_image()
show=nil
end--function webcam ##################################################################

Offline

#4603 2013-01-15 13:13:55

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

Re: Conky v1.9 Thread

I don't have time right now (12h shifts) but you may foolproof it outside of Conky, in pure LUA.
Just comment out everything of Conky origin and Imlib2, add hard-coded, necessary variables into code (url), and execute it in LUA.
Then see if image was pulled out to /tmp from net.

Offline

#4604 2013-01-15 13:33:42

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

@lionhead
How large is the file you get in the /tmp folder?
Have you tried opening the image file with a image viewer to see if it is any good?

You can also try changing all the

imlib_free_image()

in your code to

imlib_free_image_and_decache()

to see if it is caching problem.

Offline

#4605 2013-01-15 14:44:22

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

Re: Conky v1.9 Thread

it's not a caching problem. the error still occurs!

the file within the tmp-folder has zero bytes.

Offline

#4606 2013-01-15 14:48:55

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

^ Try putting a

print("wget  -q -O "..file..' "'..s..'"')

in your code and post what it prints in the terminal to see if your code is constructing the command incorrectly.

Last edited by arclance (2013-01-15 15:20:17)

Offline

#4607 2013-01-15 15:17:07

Mysterymason
New Member
Registered: 2012-11-27
Posts: 6

Re: Conky v1.9 Thread

How do I get conky translucent on startup with compton on 64-bit Waldorf? Any help would be greatly appreciated.

Offline

#4608 2013-01-15 16:13:47

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

Re: Conky v1.9 Thread

this is the output of the command:

wget  -q -O /tmp/tad1.jpg "http://www.meteo.ot-admin.net/webcam/tad1.jpg"

Offline

#4609 2013-01-15 23:00:43

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

^ I don't know what the problem could be then.

Offline

#4610 2013-01-16 00:18:07

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4611 2013-01-16 10:51:19

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

Re: Conky v1.9 Thread

this works:

function webcam(wb)

--[[ 
call of the function

if u use only one webcam then call it like this:
webcam({posx=210,posy=0,w=200,h=200,url='http://www.meteo.ot-admin.net/webcam/tad1.jpg',iv=20})

but if u use more then one webcams then call it like this:
webcam({posx=210,posy=0,w=200,h=200,url='http://www.meteo.ot-admin.net/webcam/tad1.jpg',hdd='tad1.jpg',iv=20})
]]--

x=(wb.posx or 0)
y=(wb.posy or 0)
w=(wb.w or 200)
h=(wb.h or 200)
s=wb.url -- url of the webcam
nw=(wb.hdd or "webcam.jpg")
file='/home/'..username.."/"..nw  -- storage location of the grabbed image
intervall=(wb.iv or 60)
-- grab webcam image and save it to hdd
local updates = tonumber(conky_parse('${updates}'))
if (math.mod(updates, intervall) == 0) then
os.execute("wget  -q -O "..file..' "'..s..'"')
end --#
-- load image from harddisk
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(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_and_decache()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x, y)
imlib_free_image_and_decache()
show=nil
end--function webcam ##################################################################

if u find some code to improve this script then feel free to make a proposal smile

i'm using the home-directory (to save the image) because sometimes the name of the temp-folder isn't the same. but the home-directory has always the same labeling wink

Offline

#4612 2013-01-17 13:30:33

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

Re: Conky v1.9 Thread

Last edited by ragamatrix (2013-01-17 13:31:26)

Offline

#4613 2013-01-17 14:07:33

7vincent7black7
Member
Registered: 2012-05-20
Posts: 16

Re: Conky v1.9 Thread

Last edited by 7vincent7black7 (2013-01-20 00:04:49)

Offline

#4614 2013-01-17 16:45:33

7vincent7black7
Member
Registered: 2012-05-20
Posts: 16

Re: Conky v1.9 Thread

Last edited by 7vincent7black7 (2013-01-20 00:04:33)

Offline

#4615 2013-01-18 02:28:03

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

Re: Conky v1.9 Thread

Offline

#4616 2013-01-18 07:47:11

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

Re: Conky v1.9 Thread

web=http://www.accuweather.com/fr/ch/horgen/316407/current-weather/316407

Last edited by ragamatrix (2013-04-11 08:09:27)

Offline

#4617 2013-01-18 14:27:11

7vincent7black7
Member
Registered: 2012-05-20
Posts: 16

Re: Conky v1.9 Thread

Last edited by 7vincent7black7 (2013-01-20 00:04:14)

Offline

#4618 2013-01-18 19:34:19

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

Re: Conky v1.9 Thread

Offline

#4619 2013-01-19 21:31:04

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

Re: Conky v1.9 Thread

Last edited by jed (2013-01-21 10:41:53)

Offline

#4620 2013-01-19 23:40:35

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4621 2013-01-20 00:03:24

7vincent7black7
Member
Registered: 2012-05-20
Posts: 16

Re: Conky v1.9 Thread

There's no point in me posting for help on my distro issue then. I guess I'll have to figure it out on my own or deal with it. I"m removing my posts.

Last edited by 7vincent7black7 (2013-01-20 00:05:16)

Offline

#4622 2013-01-20 00:20:40

JLloyd13
#! Member
Registered: 2012-08-08
Posts: 83

Re: Conky v1.9 Thread

Offline

#4623 2013-01-20 09:21:45

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

Re: Conky v1.9 Thread

Offline

#4624 2013-01-20 09:36:41

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

Re: Conky v1.9 Thread

Offline

Help fund CrunchBang, donate to the project!

#4625 2013-01-20 15:39:36

Ekaradon
New Member
Registered: 2013-01-14
Posts: 7

Re: Conky v1.9 Thread

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