SEARCH

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

You are not logged in.

#426 2012-09-24 01:42:36

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ If you are using rhythmbox, you would not use .conkympdrc, that is for mpd use only.

You need to use this

conky -c .conkyrhythmboxrc

As long as you have downloaded the musictools.tar.gz and extracted it, everything should work.

Good luck..!


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

Be excellent to each other!

#427 2012-09-24 02:23:17

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Thanx, got it to pop up and started rhythmbox and everything just says Unknown and 0.00.000 etc...


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#428 2012-09-24 02:25:10

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ Did you setup the template also?

Run

conky -c .conkyrhythmboxrc 

from terminal and post the output please...


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#429 2012-09-24 03:10:28

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

VastOne wrote:

^ Did you setup the template also?

Run

conky -c .conkyrhythmboxrc 

from terminal and post the output please...

No, I didn't see how to setup the template, I'll take a look at it. Is it like editing the regular config files?

ian@Hell:~$ conky -c musictools/.conkyrhythmboxrc
Conky: desktop window (1e00095) is subwindow of root window (b1)
Conky: window type - desktop
Conky: drawing to created window (0x4c00002)
Conky: drawing to double buffer
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'.....

...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#430 2012-09-24 03:15:45

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ In the .conkyrhythmboxrc  you are running, this line is what controls everything

${execp ~/conkyRhythmbox.py --template=~/conkyRhythmbox.template}

The conkyRhythmbox.template file is already created for you.  You can see it is looking for it in your /home/your username/  directory.

Please verify that it is there...

Also, did you make sure that mpris is enabled in Rhythmbox?


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#431 2012-09-24 04:00:47

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

VastOne wrote:

^ In the .conkyrhythmboxrc  you are running, this line is what controls everything

${execp ~/conkyRhythmbox.py --template=~/conkyRhythmbox.template}

The conkyRhythmbox.template file is already created for you.  You can see it is looking for it in your /home/your username/  directory.

Please verify that it is there...

Also, did you make sure that mpris is enabled in Rhythmbox?

Yeah the files are there. I just checked Rhythmbox plugins and MPRIS DBUS is checked.


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#432 2012-10-05 08:56:03

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

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Hey VastOne I hear your the man for this music conky stuff.  I'm getting the same results as Lateralus138.  All instructions followed to the 'T' so to speak.  It is showing the image of the file in the images directory however all else is unknown and 0.00 etc...

I am using the .conkyryhtmboxrc to start it up.

Thanks,
Jed
conkyryhthmboxrcoutput.jpg

termoutput.jpg


Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread

Offline

#433 2012-10-05 23:14:57

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Jed and Lateralus138:

I must apologize, I have been busy the last few days and have not had a chance to look into this.  I will get on it tonight and tomorrow and get this resolved.


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#434 2012-10-06 00:27:34

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

WOW ... 71 new packages and 27.1MB for Rhythmbox!!!  Man what a load.. I hope this app makes music for me rather than play it!!!


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#435 2012-10-06 00:47:19

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

The conky/python I use within this How To is the very same one that kaivalagi designed and some of you have already tested coming from the Ubuntu Thread here http://ubuntuforums.org/showpost.php?p= … count=555.

I see no way with Rhythmbox3 and specifically org.gnome.Rhythmbox3 for these scripts to function anymore.  There is no way to pull metadata. My apologies for the failure, it is one that I cannot resolve due to the constant change on mpris data coming from the rhythmbox plugin.

I will edit the How To to reflect that only RhythmBox 2.9 and less will work with this How To

I would recommend any of the other 17 apps in this How To, and give the loudest shout to GMusicBrowser


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#436 2012-10-06 01:05:06

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

VastOne wrote:

The conky/python I use within this How To is the very same one that kaivalagi designed and some of you have already tested coming from the Ubuntu Thread here http://ubuntuforums.org/showpost.php?p= … count=555.

I see no way with Rhythmbox3 and specifically org.gnome.Rhythmbox3 for these scripts to function anymore.  There is no way to pull metadata. My apologies for the failure, it is one that I cannot resolve due to the constant change on mpris data coming from the rhythmbox plugin.

I will edit the How To to reflect that only RhythmBox 2.9 and less will work with this How To

I would recommend any of the other 17 apps in this How To, and give the loudest shout to GMusicBrowser

Ok thanx for getting back to me, I just have Rhythmbox set up how I want it and didn't want to mess with others, but no bigs deal I'll check some others out. Thanx again.


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#437 2012-10-06 01:12:10

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ I could work with rhythmbox-client and bork one together to get it to work.  Give me this weekend to try it.  I appreciate you understanding the issues.


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#438 2012-12-10 07:44:17

Naik
#! CrunchBanger
From: Leipzig, Germany
Registered: 2012-11-16
Posts: 192

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Hey VastOne!

Thanks for all the work you put into this, but i have some truble getting it to work too..
I allready fixed the symlink thing but now all i can get is "unknown" information in any of the fields added to my conky

i dont think this is because i added it into my already exsisting conky, is it?
I already got the same trouble with another python script from relax

the output is always

kai@crunchbang:~$ 
Conky: desktop window (ad) is root window
Conky: window type - normal
Conky: drawing to created window (0x2000001)
Conky: drawing to double buffer
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown
Conky: unknown variable unknown

and the conkyvlc.py gives

kai@crunchbang:~$ python ~/conkyVlc.py --datatype=TI
Unknown

could this be a dbus related problem? I read something about dbus-vlc-config... but all i did was to set up dbus as control-interface in vlc. was that not right or not enough?

edit: setting up imagemagick and using the original conkyvlcrc did not fix it.. right now i am getting

kai@crunchbang:~$ conky -c ~/.conkyvlcrc
Conky: desktop window (ad) is root window
Conky: window type - desktop
Conky: drawing to created window (0x2600002)
Conky: drawing to double buffer
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'
Conky: Unable to load image '-p'

edit: got the same "unknown" output with conkyExail...
i really start thinking there is something wrong with dbus, because since i set it as controlinterface im am no longer able to write the letter "s" while vlc is running for it only stops the playback mad

greetz, naik

Last edited by Naik (2012-12-11 21:12:48)


if{ $doingitright=true}:
$sucess != 0;

Offline

#439 2012-12-24 20:50:05

thekeeperza
New Member
Registered: 2012-05-25
Posts: 5

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Hi all,

Been playing around getting these awesome scripts working....thanks VastOne!!
I have a problem using the sphere layout. The ring is showing a quarter...image---> KAhdus.png
I am still trying to get the hand of lua so I kind of lost here...hopefully someone will be able to shed some light on this for me.

rings.lua

--[[ RINGS with SECTORS widget
	v1.1 by wlourf (07 Jan. 2011)
	this widget draws a ring with differents effects 
	http://u-scripts.blogspot.com/2010/08/rings-sectors-widgets.html
	
To call the script in a conky, use, before TEXT
	lua_load /path/to/the/script/rings.lua
	lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT


Parameters are :
3 parameters are mandatory
name		- the name of the conky variable to display,
			  for example for {$cpu cpu0}, just write name="cpu"
arg			- the argument of the above variable,
			  for example for {$cpu cpu0}, just write arg="cpu0"
		  	  arg can be a numerical value if name=""
max			- the maximum value the above variable can reach,
			  for example for {$cpu cpu0}, just write max=100
	
Optional parameters:
xc,yc		- coordinates of the center of the ring,
			  default = middle of the conky window
radius		- external radius of the ring, in pixels,
			  default = quarter of the width of the conky window
thickness	- thickness of the ring, in pixels, default = 10 pixels
start_angle	- starting angle of the ring, in degrees, value can be negative,
			  default = 0 degree
end_angle	- ending angle of the ring, in degrees,
			  value must be greater than start_angle, default = 360 degrees
sectors		- number of sectors in the ring, default = 10
gap_sectors - gap between two sectors, in pixels, default = 1 pixel
cap			- the way to close a sector, available values are
				"p" for parallel , default value 
				"r" for radial (follow the radius)
inverse_arc	- if set to true, arc will be anticlockwise, default=false
border_size	- size of the border, in pixels, default = 0 pixel i.e. no border
fill_sector	- if set to true, each sector will be completely filled,
			  default=false, this parameter is inoperate if sectors=1
background	- if set to false, background will not be drawn, default=true
foreground	- if set to false, foreground will not be drawn, default=true

Colours tables below are defined into braces :
{position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
example for a single colour table : 
{{0,0xFFAA00,1}} position parameter doesn't matter
example for a two-colours table : 
{{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
example for a three-colours table : 
{{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}

bg_colour1	- colour table for background,
			  default = {{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
fg_colour1	- colour table for foreground,
			  default = {{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
bd_colour1	- colour table for border,
			  default = {{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}			  

Seconds tables for radials gradients :
bg_colour2	- second colour table for background, default = no second colour
fg_colour2	- second colour table for foreground, default = no second colour
bd_colour2	- second colour table for border, default = no second colour

draw_me     - if set to false, text is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the text is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",

v1.0 (08 Aug. 2010) original release
v1.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"
                    text is parsed inside the function, not in the array of settings

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--     
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--     
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.		

]]


require 'cairo'

function conky_main_rings()
-- START PARAMETERS HERE
	local rings_settings={
	{
	name="",
	arg=conky_parse(cmd_pp),
	max=100,
	xc=200,
	yc=200,
	radius=69,
	thickness=20,
	sectors=100,
	inverse_arc=rb_inverse,
	fill_sector=true,
	bg_colour1={{0,bg_col1,0.25},{0.5,bg_col1,1}, {1,bg_col1,0}},
	fg_colour1={{0,fg_col1,0.25},{0.5,fg_col1,1}, {1,fg_col1,0}},
	fg_colour2={{0,fg_col2,0.25},{0.5,fg_col2,1}, {1,fg_col2,0}},
	},	

		
}
--END OF PARAMETERS HERE

--main function

	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)

	if tonumber(conky_parse('${updates}'))>3 then
		for i in pairs(rings_settings) do
			draw_ring(cr,rings_settings[i])
		end
	end

	cairo_destroy(cr)

end




function draw_ring(cr, t)

	local function rgba_to_r_g_b_a(tcolour)
		local colour,alpha=tcolour[2],tcolour[3]
		return ((colour / 0x10000) % 0x100) / 255., 
			((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end
			
			
	local function calc_delta(tcol1,tcol2)
		--calculate deltas P R G B A to table_colour 1

		for x = 1, #tcol1 do
			tcol1[x].dA	= 0
			tcol1[x].dP = 0
	 		tcol1[x].dR = 0
			tcol1[x].dG = 0
			tcol1[x].dB = 0
			if tcol2~=nil and #tcol1 == #tcol2 then
				local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
				local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
				tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
		 		tcol1[x].dR = (r2-r1)/t.sectors
				tcol1[x].dG = (g2-g1)/t.sectors
				tcol1[x].dB = (b2-b1)/t.sectors
				tcol1[x].dA = (a2-a1)/t.sectors		
				
			end
		end
		
		return tcol1
	end

	--check values
	local function setup(t)
		if t.name==nil and t.arg==nil then 
			print ("No input values ... use parameters 'name'" +
				" with 'arg' or only parameter 'arg' ") 
			return
		end

		if t.max==nil then
			print ("No maximum value defined, use 'max'")
			print ("for name=" .. t.name)
			print ("with arg=" .. t.arg)
			return
		end
		if t.name==nil then t.name="" end
		if t.arg==nil then t.arg="" end

		if t.xc==nil then t.xc=conky_window.width/2 end
		if t.yc==nil then t.yc=conky_window.height/2 end
		if t.thickness ==nil then t.thickness = 10 end
		if t.radius ==nil then t.radius =conky_window.width/4 end
		if t.start_angle==nil then t.start_angle =0 end
		if t.end_angle==nil then t.end_angle=360 end
		if t.bg_colour1==nil then 
			t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
		end
		if t.fg_colour1==nil then
			t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
		end
		if t.bd_colour1==nil then
			t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
		end
		if t.sectors==nil then t.sectors=10 end
		if t.gap_sectors==nil then t.gap_sectors=1 end 
		if t.fill_sector==nil then t.fill_sector=false end
		if t.sectors==1 then t.fill_sector=false end
		if t.border_size==nil then t.border_size=0 end
		if t.cap==nil then t.cap="p" end
		--some checks
		if t.thickness>t.radius then t.thickness=t.radius*0.1 end
		t.int_radius = t.radius-t.thickness

		--check colors tables 
		for i=1, #t.bg_colour1 do 
			if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
		end
		for i=1, #t.fg_colour1 do 
			if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
		end
		for i=1, #t.bd_colour1 do 
			if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
		end
	
		if t.bg_colour2~=nil then
			for i=1, #t.bg_colour2 do 
				if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
			end
		end
		if t.fg_colour2~=nil then
			for i=1, #t.fg_colour2 do 
				if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
			end
		end
		if t.bd_colour2~=nil then
			for i=1, #t.bd_colour2 do 
				if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
			end
		end 	
		
		if t.start_angle>=t.end_angle then
		 local tmp_angle=t.end_angle
		 t.end_angle= t.start_angle
		 t.start_angle = tmp_angle
		 -- print ("inversed angles")
			if t.end_angle-t.start_angle>360 and t.start_angle>0 then
				t.end_angle=360+t.start_angle
				print ("reduce angles")
			end
		
			if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
				t.end_angle=360+t.start_angle
				print ("reduce angles")
			end
		
			if t.int_radius<0 then t.int_radius =0 end
			if t.int_radius>t.radius then
				local tmp_radius=t.radius
				t.radius=t.int_radius
				t.int_radius=tmp_radius
				print ("inversed radius")
			end
			if t.int_radius==t.radius then
				t.int_radius=0
				print ("int radius set to 0")
			end 
		end
		
		t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
		t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
		t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
	end
	
	if t.draw_me == true then t.draw_me = nil end
	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end	
	--initialize table
	setup(t)
	
	--initialize cairo context
	cairo_save(cr)
	cairo_translate(cr,t.xc,t.yc)
	cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)

	--get value
	local value = 0
	if t.name ~="" then
		value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
	else
		value = tonumber(t.arg)
	end
	if value==nil then value =0 end

	--initialize sectors
	--angle of a sector :
	local angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
	--value of a sector : 
	local valueA = t.max/t.sectors
	--first angle of a sector : 
	local lastAngle = t.start_angle*math.pi/180


	local function draw_sector(type_arc,angle0,angle,valpc, idx)
	 
		--this function draws a portion of arc
	 	--type of arc, angle0 = strating angle, angle= angle of sector,
	 	--valpc = percentage inside the sector, idx = sctor number #
	 	local tcolor
		 if type_arc=="bg" then 		--background
			 if valpc==1 then return end
		 	tcolor=t.bg_colour1
		 elseif type_arc=="fg" then	--foreground
		 	if valpc==0 then return end
		 	tcolor=t.fg_colour1
		 elseif type_arc=="bd" then	--border
		 	tcolor=t.bd_colour1
		 end 

		--angles equivalents to gap_sector
		local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
		local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))

		--angles of arcs
		local ext_angle=(angle-ext_delta*2)*valpc
		local int_angle=(angle-int_delta*2)*valpc

		--define colours to use for this sector
		if #tcolor==1 then 
			--plain color
			local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
			cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
									vG+tcolor[1].dG*idx,
									vB+tcolor[1].dB*idx,
									vA+tcolor[1].dA*idx	)
		else
			--radient color
			local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
			for i=1, #tcolor do
				local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
				cairo_pattern_add_color_stop_rgba (pat, 
									vP+tcolor[i].dP*idx,
									vR+tcolor[i].dR*idx,
									vG+tcolor[i].dG*idx,
									vB+tcolor[i].dB*idx,
									vA+tcolor[i].dA*idx	)
			end
			cairo_set_source (cr, pat)
			cairo_pattern_destroy(pat)
		end

		--start drawing
		 cairo_save(cr)
		--x axis is parrallel to start of sector
		cairo_rotate(cr,angle0-math.pi/2)

		local ri,re = t.int_radius ,t.radius

		--point A 
		local angle_a
	
		if t.cap == "p" then 
			angle_a = int_delta
			if t.inverse_arc and type_arc ~="bg" then
				angle_a = angle-int_angle-int_delta
			end
			if not(t.inverse_arc) and type_arc =="bg" then
				angle_a = int_delta+int_angle
			end
		else --t.cap=="r"
			angle_a = ext_delta
			if t.inverse_arc and type_arc~="bg" then
				angle_a = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_a = ext_delta+ext_angle
			end
		end
		local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)


		--point B
		local angle_b = ext_delta
		if t.cap == "p" then 
			if t.inverse_arc and type_arc ~="bg" then
				angle_b = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_b = ext_delta+ext_angle
			end
		else
			if t.inverse_arc and type_arc ~="bg" then
				angle_b = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_b = ext_delta+ext_angle
			end
		end
		local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)

		-- EXTERNAL ARC B --> C
		local b0,b1
		if t.inverse_arc then
			if type_arc=="bg" then
				b0,b1= ext_delta, angle-ext_delta-ext_angle
			else
				b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
			end
		else
			if type_arc=="bg" then
				b0,b1= ext_delta+ext_angle, angle-ext_delta
			else
				b0,b1= ext_delta, ext_angle+ext_delta
			end
		end
		
		---POINT D
		local angle_c, angle_d
		if t.cap == "p" then 
			angle_d = angle-int_delta
			if t.inverse_arc and type_arc=="bg" then
				angle_d = angle-int_delta-int_angle	
			end
			if not(t.inverse_arc) and type_arc~="bg" then
				angle_d=int_delta+int_angle
			end
		else
			angle_d = angle-ext_delta
			if t.inverse_arc and type_arc=="bg" then
				angle_d =angle-ext_delta-ext_angle
			end
			if not(t.inverse_arc) and type_arc~="bg" then
				angle_d = ext_angle+ext_delta
			end
		end
		local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
		
		-- INTERNAL ARC D --> A
		local d0,d1
		if t.cap=="p" then	
			if t.inverse_arc then	
				if type_arc=="bg" then
					d0,d1= angle-int_delta-int_angle,int_delta
				else
					d0,d1= angle-int_delta, angle- int_angle-int_delta
				end
			else
				if type_arc=="bg" then
					d0,d1= angle-int_delta, int_delta+int_angle
				else
					d0,d1= int_delta+int_angle, int_delta
				end
			end
		else
			if t.inverse_arc then	
				if type_arc=="bg" then	
					d0,d1= angle-ext_delta-ext_angle,ext_delta
				else
					d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
				end
			else
				if type_arc=="bg" then	
					d0,d1= angle-ext_delta,ext_delta+ext_angle
				else	
					d0,d1= ext_angle+ext_delta, ext_delta
				end
			end			
		end
			
		--draw sector
		cairo_move_to(cr,ax,ay)
		cairo_line_to(cr,bx,by)
		cairo_arc(cr,0,0,re,b0,b1)
		cairo_line_to(cr,dx,dy) 
		cairo_arc_negative(cr,0,0,ri,d0,d1)
		 cairo_close_path (cr);

		--stroke or fill sector
		 if type_arc=="bd" then
		 	cairo_set_line_width(cr,t.border_size)
		 	cairo_stroke(cr)
		 else
			 cairo_fill(cr)
		 end

		 cairo_restore(cr)

	 end
	--draw sectors
	local n0,n1,n2 = 1,t.sectors,1
	if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
	local index = 0
	for i = n0,n1,n2 do 
		index = index +1
		local valueZ=1
		local cstA, cstB = (i-1),i
		if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
		
		if value>valueA *cstA and value<valueA*cstB then
			if not t.fill_sector then
				valueZ = (value-valueA*cstA)/valueA
			end
		else
			if value<valueA*cstB then valueZ=0 end
		end
		
		local start_angle= lastAngle+(i-1)*angleA
		if t.foreground ~= false then 
			draw_sector("fg",start_angle,angleA,valueZ, index)
		end
		if t.background ~= false then 
			draw_sector("bg",start_angle,angleA,valueZ, i)
		end
		if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
	end

	cairo_restore(cr)
end


--[[END OF RING-SECTORS WIDGET]]

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

Offline

#440 2012-12-24 21:09:10

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 124
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ Just plugged your script into my setup and the entire ring shows up just fine.  Perhaps you could post your conkyrc.

Last edited by DrakarNoir (2012-12-24 21:12:53)


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#441 2012-12-25 04:01:39

thekeeperza
New Member
Registered: 2012-05-25
Posts: 5

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@DrakarNoir....here it is.

.conkysphererc

# -- 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 

# -- Window specifications -- #

draw_borders no
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi

border_inner_margin 0
border_outer_margin 0

minimum_size 400 400
 
alignment mm
gap_x 5
gap_y 60

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=8
xftalpha 0.8
 
uppercase no  

default_color FFFFFF

# -- Lua load -- #
lua_load ~/conky/conky-music/player.lua
lua_draw_hook_pre main

#at least one line (empty or not) after TEXT
#
TEXT

#this line for displaying cover - This is a must have line
#set-up in getcover_sphere.sh
${if_running banshee}
${execi 3 ~/conky/conky-music/cover/getcover_sphere.sh}${image ~/conky/conky-music/cover/cover_sphere.png -p 150,150}
${endif}

#this line for xnoise only - If you use xnoise, uncomment the next line
#${execi 1 ~/bin/getcdxnoise.sh}

#this line for exaile only - If you use exaile, uncomment the next line
#${execi 1 ~/bin/getcdexaile.sh}

#this line for gogglesmm only - If you use gogglesmm, uncomment the next line
#${execi 1 ~/bin/getcdgmm.sh}

#this line for audacious only - If you use audacious, uncomment the next line
#${execi 1 ~/bin/getcdaud.sh}

#this line for mocp/moc only - If you use mocp/moc, uncomment the next line
#${execi 1 ~/bin/getcdmocp.sh}

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

Offline

#442 2012-12-26 04:04:57

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 124
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ Plugged everything in here and no problem with the ring. The only differences here are that I do not use Banshee (I use Clementine or gmusicbrowser) and I also do not use the text lua.

scrot:

adwe4xXr.jpg

Last edited by DrakarNoir (2012-12-26 04:09:23)


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#443 2012-12-26 18:54:10

thekeeperza
New Member
Registered: 2012-05-25
Posts: 5

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ I have tried with Deadbeef, MPD and Gmusicbrowser as I thought it might be player related but still the same. I tried playing with the ring settings but broke the lua script properly  yikes.
Thanks for taking a look DrakarNoir.


Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein

Offline

#444 2013-05-06 21:17:29

dgz
#! CrunchBanger
Registered: 2011-11-22
Posts: 150

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

using the python method i can't get quodlibet artwork to display.


ooh baby i like it raw

Offline

#445 2013-05-06 21:19:32

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,727
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ What is the error message you see when you run it from Terminal?


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#446 2013-05-06 21:45:50

dgz
#! CrunchBanger
Registered: 2011-11-22
Posts: 150

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

dgz@PANGAEA:~$ conky -c ~/.conkyqlrc
Conky: desktop window (ab) is root window
Conky: window type - desktop
Conky: drawing to created window (0x3200002)
Conky: drawing to double buffer
Conky: Unable to load image '/tmp/current.cover'

not sure if i'm missing something.


ooh baby i like it raw

Offline

#447 2013-05-06 21:47:28

dgz
#! CrunchBanger
Registered: 2011-11-22
Posts: 150

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

.conkyQuodlibet.template

${color2}[--datatype=TI --maxlength=50]
${color2}[--datatype=AR --maxlength=50]
${color2}[--datatype=AL --maxlength=50]
${#777777}[--datatype=PT]|${#777777}[--datatype=LE]
${image /tmp/current.cover -p 0,140 -s 335x335}

edit- also when i put an image in there it shows up as partially transparent, which is just odd looking.

Last edited by dgz (2013-05-06 21:59:16)


ooh baby i like it raw

Offline

#448 2013-05-09 18:37:09

dgz
#! CrunchBanger
Registered: 2011-11-22
Posts: 150

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

anyone?


ooh baby i like it raw

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.

Debian Logo