seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2020/09/27, 11:57:35


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Conky 1.10 -- Lua conversion  (Read 11436 times)

0 Members and 1 Guest are viewing this topic.

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.034
    • Land of the Buckeye
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 »
Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO, 2@WD1003FZEX in BTRFS

Offline ayla

  • User
  • Posts: 1.706
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 »
Kernel: 4.18.11-towo.1-siduction-amd64 x86_64
Desktop: KDE Plasma 5.13.5
(mostly) kept current siduction "18.3.0 Patience"
HP EliteBook 8570p; MoBo: HP model: 17A7 v: KBC Version 42.35
Dual core  i5-3320M (-MT-MCP-)
Intel 3. Gen Graphics (Ivybridge) Driver:i915/ intel
 Wifi Intel Centrino N6205

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.034
    • 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
Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO, 2@WD1003FZEX in BTRFS

Offline paxmark2

  • User
  • Posts: 82
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.