SEARCH

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

You are not logged in.

#1 2010-09-07 09:19:47

Pieter
#! Member
From: Netherlands
Registered: 2010-08-10
Posts: 70
Website

Conky animation with images (without lua or other third party script)

gifsicle --unoptimize --explode /home/pieter/temp/compdead.gif --output /home/pieter/temp/temp.gif

Using CrunchBang 10 “Statler” Alpha 2

Offline

Help fund CrunchBang, donate to the project!

#2 2010-09-07 12:43:34

achristoffersen
#! Junkie
Registered: 2009-03-23
Posts: 354

Re: Conky animation with images (without lua or other third party script)

I think: KOOL

thanks for sharing

Offline

#3 2014-03-17 17:55:50

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

Yes I know... now we are in 2014 ... but I only discovered your post today and I want to say that it works perfectly ! ! ! !
Very nice conky !
Thank you very much,

Offline

#4 2014-03-17 19:23:35

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

Re: Conky animation with images (without lua or other third party script)

4 years between posts, impressive   devil
however, lua is pretty easy to pick up and well integrated with conky, the same thing could be done far more simply and efficiently with a short lua script.

Offline

#5 2014-03-20 19:27:15

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

Offline

#6 2014-03-20 22:09:15

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

Re: Conky animation with images (without lua or other third party script)

updates=tonumber(conky_parse('${updates}'))--this gets the conky update number
number_of_images=100--how manny images you are showing
count=(updates %number_of_images)--counts up to from 0 to number_of_images and repeats
path="/home/username/gif_images/" --path to the folder where the images are
show_image=path..count..".png" --assuming that the images are png's

Last edited by mrpeachy (2014-03-20 22:44:39)

Offline

#7 2014-03-20 23:12:07

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

Re: Conky animation with images (without lua or other third party script)

--gifsicle --unoptimize --explode /home/pieter/temp/compdead.gif --output /home/pieter/temp/temp.gif
require 'cairo'
require 'imlib2'
function conky_gif(nim,path,x,y,w,h)
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)
updates=tonumber(conky_parse('${updates}'))
count=(updates %nim)+1
if string.len(count)==1 then 
count=("00"..count)
elseif string.len(count)==2 then 
count=("0"..count)
end
show_image=path..count
image({x=x,y=y,w=w,h=h,file=show_image,decache=1})
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function image(im)--#######################################################################################
local x=(im.x or 0)
local y=(im.y or 0)
local w=(im.w or 50)
local h=(im.h or 50)
local file=tostring(im.file)
local decache=im.decache or 0
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)
	if decache==1 then
	imlib_free_image_and_decache()
	else
	imlib_free_image()
	end
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x,y)
imlib_free_image()
end--function image

Last edited by mrpeachy (2014-03-20 23:18:06)

Offline

#8 2014-03-21 16:31:31

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

MrPeachy,

Thank you so much for your quick reply ! I am very grateful for your help. I will try this week-end what you have sent me and will keep you informed.

Thank you again, I very appreciate your kindness!   smile

Offline

#9 2014-03-23 20:17:15

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

Offline

#10 2014-03-23 23:19:16

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

Re: Conky animation with images (without lua or other third party script)

Thanks for letting me know jlfh0816
i hope you get it up and running smile

Offline

#11 2014-04-17 18:26:15

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

Hello MrPeachy,
Everything is working fine now. Thank you again, I would have never been able to make it work without your and Didier-T's help  big_smile

Offline

#12 2014-04-17 18:37:57

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

Re: Conky animation with images (without lua or other third party script)

Offline

#13 2014-04-17 20:37:53

jlfh0816
New Member
Registered: 2014-03-17
Posts: 6

Re: Conky animation with images (without lua or other third party script)

conky -c /home/jlfh0816/essai/.conkyrc

Last edited by jlfh0816 (2014-04-17 21:09:06)

Offline

#14 2015-06-18 01:12:38

OhF!sh!
Member
Registered: 2014-09-26
Posts: 18

Re: Conky animation with images (without lua or other third party script)

The LUA scripts are cool but... Apparently you can't put the gif above another image. sad

I mean, if you put ${image 1}${image 2} the image 2 will be displayed above the image 1, but with ${image 1}${lua gif} or ${lua gif}${image 1} the gif will be always under the image 1. O_o


I definitely need to learn Lua. cry

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