Easy configuring conky with conkyconf

Hmmm .No, it’s another error. Actually your forecast works OK for me. (?)

what’s the output of this command:

$ conkyweather forecast cabc0054 **60** /home/saultdon /usr/share/conkyweather/images

This is what I get (just changing the home directory):

Tomorrow,Friday,Saturday 
Sunny,Sunny,Sunny
24 C/7 C,22 C/11 C,25 C/9 C

And you should have the file /home/saultdon/weatherdata_cabc0054.xml which gets updated after 60 minutes.

If you look at the function conky_forecast in /etc/conky/conky.lua, here’s the line where the error occurs:

function conky_forecast (location,update,datadir,iconpath, unit)
	local t = ""
	local x = -116
	local w = ""
	local file
	local l = assert(io.popen("conkyweather forecast " .. location .. " " .. update .. " " .. datadir))
	day = {}
 	for s in l:lines() do table.insert(day, s) end
	l:close()
	d = {} ; for i in string.gmatch(day[1],"%a+") do table.insert(d, i) end
	e = {} ; for i in string.gmatch(day[2],"%a+") do table.insert(e, i) end
	**print(day[2])**
	f = {} ; for i in string.gmatch(day[3],"%w /]+") do table.insert(f, i) end
	u = string.format("${voffset 3}${offset 12}${color aaaaaa}%s${goto 135}%s${goto 250}%s", d[1], d[2], d[3])
	fsize = getfsize()
	if fsize > 8 then y = 109 else y = 100 end
	k = y + 35
	for i,icon in ipairs (e) do
		icon = string.lower(icon) .. '.png' ; baseicon = icon
		x = x + 116
		icon = iconpath .. "/" .. icon
		file = io.open(icon)
		if file then file:close() else icon = iconpath .. "/" .. weatherIcon(baseicon) end
		w = w .. string.format("${if_existing %s}${if_running plasma-desktop}${image %s -p %d,%d -s 80x48}${else}${image %s -p %d,%d -s 80x48}${endif}${endif}", icon, icon, x, k, icon, x, y)
 	end
	w = w .. "${voffset 40}"
	g = {}
	for i,temp in ipairs (f) do
		high = temp:gsub("(%d*) .*", "%1")	
		low  = temp:gsub(".*\/(%d*) .*", "%1")	
		if unit:match("F") then
			high = string.format("%s%sF", toFahrenheit(high), BUL)
			low = string.format("%s%sF", toFahrenheit(low), BUL)
		else
			high = string.format("%s%sC", high, BUL)
			low = string.format("%s%sC", low, BUL)
		end
		temp = string.format("%s/%s", high, low)
		table.insert(g, temp)
	end
	z = string.format("${offset 12}${color aaaaaa}%s${goto 130}%s${goto 240}%s", g[1], g[2], g[3])
	t = u .. '

' .. w .. z
	return t 
end

So add

print(day[2])

below this line, run conky from the command line and watch the output. You should see something like that:

Conky: desktop window (2600700) is subwindow of root window (b2)
Conky: window type - normal
Conky: drawing to created window (0x4200001)
Conky: drawing to double buffer
Sunny,Sunny,Sunny
Sunny,Sunny,Sunny
Sunny,Sunny,Sunny
Sunny,Sunny,Sunny
....

I was wondering why I couldn’t see any NVIDIA stuff:

saultdon@d830-opensuse:~> **conky -v
**Conky 1.8.1 compiled Mon Jul 16 19:28:57 UTC 2012 for Linux 2.6.37.6-0.11-xen (x86_64)


Compiled in features:


System config file: /etc/conky/conky.conf
Package library path: /usr/lib64/conky


 X11:
  * Xdamage extension
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual


 Music detection:
  * MPD
  * MOC


 General:
  * math
  * hddtemp
  * portmon
  * Curl
  * RSS
  * wireless
  * eve-online
  * config-output
  * Imlib2
  * apcupsd
  * iostats
  * ncurses
  * Lua


  Lua bindings:
   * Cairo
   * Imlib2
saultdon@d830-opensuse:~> **zypper se -s -i conky**
Loading repository data...
Reading installed packages...


S | Name         | Type    | Version     | Arch   | Repository           
--+--------------+---------+-------------+--------+----------------------
**i | conky        | package | 1.8.1-5.1.2 | x86_64 | openSUSE-12.2-Oss    **
i | conkyconf    | package | 4.0-16.1    | noarch | home:please_try_again
i | conkyweather | package | 1.0-22.1    | noarch | home:please_try_again

Looks like I don’t have the one from your repo because it isn’t in your 12.2 repo yet =) I installed the 1.9 conky package from your 12.1 repo on my 12.2 PC and reran the conkyconf and now I can see the nvidia info.

Now I get this error: **Conky: Unable to load image '/usr/share/conkyweather/images/ **but that folder exists and is full of images.

saultdon@d830-opensuse:~> **conkyweather forecast cabc0054 60 /home/saultdon /usr/share/conkyweather/images**
**Error**: xsltrpoc not found

So it looks like something is missing from my end and zypper can’t find a package called xsltrpoc.
I also can’t see that xml file in my home dir.

I added that line, but because of the error in my last post about the conkyweather **Error **It didn’t have much of a change:

saultdon@d830-opensuse:~> **conky**&[1] 9609
saultdon@d830-opensuse:~> Conky: forked to background, pid is 9612


Conky: desktop window (2200209) is subwindow of root window (257)
Conky: window type - normal
Conky: drawing to created window (0x1800002)
Conky: drawing to double buffer
**Conky: llua_do_call: function conky_forecast execution failed: /etc/conky/conky.lua:594: bad argument #1 to 'gmatch' (string expected, got nil)**
Conky: Unable to load image '/usr/share/conkyweather/images/'

I’m beginning to think that this whole error is because of whatever I am missing in my system when I ran that conkyweather command.

OK. We have the answer. xsltproc is needed to format the xml file with the 2 xslt styles weather.xslt and forecast.xslt (located in /usr/share/conkyweather). It is a dependency of the conkyweather package. Thus the spec file of the rpm contains this:

%if 0%{?suse_version}
Group: 		System/Monitoring
Requires:	**libxslt1**
%endif

It obviously couldn’t install libxslt1 under 12.2, because this package is either not available or has another name. However I wonder why conkyweather built successfully in OBS. … Hmmm… maybe libxslt1 is there but doesn’t include xsltproc anymore. That would be a possible explanation.

You don’t have the xml file because conkyweather looks for xsltproc first and abort the script if it doesn’t find it. Thus it doesn’t download the RSS feed.

# we need xsltproc
which xsltproc &>/dev/null || exec echo "Error: xsltrpoc not found"

We need to know which package contains xsltproc under 12.2, and if it’s not available, I will have to build a package for 12.2 (or use another XSLT processor).

But I should also catch this error in conky.lua. Thus there is also a bug there. Or I could just let conkyconf check if xsltproc is present beore writing these lines in .conkyrc:


${lua_parse weather cabc0054 60 /home/saultdon /usr/share/conkyweather/images C}
${lua_parse forecast cabc0054 60 /home/saultdon /usr/share/conkyweather/images C}

Am 06.09.2012 15:06, schrieb please try again:
> We need to know which package contains xsltproc under 12.2

it is in libxslt-tools in 12.2


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Thanks, Martin.

rebuilding with:

%if 0%{?suse_version}
Group: 		System/Monitoring
%if 0%{?suse_version} >=1220
Requires:	**libxslt-tools**
%else
Requires:	libxslt1
%endif
%endif

@saultdon,
Updating conkyweather should fix the issue by installing libxslt-tools this time. Don’t forget to back up your /etc/conky/conky.lua!

Thank you for your feedback.

Very cool! Thanks for working on this PTA.

It’s working, but it only works if I have the conky from PTA’s 12.1 repo as it isn’t in the 12.2 yet.


saultdon@d830-opensuse:~>** zypper se -is conky**
Loading repository data...
Reading installed packages...


S | Name         | Type    | Version    | Arch   | Repository           
--+--------------+---------+------------+--------+----------------------
i | conky        | package | 1.9.0-34.1 | x86_64 | pta-12.1             
i | conky-devel  | package | 1.9.0-34.1 | x86_64 | pta-12.1             
i | conkyconf    | package | 4.0-16.1   | noarch | home:please_try_again
i | conkyweather | package | 1.0-27.1   | noarch | home:please_try_again

Looks nice on my laptop, except for the black bar near the top of the panel. This black strip covers the “Desktop” button in the top right corner on the KDE desktop. On my desktop PC, the conky panel sits just below this button so it’s not covered. Maybe because of the higher screen resolution on the desktop vs my laptop?

https://lh6.googleusercontent.com/-OlZofYhB3ng/UEjF2c1khXI/AAAAAAAAAhs/DdLXgxHcZQg/s800/conky_awesomeness.png

But overall, it’s running and looks nice.

I didn’t know that. I tryed to enable it but couldn’t compile tolua++ for openSUSE 12.2.
I’m going to open a thread and ask for help. Maybe Malcolm will know.

That ‘black bar’ is probably the vertical offset which is set if plasma-desktop is running.

${if_running plasma-desktop}${voffset 35}${endif}

But it should not be black, it should be transparent. You have a transparency problem. Conky transparency is tricky under KDE. Try to kill and restart conky.

Option -d also had no effect because hddtemp is not running. You should install/enable this service and run conkyconf again (saying that, I noticed that it is missing in my 12.2 repo as well). I guess it is in packman too, but my version for 12.1 includes a systemd service. I’ll try to enable it for 12.2 it and see if it compiles*.

Compare with the image I posted in #14 (“Disk IO”)

  • OK. It’s there.

I just got the same problem (under 12.1/KDE but it shouldn’t matter). I restarted conky with conky.sh and got the transparency right (but I’m permanently switching between different desktops).

Oh, I know why. I ran KDE withouth compositing (desktop effects). In this case, conky.sh will start a simple composite manager (xcompmgr) to enable conky transparency.

Now it is.

Great work, the last package that needs to get into your 12.2 repo is the conky-devel. It’s the last one I have on my system that is from your 12.1 repo.

The conky panel now works like it should with the hdparm service enabled and I can see the HD temperatures.

On my laptop, conky doesn’t start and just reports: segmentation fault.
Conky works fine on my desktop PC.

I ran “conky -DD” but that didn’t give any additional output besides the seg. fault.

Both machines have the same packages from the same repos in regards to conky, conky-devel, conkyweather, conkyconf and the required deps for those. I’m thinking this is machine (laptop) specific but they are both new installs for openSUSE 12.2.

It’s a dependcy bug, but actually no file is missing. The conky-devel package doesn’t include any new file:

#  rpm -ql conky
/etc/conky
/etc/conky/conky.conf
/etc/conky/conky_no_x11.conf
/usr/bin/conky
/usr/lib64/conky
/usr/lib64/conky/libcairo.so
/usr/lib64/conky/libcairo.so.0
/usr/lib64/conky/libcairo.so.0.0.0
/usr/lib64/conky/libimlib2.so
/usr/lib64/conky/libimlib2.so.0
/usr/lib64/conky/libimlib2.so.0.0.0
/usr/share/applications/conky.desktop
/usr/share/doc/packages/conky
/usr/share/doc/packages/conky/AUTHORS
/usr/share/doc/packages/conky/COPYING
/usr/share/doc/packages/conky/ChangeLog
/usr/share/doc/packages/conky/NEWS
/usr/share/doc/packages/conky/README
/usr/share/doc/packages/conky/TODO
/usr/share/man/man1/conky.1.gz
/usr/share/pixmaps/conky.png

# rpm -ql conky-devel
/usr/lib64/conky
/usr/lib64/conky/libcairo.so
/usr/lib64/conky/libimlib2.so

These files are in the two packages. I have to disable conky-devel for all repos. This is not what’s causing the segfault on your laptop.

I would first try to comment out everything in the TEXT section of your ~/.conkyrc and maybe just keep this line which doens’t need lua nor anything else:

${color0}Linux Kernel: ${color8}${kernel} on ${machine}

It it still crashes to a segfault with such a simple .conkyrc, then this version of conky is not going to work on your laptop - I have no explanation. You could just install version 1.8 from the official repo. Everything should work except nvidia info (but do you need it on your laptop?). Otherwise, this version has built-in support for lua, imlib2 and hddtemp. We need that. If it doesn’t crash at this point, you could try to uncomment the lines one by one (be careful not t break ${if…} … ${endif} though) to find out what’s causing the problem. … How about non existing sensor devices?

I got the segfault on a fresh installed 12.2 too. Version 1.9.0 from my repo doesn’t seem to work on 12.2 - but works fine on 11.4 and 12.1. I’m going to disable it from my 12.2 repo until I get time to compile it locally or get a better idea. The version wich works on your PC must be another one? Or is it still the one from my 12.1 repo???

Anyway, just uninstall conky! It will uninstall conkyconf and conkyweather. Then reinstall conkyconf. It should install conky 1.8.1 from openSUSE-12.2-Oss repo. This version has some bugs but nothing that will affect your configuration, except that nvidia support will be missing. Thus don’t use option -N. We’ll get i fixed sooner or later.

The one thing that makes my 12.2 desktop different from my 12.2 laptop is that the desktop was *upgraded *to 12.2 via *zypper dup *and my laptop is a fresh install from the DVD.
The desktop is running conky 1.9 from your 12.2 repo. I never did a ‘dup’ before and wanted to test it out.

There is probably some legacy 12.1 files on my 12.2 desktop that allows conky 1.9 from your 12.2 repo to run without the seg. default error.

I’ve downgraded my laptop to conky 1.8 and it’s running fine without the NVIDIA sensor.

I am having lots of other problems with my desktop (probably b/c of the ‘dup’) so I plan to do a fresh install from the DVD tonight. I’ll test conky 1.9 on that and let you know if it becomes broken like you’ve seen on your 12.2 machines. I’m thinking it will.

Good luck getting conky 1.9 fixed for openSUSE 12.2! I’ll test it out when it’s ready.