I noticed a serious problem with the lua implementation in conky 1.8.1 (from the server-monitoring repo) compared to conky 1.8.0 (from the contrib repo). This doesn’t just affect openSUSE but conky 1.8.1 in general (same problem with this conky version under ArchLinux). Version 1.8.0 which I’m using under Ubuntu and under openSUSE again after downgrading works fine. Unfortunately I’m not sure that I will be able to downgrade conky everywhere. The picture left shows version 1.8.0 ; the picture right version 1.8.1 (same garbage under ArchLinux)
http://img811.imageshack.us/img811/8126/conky18012.png … http://img98.imageshack.us/img98/1341/conky18111.png
I could get the same result (as left) without using many of the lua functions I wrote to:
- determine the number of CPUs
- check the mounted filesystems
- determine the name of the hardware sensors for CPU and mainboard temperature - however that wouldn’t be possible without lua unless you rewrite the conky configuration after each reboot because these names - like many things in modern Linuxes - are random >:(
- determine the name of the default network interface (now p1p1 instead of eth0 under Fedora)
- color CPU and filesystem usage using gradient and highlight top processes in a gradient of red (very useful)
Just a few examples to show how lua could make conky configuration much easier. In fact the .conkyrc file used in the example above could be used on other machines with totally different hardware without the need of changing anything.
The lua script is fine. if there were syntax errors, I would get plenty of warnings while starting conky on the command line. Even the crazy pipe* I opened in lua to find out the name of the sensors seems to work, as you can see the CPU and mainboard temperatures (right).
l = io.popen(“find -L /sys/class/hwmon/hwmon* -maxdepth 1 -regextype posix-awk -regex ‘.temp[0-9](label|crit|input)’ -exec echo -n ‘{}=’ ‘;’ -exec cat ‘{}’ ‘;’ | sed 's|/sys/class/hwmon/hwmon||;s|/temp||;s| ||g;s|| |;s|=|=|;s|$||’ | sort | awk ‘{ if ( P == $1 ) { print “#”, $NF } else print ; P=$1 }’ | sed -e :a -e ‘$!N;s/\
#/ /;ta’ -e ‘P;D’ | awk ‘{ if ( $4 ~ /label/ ) print $4, $1, $2, $3 ; else print “label=MB Temperature”, $1, $2, $3}’ | sed ‘s|label=||’ | awk ‘{ if ( $3 ~ /crit/ ) print $1, $2, $3 ; else print $1, $2, $3, “crit=10000” }’ | sed 's|| |; s|crit=||;s|\(.\) \(.\) \([0-9]\)\([0-9]\) \([0-9][0-9]\)|\1 = “${color0}\1 \2: ${color8}${if_match ${hwmon \3 temp \4}>=\5}${color red}${endif}${alignr}${hwmon \3 temp \4}C”|’”):lines()
I was planning to update conkyconf with the new version of the lua script (which is much better than the current one). But obviously I cannot do it now.