Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Conky 1.10 -- Lua conversion  (Read 16396 times)

Online dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
[EN] Conky 1.10 -- Lua conversion
« 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 options are lookup values and you need to assign the values (i.e. use "=")
  • each line in the config section ends with "," (a comma)
  • replace "yes" and "no" with "true" and "false", resp. (without quotes)
  • all values except numbers, "true" and "false" need single quotes
  • comments are marked with "--" instead of "#"
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 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
« Last Edit: 2015/07/25, 19:47:22 by dibl »
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline ayla

  • User
  • Posts: 1.744
Re: Conky 1.10 -- Lua conversion
« Reply #1 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

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

greets
ayla


 
« Last Edit: 2015/07/25, 20:53:30 by ayla »

Online dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
Re: Conky 1.10 -- Lua conversion
« Reply #2 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
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline paxmark2

  • User
  • Posts: 85
Re: Conky 1.10 -- Lua conversion
« Reply #3 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.