SEARCH

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

You are not logged in.

#7201 2014-03-22 17:00:45

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

Re: Conky v1.9 Thread

Joe90 wrote:

It would be in a particular conky as per my last screenshot, the rounded corners are simply echoing the rounded corners for the lua background. Still trying to decide if this is too old school now and if i should go for a Windows8 mad tiled look & feel?

W8 - Noooooooooooooooooooooooooooooooo!!!!
OK, that's an opinion!

And ask all the questions you want - we all benefit from the responses at some point in time.

As for 'pay grade' I meant:
a. none of your business, or
b. sorry, for "X" reason, I can discuss it.   cool

Last edited by Sector11 (2014-03-22 19:41:30)


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

Offline

Be excellent to each other!

#7202 2014-03-22 17:36:22

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

Re: Conky v1.9 Thread

iMBeCil wrote:

Sector invited me to show the calendar conky I use on my desktop. So, here it is:

Calendars, clocks and weather are something that has always interested me with conky

I was wondering how your 8 months updated ... very nicely I see ...

After asking I started working on one that's a bit ( roll ) more complicated but with this method would require 12 months ...  not finished yet, just have to April but basically a few tweaks to the bottom month add it to the list and move on to the next ...

I'll have to see if I can 'merge' some aspects of both into one.

Thank you kindly iMBeCil
2014_03_22_14_32_26_1920x1080_Sector11.jpg


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

Offline

#7203 2014-03-22 18:20:30

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

Ah Mr Peachy, found this over on conky pitstop, should do fine, need to figure out the rounded corners bit to keep sector 11's blood pressure down wink Not random, but guess I could figure that out too.

img_conky.jpg

Last edited by Joe90 (2014-03-22 18:21:28)

Offline

#7204 2014-03-22 18:40:59

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

Re: Conky v1.9 Thread

here is a script that does what i think you want smile
Screenshot_from_2014_03_22_13_33_26.jpg

i have my 3 text files with actress names and my 3 pictures
i have it setup so that the images need to be the same size as the conky window
i was writing the text output switcher before Sector11's execi solution smile

there is a setup part in the script at the top
textandimage.lua

require 'cairo'
run=1
count=1
function conky_main()
if conky_window == nil then return end
local updates=tonumber(conky_parse("${updates}"))
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)
--#########################################################################################################
--settings #####################################################
local folder="/home/mcdowall/Desktop/testfolder/"
local files={--enter text filenames in quotes, with comma following
"text1.txt",
"text2.txt",
"text3.txt",
}--closes table
local interval=10--conky updates before switching
--set positions
--x,y coordinates of bottom left of first word of text
local x1=30
local y1=50
--set gap in pixels between lines
local gap=15
--set wrap length
local wrap=50--set 0 for no wrap
--set text
local font="Sans"--name of font in brackets
local font_size=15
--setup rounded image border
local r=20--corner radius
local border_width=20
local imagepath={--enter image path and filenames in quotes, with comma following
"/home/mcdowall/Desktop/testfolder/pic1.png",
"/home/mcdowall/Desktop/testfolder/pic2.png",
"/home/mcdowall/Desktop/testfolder/pic3.png",
}--closes table
--end of settings
--CODE #######################################################
local updates=tonumber(conky_parse('${updates}'))
local timer=(updates %tonumber(interval))
if timer==0 or run==1 then
	if run==1 then count=1 end
	run=nil
	--textlines={}
	local file=folder..files[count]
	imageshow=imagepath[count]
	local f=io.open(file, "rb")
	local readtext=f:read("*all")
	f:close()
	textlines=readtext:split("\n")
	count=count+1
		if count==#files+1 then--reset count
		count=1
		end
end--timed section
--#########################################################################################################
		if border_width==0 then
		w=tonumber(conky_window.width)
		h=tonumber(conky_window.height)
		x=0
		y=0
		else
		w=tonumber(conky_window.width)-(border_width*2)
		h=tonumber(conky_window.height)-(border_width*2)
		x=border_width
		y=border_width
		end
	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))
	-----------------------------
	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); --/* path not consumed by clip()*/
	image = cairo_image_surface_create_from_png (imageshow);
	iw = cairo_image_surface_get_width (image);
	ih = cairo_image_surface_get_height (image);
	cairo_scale (cr, w/iw, h/ih);
	cairo_set_source_surface (cr, image, x, y);
	cairo_paint (cr);
	cairo_surface_destroy (image);
	ny=0
		for i=1,#textlines do
		y=y1+(gap*(i-1))+ny
		ny=out({x=x1,y=y,txt=textlines[i],wrap_len=wrap,wrap_gap=gap,f=font,fs=font_size})
		end--for loop
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end--end main function
function string:split(delimiter)--#########################################################################
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end--string split
function out(txj)--c,a,f,fs,face,x,y,txt,hj,vj,ro,sxo,syo,sfs,sface,sc,sa #########################################################
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
local function color(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local function justify(jtxt,x,hj,y,vj,f,face,fs)
	if face=="normal" then
	face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL}
	elseif face=="bold" then
	face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD}
	elseif face=="italic" then
	face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_NORMAL}
	elseif face=="bolditalic" then
	face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_BOLD}
	else
	print ('face not set correctly - "normal","bold","italic","bolditalic"')
	end
	cairo_select_font_face (cr,face[1],face[2],face[3])
	cairo_set_font_size(cr,fs)
	cairo_text_extents(cr,jtxt,extents)
	local wx=extents.x_advance
	local wd=extents.width
	local hy=extents.height
	local bx=extents.x_bearing
	local by=extents.y_bearing+hy
	local tx=x
	local ty=y
	--set horizontal alignment - l, c, r
	if hj=="l" then
	x=x-bx
	rad=0
	nx=tx+wx
	elseif hj=="c" then
	x=x-((wx-bx)/2)-bx
	rad=(wx-bx)/2
	nx=tx+(wx/2)
	elseif hj=="r" then
	x=x-wx
	rad=wx-bx
	nx=tx
	else
	print ("hj not set correctly - l, c, r")
	end
	--vj. n=normal, nb=normal-ybearing, m=middle, mb=middle-ybearing, t=top
	if vj=="n" then
	y=y
	rad2=0
	ry=by
	elseif vj=="nb" then
	y=y-by
	rad2=-by
	ry=by
	elseif vj=="m" then
	y=y+((hy-by)/2)
	rad2=((hy-by)/2)
	ry=((hy-by)/2)-by
	elseif vj=="mb" then
	y=y+(hy/2)-by
	rad2=(hy/2)-by
	ry=((hy-by)/2)-by
	elseif vj=="t" then
	y=y+hy-by
	rad2=hy-by
	ry=0+by
	else
	print ("vj not set correctly - n, nb, m, mb, t")
	end
return face,fs,x,y,rad,rad2,tx,ty
end--justify local function #########################################################
--set variables
local c=txj.c 			or default_color		or 0xffffff
local a=txj.a 			or default_alpha		or 1
local f=txj.f 			or default_font			or "mono"
local fs=txj.fs 		or default_font_size		or 12
local x=txj.x 			or 100
local y=txj.y 			or 100
local txt=txj.txt 		or "set txt"
local hj=txj.hj 		or default_hj			or "l"
local vj=txj.vj 		or default_vj			or "n"
local ro=txj.ro			or defaukt_ro			or 0
local face=txj.face		or default_face			or "normal"
local wl=txj.wrap_len		or 0
local wrap_gap=txj.wrap_gap	or 15
--shadow
local shadow=txj.shadow 	or 0
local sxo=txj.sxo 		or default_sxo		or 2
local syo=txj.syo 		or default_syo 		or 2
local sc=txj.sc 		or defualt_sc		or 0x000000
local sa=txj.sa 		or default_sa		or 0.8
local sface=txj.sface		or default_sface	or face
local sfs=txj.sfs		or default_sfs		or fs
--print text ##################################################################
if wl>0 then--do wrap
	local tt={}
	local s=txt:gsub(" $","&|#"):gsub("  ","&|# "):gsub("  ","&|# ")
	for i in string.gmatch(s, "%S+") do --%S+matches words
	table.insert(tt,i)
	end
	local tl=#tt--gets length of table
	local sl=string.len(s)--overall length of text to be wrapped
	lines={}
	if sl<=wl or tl==1 then--if text is shorter or equal to wrap len or only 1 word
	table.insert(lines,s)
	else--text is longer and multiple words
		while sl>wl and tl>1 do
		local lt={}
			if string.len(tt[1])>=wl then
			line=tt[1]
			table.remove(tt,1)
			else
				local ll=0
				while ll+string.len(tt[1])<wl do
				table.insert(lt,tt[1])
				table.remove(tt,1)
				line=table.concat(lt," ")
				ll=string.len(line)
				tl=#tt
				end--while
			end
		table.insert(lines,line)
		lastline=table.concat(tt," ")
		sl=string.len(lastline)
		end--while
	table.insert(lines,lastline)
	end
end--if wrap
--output type
if wl>0 then--wrapped text
	for i=1,#lines do
		local txt=string.gsub(lines[i],"&|#"," ")
		if shadow==1 then
			local face,fs,x,y=justify(txt,x+sxo,hj,y+syo,vj,f,sface,sfs)
			cairo_select_font_face (cr,face[1],face[2],face[3])
			cairo_set_font_size(cr,fs)
			cairo_move_to (cr,x,y+(wrap_gap*(i-1)))
			cairo_set_source_rgba (cr,color(sc,sa))
			cairo_show_text (cr,txt)
			cairo_stroke (cr)
		end--if shadow
		local face,fs,x,y=justify(txt,x,hj,y,vj,f,face,fs)
		cairo_select_font_face (cr,face[1],face[2],face[3])
		cairo_set_font_size(cr,fs)
		cairo_move_to (cr,x,y+(wrap_gap*(i-1)))
		cairo_set_source_rgba (cr,color(c,a))
		cairo_show_text (cr,txt)
		cairo_stroke (cr)
	end--for i=1,#lines
	if #lines>1 then
	return #lines*wrap_gap
	else
	return 0
	end
elseif wl==0 then--regular text
	--draw shadow first
	if shadow==1 then
	local face,fs,x,y=justify(txt,x+sxo,hj,y+syo,vj,f,sface,sfs)
	cairo_select_font_face (cr,face[1],face[2],face[3])
	cairo_set_font_size(cr,fs)
	cairo_move_to (cr,x,y)
	cairo_set_source_rgba (cr,color(sc,sa))
	cairo_show_text (cr,txt)
	cairo_stroke (cr)
	end--if shadow
	local face,fs,x,y=justify(txt,x,hj,y,vj,f,face,fs)
	cairo_select_font_face (cr,face[1],face[2],face[3])
	cairo_set_font_size(cr,fs)
	cairo_move_to (cr,x,y)
	cairo_set_source_rgba (cr,color(c,a))
	cairo_show_text (cr,txt)
	cairo_stroke (cr)
	return nx
end--output type
end--function out

use it in conky like this

##lua settings
lua_load ~/conky/textandimage.lua
lua_draw_hook_pre main

for each conky you would have a separate instance of the script
textandimage1.lua
textandimage2.ua etc
set up for each window

Last edited by mrpeachy (2014-03-22 20:08:23)

Offline

#7205 2014-03-22 19:47:53

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

Re: Conky v1.9 Thread

i really like this rounded corners. does this only work with png-files?

Offline

#7206 2014-03-22 19:54:08

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

Re: Conky v1.9 Thread

lionhead wrote:

i really like this rounded corners. does this only work with png-files?

Yes, that Cairo command requires png, I changed a couple of those images to png from jpg using gimp

Offline

#7207 2014-03-22 19:54:36

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

Re: Conky v1.9 Thread

HA!  You don't know me at all, my BP constantly surprises the doc by bein' within' spittin' distance of 120/80 ... always mumbles under his breath when he takes it  Everything else is is either seized up, falling off, stopped working or hurting but BP is a classic 'perfect'.  lol lol lol

Now that we have that outta the way ... wanna wallpaper?
2014_03_22_16_45_30_1920x1080_Sector11.jpg


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

Offline

#7208 2014-03-22 19:56:42

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

Re: Conky v1.9 Thread

mrpeachy wrote:

here is a script that does what i think you want smile
http://s7.postimg.org/xbqidku1j/Screenshot_from_2014_03_22_13_33_26.jpg

i have my 3 text files with actress names and my 3 pictures
i have it setup so that the images need to be the same size as the conky window
i was writing the text output switcher before Sector11's execi solution smile

Hey mrpeachy!  Can't let you have all the fun  big_smile

I like this little gem too. Consider it grabbed. wink wink


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

Offline

#7209 2014-03-22 20:29:29

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

Re: Conky v1.9 Thread

@ iMBeCil

Borrowed an idea from you ... added it to something from I got from habitual and added it to a twist of my own for the simple calendar.

${goto 20}${color6}SU MO ${color5}${time %b %Y}${color6} FR SA
${goto 20}${color}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}

And there it is in the middle ... last four months, current month and the next four months.
2014_03_22_16_40_40_1920x1080_Sector11.jpg
The conky

update_interval 1
TEXT
${goto 10}SU MO ${execi 86400 date --date="-4 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-4 -B4 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="-3 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-3 -B3 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="-2 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-2 -B2 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="-1 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-1 -B1 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${color5}${alignc}${membar 1,100}${color}
${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${color5}${alignc}${membar 1,100}${color}
${goto 10}SU MO ${execi 86400 date --date="1 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A1 -B-1 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="2 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A2 -B-2 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="3 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A3 -B-3 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}
${alignc}${membar 0,50}
${goto 10}SU MO ${execi 86400 date --date="4 month" | awk '{print $2" "$6}'} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m `date +%m` -A4 -B-4 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}

The finished product - in a window and started with a OB entry:
2014_03_22_17_19_01_1920x1080_Sector11.jpg

The one on the right is a LOT more complicated.  It will always show the current year ... with today highlighted.

update_interval 1
TEXT
${if_match "${time %b}" == "Jan"}${goto 15}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 15}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 15}/g'}${color}${else}${goto 10}SU MO ${color5}Jan ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m1 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Feb"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Feb ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m2 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Mar"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Mar ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m3 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Apr"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Apr ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m4 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "May"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}May ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m5 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Jun"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Jun ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m6 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Jul"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Jul ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m7 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Aug"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Aug ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m8 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Sep"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Sep ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m9 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Oct"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Oct ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m10 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Nov"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Nov ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m11 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}
${if_match "${time %b}" == "Dec"}${goto 10}SU MO ${color5}${time %b %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${else}${goto 10}SU MO ${color5}Dec ${time %Y}${color} FR SA
${goto 10}${color3}${execpi 86400 ncal -bh -m12 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}${color}${endif}
${alignc}${membar 0,50}

Again thanks for the idea and a nice conky.

ncal is a part of cal but acts slightly different.


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

Offline

#7210 2014-03-23 08:32:53

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2012-03-22
Posts: 1,026
Website

Re: Conky v1.9 Thread

^You are welcome Sector.

I'm jealous, now your calendars looks so much nicer than mine smile

BTW, nice touch with '$LAR' variable!


Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--

Offline

#7211 2014-03-23 12:48:51

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

Re: Conky v1.9 Thread

iMBeCil wrote:

^You are welcome Sector.

I'm jealous, now your calendars looks so much nicer than mine smile

BTW, nice touch with '$LAR' variable!

One of the reasons I posted it was 'if' you, or anyone else, wanted it. After all the idea came from you.
Every now and then I need to look at an older or future month, this 9 month conky goes beyond the limits I need and is ideal for that purpose.  Now I don't need to type 'cal 2014' - it's always just a click away. 

The LAR variable is not my idea it dates back at least as far as 2008 by someone with the initials "DJS"

 23 Mar 14 | 09:02:03 ~
    $ ftxt DJS /media/5/conky
/media/5/conky/met/conkyrc
129:${font Liberation Mono:size=8}${execpi 60 DJS=`date +%_d`; cal | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color1}'"$DJS"'${color}'/}

Pulling the top two lines from 'cal' and adding the conky call with the month and year in the centre , that was my idea.

I got the idea of the "month" calls

SU MO ${execi 86400 date --date="-3 month" | awk '{print $2" "$6}'} FR SA

from habitual's using a date --date="X days" in a bash file.

LAR is my wife's initals So I decided to use them with some tweaks I did with the calendar.

One can also highlight a future/past date as well for a fixed month.  Let's try October 5 - Linux's Birthday - another tweak from habitual's original big_smile

${goto 15}${color7}SU MO ${color5}Oct 1991${color7} FR SA
${goto 15}${color7}${execpi 86400 FLAR=`date +5`; ncal -bh -m10 1991 | sed '2d' | sed -e '1d' -e 's/\<'$FLAR'\>/${color5}&${color7}/' | sed ':a;N;$!ba;s/\n/\n${goto 15}/g'}${color}

2014_03_23_09_32_55_273x412_Sector11.jpg
F = For  big_smile

I'm a conky nut, I collect little/big ideas and share the wealth.  big_smile

BTW: ncal is a part of cal so nothing else to install just use it.  It's just that ncal just has more options:

CAL(1)                                       BSD General Commands Manual                                      CAL(1)

NAME
     cal, ncal — displays a calendar and the date of Easter

SYNOPSIS
     cal [-3hjy] [-A number] [-B number] [[month] year]
     cal [-3hj] [-A number] [-B number] -m month [year]
     ncal [-3bhjJpwySM] [-A number] [-B number] [-s country_code] [[month] year]
     ncal [-3bhJeoSM] [-A number] [-B number] [year]
     ncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm]

DESCRIPTION

Last edited by Sector11 (2014-03-23 12:59:57)


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

Offline

#7212 2014-03-23 15:19:06

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

lionhead wrote:

i really like this rounded corners. does this only work with png-files?

Quicker to convert multiple files in same directory with imagemagick:

mogrify -format jpg *.png

run this in the directory with files in!

mogrify examples

Offline

#7213 2014-03-23 15:40:59

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

@ Sector 11

Back at ya, crunchified!

minonsincar.jpg

Offline

#7214 2014-03-23 16:21:00

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

Re: Conky v1.9 Thread

Joe90 wrote:

Quicker to convert multiple files in same directory with imagemagick:

mogrify -format jpg *.png

I knew that!  I forgot I knew it, but I knew it.  big_smile

Darn forgetter really is getting better. One of the disadvantages of getting older.
Or advantage depending on the situation. lol lol lol lol

Joe90 wrote:

@ Sector 11

Back at ya, crunchified!
http://s21.postimg.org/9ghgj5a2r/minonsincar.jpg

Grabbed ... thanks.


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

Offline

#7215 2014-03-23 16:48:51

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

Re: Conky v1.9 Thread

It is a slow Sunday and after doing the multiple month calendar as seen earlier... I got to thinking.

And after a lot of tweaking on the layout and after resizing an image to exact size ... I have it.

Anyway ... once it was all lined up horizontally and running at an average of 1% CPU usage ...
2014_03_23_12_24_22_1920x1080_Sector11.jpg

I had to get rid of the 'oversized' conky window ...
2014_03_23_12_59_24_1920x1080_Sector11.jpg
Which meant tweaking the negative voffsets with positive offsets to counter balance the two and adding a final ${voffset 15} to bring back the bottom of the image once I took the CPU command out.

There it is .. a brand new conky for Desktop 3.  That brings the total to 13 running conkys:
2014_03_23_13_06_33_1920x1080_Sector11.jpg
... it kinda fits that bottom conky.

conky

# conky -c /media/5/conky/7_months_h.conky &
# pkill -xf "conky -c /media/5/conky/7_months_h.conky" &

# OS: ${pre_exec lsb_release -sd}

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
#own_window_hints skip_taskbar,skip_pager
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Seven Months

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### 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 # Options: yes or no

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

minimum_size 1454 0 # w|h
maximum_width 1454

gap_x 0	# l|r
gap_y 3	# u|d

alignment tm
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=12
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1.0

#font monofur:size=9

# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes ##yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

#default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
default_color B0E0E6 #176 224 230 PowderBlue
#default_color D8BFD8 #216 191 216 Thistle
color0 8FBC8F #DarkSeaGreen
color1 C0C0C0 # Silver
#color1 D3D3D3 #LightGrey
#color1 778899 #LightSlateGray
color2 F5F5DC #Beige
color3 87CEFA #LightSkyBlue
#color3 87CEFA #E0FFFF #LightCyan
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
#color7 5F9EA0 #CadetBlue
#color8 FFFFE0 #LightYellow
color8 FFD700 #Gold
#color8 F0E68C #Khaki
color9 FFA07A #LightSalmon
#color9 CD5C5C #IndianRed
#color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 05
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 6144

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable th0e image cache.
imlib_cache_size 0

default_bar_size 590 13

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit
##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.25
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x000000 0.5
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}

update_interval 1
TEXT
${image /media/5/Conky/images/7_months.png}
${goto 30}SU MO ${pre_exec date --date="-3 month" | awk '{print $2" "$6}'} FR SA
${goto 30}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-3 -B3 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 30}/g'}${color}
 ${voffset -112.5}${goto 235}SU MO ${pre_exec date --date="-2 month" | awk '{print $2" "$6}'} FR SA
 ${goto 235}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-2 -B2 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 235}/g'}${color}${voffset 112.5}
  ${voffset -224.5}${goto 443}SU MO ${pre_exec date --date="-1 month" | awk '{print $2" "$6}'} FR SA
  ${goto 443}${color3}${execpi 86400 ncal -bh -m `date +%m` -A-1 -B1 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 443}/g'}${color}${voffset 224.5}
   ${voffset -336.5}${goto 652}SU MO ${color5}${time %b %Y}${color} FR SA
   ${goto 652}${color3}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 652}/g'}${color}${voffset 336.5}
    ${voffset -448.5}${goto 860}SU MO ${pre_exec date --date="1 month" | awk '{print $2" "$6}'} FR SA
    ${goto 860}${color3}${execpi 86400 ncal -bh -m `date +%m` -A1 -B-1 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 860}/g'}${color}${voffset 448.5}
     ${voffset -560.5}${goto 1070}SU MO ${pre_exec date --date="2 month" | awk '{print $2" "$6}'} FR SA
     ${goto 1070}${color3}${execpi 86400 ncal -bh -m `date +%m` -A2 -B-2 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 1070}/g'}${color}${voffset 560.5}
      ${voffset -672.5}${goto 1277}SU MO ${pre_exec date --date="3 month" | awk '{print $2" "$6}'} FR SA
      ${goto 1277}${color3}${execpi 86400 ncal -bh -m `date +%m` -A3 -B-3 | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 1277}/g'}${color}${voffset 15}

7_months.png
7_months.jpg


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

Offline

#7216 2014-03-23 17:57:16

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

I think i have a problem with swapperc or htop display wrong,
3008a52.jpg
I've  not noticed before,  as you see on htop display 2% in use while conky still 0% but I am convinced that there is not true Swap 0%

I simply use

${swapperc}%

this swapperc code used to work time ago on Mint, now always stick to 0% , really strange

What do you recommend guys? It's a conky bug? because i see on htop varies by performance of system.
Thanks in advance,
Nili


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#7217 2014-03-23 18:07:15

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2012-03-22
Posts: 1,026
Website

Re: Conky v1.9 Thread

Nili wrote:

What do you recommend guys? It's a conky bug? because i see on htop varies by performance of system.
Thanks in advance,
Nili

AFAIK, the most accurate swap info should be:

$ free -h

(note the last row).

I must say that sometimes I have had strange results from 'htop' ... on one old machine it says that proc is constantly at 100% (even at idle), while 'top' says normal idle values of up to 10%.


Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--

Offline

#7218 2014-03-23 18:40:21

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

iMBeCil wrote:

AFAIK, the most accurate swap info should be:

$ free -h

(note the last row).

I must say that sometimes I have had strange results from 'htop' ... on one old machine it says that proc is constantly at 100% (even at idle), while 'top' says normal idle values of up to 10%.

Just did free -h

nili@crunchbang:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.7G       262M       101M       214M       839M
-/+ buffers/cache:       696M       1.3G
Swap:         4.0G       2.4M       4.0G
nili@crunchbang:~$

I really do not understand where is percent of Swap, sorry for my ignorance. So it may be a htop bug?
Thanks for your message.

Last edited by Nili (2014-03-23 18:41:21)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#7219 2014-03-23 18:53:35

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2012-03-22
Posts: 1,026
Website

Re: Conky v1.9 Thread

Nili wrote:

Just did free -h

nili@crunchbang:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.7G       262M       101M       214M       839M
-/+ buffers/cache:       696M       1.3G
Swap:         4.0G       2.4M       4.0G
nili@crunchbang:~$

I really do not understand where is percent of Swap, sorry for my ignorance. So it may be a htop bug?
Thanks for your message.

Here is the line with swap info:

nili@crunchbang:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.7G       262M       101M       214M       839M
-/+ buffers/cache:       696M       1.3G
Swap:         4.0G       2.4M       4.0G # <<<<<<<< this is the swap
nili@crunchbang:~$

So, after all, you are using 2.4M swap out of 4.0G. This makes it 0.06%.

If 'htop' says 2%, it seems to be wrong. If conky says 0%, then it is probabaly OK, since it most probably rounds up to integer percent. I have no idea why the difference between 'htop' and 'free -h'. Might bee a bug in htop. OTOH, there might be a perfectly good explanation. Try to goolge somehting like 'htop top difference' ...

Last edited by iMBeCil (2014-03-23 18:55:15)


Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--

Offline

#7220 2014-03-23 18:58:26

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

mrpeachy wrote:

here is a script that does what i think you want smile
http://s7.postimg.org/xbqidku1j/Screenshot_from_2014_03_22_13_33_26.jpg

I'm getting an error running this:

[EDIT] my fault, forgot to change the path to the lua script in the .conkyrc. Also important that the images are the same size as the conky window, in order to get all the rounded corners. But works very nicely! A bit of a workflow to get it all setup, if you have a lot of images you want to show, but I guess once it is done it is done.

Does it refresh the image list once it has started (thinking if I had a file renamer script running elsewhere I could randomise the files) or could replace files if I had a "static" file numbering system? - yes that works!

Also, can it be done without the text files? Or in simplest terms if text files are empty? - just tested, yes!
[/EDIT]

Images at 1024x576 on a 1920x1080 monitor with blank text file

Screenshot_230314_21_22_09.jpg

Last edited by Joe90 (2014-03-23 21:26:00)

Offline

#7221 2014-03-23 19:08:18

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

iMBeCil wrote:

Here is the line with swap info:

nili@crunchbang:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.7G       262M       101M       214M       839M
-/+ buffers/cache:       696M       1.3G
Swap:         4.0G       2.4M       4.0G # <<<<<<<< this is the swap
nili@crunchbang:~$

So, after all, you are using 2.4M swap out of 4.0G. This makes it 0.06%.

If 'htop' says 2%, it seems to be wrong. If conky says 0%, then it is probabaly OK, since it most probably rounds up to integer percent. I have no idea why the difference between 'htop' and 'free -h'. Might bee a bug in htop. OTOH, there might be a perfectly good explanation. Try to goolge somehting like 'htop top difference' ...

Now i get the swap perc% smile total swap i had in mind, anyway thank for pointing out.
I'll explore a little google or forum here and there regarding swap stuff and htop/top.

Thanks for your suggestion and message iMBeCil.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#7222 2014-03-23 19:14:44

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2012-03-22
Posts: 1,026
Website

Re: Conky v1.9 Thread

^You're welcome Nili. Glad I could help.


Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--

Offline

#7223 2014-03-23 23:22:54

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

Re: Conky v1.9 Thread

Joe90 wrote:
mrpeachy wrote:

here is a script that does what i think you want smile
http://s7.postimg.org/xbqidku1j/Screenshot_from_2014_03_22_13_33_26.jpg

I'm getting an error running this:

[EDIT] my fault, forgot to change the path to the lua script in the .conkyrc. Also important that the images are the same size as the conky window, in order to get all the rounded corners. But works very nicely! A bit of a workflow to get it all setup, if you have a lot of images you want to show, but I guess once it is done it is done.

Does it refresh the image list once it has started (thinking if I had a file renamer script running elsewhere I could randomise the files) or could replace files if I had a "static" file numbering system? - yes that works!

Also, can it be done without the text files? Or in simplest terms if text files are empty? - just tested, yes!
[/EDIT]

Images at 1024x576 on a 1920x1080 monitor with blank text file

http://s30.postimg.org/yjlphx1ul/Screenshot_230314_21_22_09.jpg

glad you got it working!
ill have to look over the script again, should be easy enough to make it image switcher only without the need to point to blank text files.... i believe right now you do need blank text files as it is the size of the text file table that sets the switching

Offline

#7224 2014-03-24 00:51:11

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

@ Mr Peachy

I have written a little bash script to randomise filenames (both png and txt), to go with your image display script in lua/conky. I have done it in bash as I cannot even begin to pretend I fully understand what is going on in the lua script !

Assumes:
You have pumped all the files you want into the lua script
All the png and txt files are in the same directory as the bash script
You have created a subfolder called "temp" which is writeable/readable
No other files with the .txt or png extension are in the directory
You are happy for your png & txt files to be sequentially numbered
You will either run this manually, add it to a conky-start script, or create a cronjob to run it periodically
You want randomised files appearing wink

Will handle as many files as you put in, no arguments required

#!/bin/bash

##############################################################
#requires that all png and txt files have a numerical filename
#requires a /temp sub folder
##############################################################

shopt -s extglob

#count number of png files (and of course same number of txt files)
nofiles=$(ls *.png | wc -l)
echo $nofiles

#create txt file containing randomised filenames for png files to use
for i in $(seq -f "%02g" 1 "$nofiles" | shuf)
do
echo $i.png >> png.list
echo $i.txt >> txt.list
done

#renames all png files, using intermediate rename
let count=1
mysub="./temp/"
for newname in $(cat png.list)
do
if [ $count -lt 10 ]; then
mv "0$count.png" "$mysub$newname"
else
mv "$count.png" "$mysub$newname"
fi
let "count++"
done

#renames all txt files, using intermediate rename
let count=1
for newname in $(cat txt.list)
do
if [ $count -lt 10 ]; then
mv "0$count.txt" "$mysub$newname"
else
mv "$count.txt" "$mysub$newname"
fi
let "count++"
done

mv ./temp/* .

rm png.list
rm txt.list

smile

Last edited by Joe90 (2014-03-25 22:22:05)

Offline

Help fund CrunchBang, donate to the project!

#7225 2014-03-24 14:52:17

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

Re: Conky v1.9 Thread

Joe90 wrote:

Images at 1024x576 on a 1920x1080 monitor with blank text file

http://s30.postimg.org/yjlphx1ul/Screenshot_230314_21_22_09.jpg

That's nice!!  ... I need time to play with it...
Well done mrpeachy, Joe


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

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