Siduction Forum

Siduction Forum => Experimental => Topic started by: dibl on 2015/07/25, 19:29:35

Title: Conky 1.10 -- Lua conversion
Post by: dibl on 2015/07/25, 19:29:35
I saw the note about lua when conky was upgraded a few weeks ago, but my conky continued to run, while spitting errors, so I did not attempt to change it right away.  Today I got around to it.


You need to convert your conky script, typically ~/.conkyrc, to a lua script.  That sounded scary to me, but it should not be.  All you need to know and do is the following:

The config section now needs to begin and end like this:
Code: [Select]
conky.config = {
   alignment = 'top_right',
   background = false,
   border_width = 0,
   cpu_avg_samples = 2,
   --default_color = 'white',
   --default_outline_color = 'black',
   ---default_shade_color = 'black',
.
.
.

   temperature_unit = 'fahrenheit',
   double_buffer = true,
   short_units = true,
   own_window_argb_visual = true,
}
and the text section like this:

Code: [Select]
conky.text = [[
${goto 105}${font UbuntuTitleBold:size=20}${color4}Hibiscus${font}


#Host: $alignr $nodename
#${font Terminus:size=8}
${font Terminus:style=bold:size=14}${time %k:%M:%S}${alignr}${time %a  %d.%b.%Y}${font}


Uptime: $uptime
.
.
.

${font Bitstream Vera Sans Mono:size=8}${color white}${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
]]

Arch wiki (https://bbs.archlinux.org/viewtopic.php?pid=1541991#p1541991) mentions a conversion script, but I had already manually edited mine before I found that, someone else can post about their results with it.

There is at least one obvious bug -- a display of top processes shows the command that runs it, instead of the process name.  Online posting elsewhere indicates there are numerous other bugs.

Hope this helps.   :D
Title: Re: Conky 1.10 -- Lua conversion
Post by: ayla on 2015/07/25, 20:46:40
Reading your post I decided to give the convert script a try. Moving it from  /usr/share/doc/conky-std/convert.lua to /home and made it executeable.

Few different failed attempts to run it made me install lua5.2, which I don't know whether it's neccessary.

Finaly finding the right syntax to start the script let it run smooth, and restarting conky after renaming old and new .conkyrc shows all in the display as I had it before the conversion.

"top" is displayed as before, too, as far as I see.

command to start the script:
 
Code: [Select]
lua ./convert.lua .conkyrc conkyrc

My new .conkyrc: http://paste.siduction.org/20150725183040 (http://paste.siduction.org/20150725183040)

Nice and easy way to do the conversion with the script.

Good howto for lua in conky:
HOW TO : using lua scripts in conky (Page 1) / Tips, Tricks & Scripts / CrunchBang Linux Forums (http://crunchbang.org/forums/viewtopic.php?id=17246)

greets
ayla


 
Title: Re: Conky 1.10 -- Lua conversion
Post by: dibl on 2015/07/25, 21:37:13
Heh ...
Code: [Select]
root@Hibiscus:/# apt-cache policy lua5.2 
lua5.2:
  Installed: (none)
  Candidate: 5.2.3-1.1
  Version table:
     5.2.3-1.1 0
        500 http://http.debian.net/debian/ unstable/main amd64 Packages
My conkyrc: http://paste.siduction.org/20150725193625 (http://paste.siduction.org/20150725193625)
Title: Re: Conky 1.10 -- Lua conversion
Post by: paxmark2 on 2015/07/26, 04:12:14
Yea, the old #! (CrunchBang) lua conky thread is very good. 

I was joking around in #! offtopic about 1.10 and I got hijacked. 

http://crunchbang.org/forums/viewtopic.php?id=39997       ## all things conky 1.10

The S(ignal)/N(oise) here though is a bit higher.