conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

桌面秀,不同桌面、不同风格。
头像
Vanishing
帖子: 227
注册时间: 2009-04-16 9:58

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#16

帖子 Vanishing » 2010-01-19 10:11

karllv 写了:lz把完整的配置贴出来吧
看3楼。。呵呵
I lay down on my bed, looking at the stars, and starting to wonder............................................ .where the f*** is my roof..
头像
quanru
帖子: 336
注册时间: 2009-11-25 11:24

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#17

帖子 quanru » 2011-04-06 11:02

炎岩风火 写了:
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
想必LZ在调试时也遇到过吧,我从Conky Hardcore!上也看到这个环的做法了,那篇文章的作者也在脚本前面的注释里说了这个错误的原因,但我看得不怎么明白。
还有,我是1024X768的屏幕,单核CPU,就想做一个跟你差不多的,只带有时、分、CPU使用、内存使用的环,放在右下角,怎么调试?谢谢
ni zen me jie jue de
望青年不怨天尤人不贪图安逸
头像
tenzu
论坛版主
帖子: 36924
注册时间: 2008-11-21 20:26

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#18

帖子 tenzu » 2011-04-06 11:09

哥又来了,LZ入土有段日子了
头像
karllv
帖子: 632
注册时间: 2008-12-04 17:23

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#19

帖子 karllv » 2011-04-06 21:17

quanru 写了:
炎岩风火 写了:
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
想必LZ在调试时也遇到过吧,我从Conky Hardcore!上也看到这个环的做法了,那篇文章的作者也在脚本前面的注释里说了这个错误的原因,但我看得不怎么明白。
还有,我是1024X768的屏幕,单核CPU,就想做一个跟你差不多的,只带有时、分、CPU使用、内存使用的环,放在右下角,怎么调试?谢谢
ni zen me jie jue de
那段代码确实是错误的,我的指针都不显示,只有两个环
头像
karllv
帖子: 632
注册时间: 2008-12-04 17:23

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#20

帖子 karllv » 2011-04-06 21:29

代码: 全选

function conky_clock_rings()
   local function setup_rings(cr,pt)
      local str=''
      local value=0
      
      str=string.format('${%s %s}',pt['name'],pt['arg'])
      str=conky_parse(str)
      
      value=tonumber(str)
      pct=value/pt['max']
      
      draw_ring(cr,pct,pt)
   end
这段代码错误解决不了,结果返回如下:

代码: 全选

Conky: llua_do_call: function conky_clock_rings execution failed: /home/karllv/.scripts/rings.lua:190: attempt to perform arithmetic on local 'value' (a nil value)
暂时先将就用
附件
Screenshot.png
头像
karllv
帖子: 632
注册时间: 2008-12-04 17:23

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#21

帖子 karllv » 2011-04-06 22:24

karllv 写了:

代码: 全选

function conky_clock_rings()
   local function setup_rings(cr,pt)
      local str=''
      local value=0
      
      str=string.format('${%s %s}',pt['name'],pt['arg'])
      str=conky_parse(str)
      
      value=tonumber(str)
      pct=value/pt['max']
      
      draw_ring(cr,pct,pt)
   end
这段代码错误解决不了,结果返回如下:

代码: 全选

Conky: llua_do_call: function conky_clock_rings execution failed: /home/karllv/.scripts/rings.lua:190: attempt to perform arithmetic on local 'value' (a nil value)
暂时先将就用
被我搜到解决方法了

代码: 全选

value=tonumber(str)
pct=value/pt['max']
改成

代码: 全选

 value=tonumber(str)
		if ( value == nil ) then value = 0 end
		pct=value/pt['max']
头像
karllv
帖子: 632
注册时间: 2008-12-04 17:23

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#22

帖子 karllv » 2011-04-06 23:05

cpu mem / time基本搞定,明天再研究网络部分
附件
Screenshot.png
头像
kedacheng
帖子: 103
注册时间: 2008-08-03 14:12

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#23

帖子 kedacheng » 2011-04-07 11:39

:em09
vincent.ce
帖子: 75
注册时间: 2008-08-26 12:14

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#24

帖子 vincent.ce » 2011-04-13 10:29

Mark.
头像
wtry
帖子: 923
注册时间: 2009-03-18 9:26

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#25

帖子 wtry » 2011-08-26 23:52

karllv 写了:
karllv 写了:

代码: 全选

function conky_clock_rings()
   local function setup_rings(cr,pt)
      local str=''
      local value=0
      
      str=string.format('${%s %s}',pt['name'],pt['arg'])
      str=conky_parse(str)
      
      value=tonumber(str)
      pct=value/pt['max']
      
      draw_ring(cr,pct,pt)
   end
这段代码错误解决不了,结果返回如下:

代码: 全选

Conky: llua_do_call: function conky_clock_rings execution failed: /home/karllv/.scripts/rings.lua:190: attempt to perform arithmetic on local 'value' (a nil value)
暂时先将就用
被我搜到解决方法了

代码: 全选

value=tonumber(str)
pct=value/pt['max']
改成

代码: 全选

 value=tonumber(str)
		if ( value == nil ) then value = 0 end
		pct=value/pt['max']

这个好像解决不了啊

如果value=0
那在我这有个蛋蛋一直是0没有任何变动
soneedu
帖子: 32
注册时间: 2011-08-30 22:20

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#26

帖子 soneedu » 2011-09-01 19:20

代码: 全选

Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
这个问题,有人帮忙解决下不
头像
phoenixlzx
帖子: 2245
注册时间: 2009-07-29 20:11
系统: Arch Linux
来自: Gensokyo
联系:

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#27

帖子 phoenixlzx » 2011-09-01 19:29

占个坑。。
soneedu
帖子: 32
注册时间: 2011-08-30 22:20

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#28

帖子 soneedu » 2011-09-01 19:59

代码: 全选

Conky: llua_load: /root/.lua/scripts/clock_rings.lua:200: module 'cairo' not found:
   no field package.preload['cairo']
   no file './cairo.lua'
   no file '/usr/local/share/lua/5.1/cairo.lua'
   no file '/usr/local/share/lua/5.1/cairo/init.lua'
   no file '/usr/local/lib/lua/5.1/cairo.lua'
   no file '/usr/local/lib/lua/5.1/cairo/init.lua'
   no file '/usr/share/lua/5.1/cairo.lua'
   no file '/usr/share/lua/5.1/cairo/init.lua'
   no file '/usr/lib/conky/libcairo.so'
   no file './cairo.so'
   no file '/usr/local/lib/lua/5.1/cairo.so'
   no file '/usr/lib/x86_64-linux-gnu/lua/5.1/cairo.so'
   no file '/usr/lib/lua/5.1/cairo.so'
   no file '/usr/local/lib/lua/5.1/loadall.so'
Conky: desktop window (1400003) is subwindow of root window (ad)
Conky: window type - override
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value

代码: 全选

root@debian-soneedu:~/.lua/scripts# conky -v
Conky 1.8.1 compiled Fri Aug 12 04:54:12 UTC 2011 for Linux 3.0.0-1-amd64 (x86_64)

Compiled in features:

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

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

 Music detection:
  * Audacious
  * MPD
  * MOC
  * XMMS2

 General:
  * math
  * hddtemp
  * portmon
  * Curl
  * RSS
  * Weather (METAR)
  * Weather (XOAP)
  * wireless
  * config-output
  * Imlib2
  * apcupsd
  * iostats
  * ncurses
  * Lua

  Lua bindings:
   * Cairo
   * Imlib2
My OS:Debian

代码: 全选

3.0.0-1-amd64 #1 SMP
deb http://ftp.hk.debian.org/debian/ testing main
deb-src http://ftp.hk.debian.org/debian/ testing main
i fixed it myself,and here is my solution:
i check package information from http://packages.debian.org/testing/conky ,and i got that have conky-all pkg which archived inside contrib source, while i only added main source. that is why i cann't aptitude install conky-all.
then i added contrib source into /etc/apt/sources.list
and aptitude install conky-all, will remove conky-std auto, then run conky again, will display. funny, i will try to make it nice do my best.
上次由 soneedu 在 2011-09-01 22:16,总共编辑 1 次。
头像
wtry
帖子: 923
注册时间: 2009-03-18 9:26

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#29

帖子 wtry » 2011-09-01 21:58

Conky: llua_load: /root/.lua/scripts/clock_rings.lua:200: module 'cairo' not found:

cairo没装
soneedu
帖子: 32
注册时间: 2011-08-30 22:20

Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈

#30

帖子 soneedu » 2011-09-01 22:17

wtry 写了:Conky: llua_load: /root/.lua/scripts/clock_rings.lua:200: module 'cairo' not found:

cairo没装
不是没装,我已经搞定了。
i fixed it myself,and here is my solution:
i check package information from http://packages.debian.org/testing/conky ,and i got that have conky-all pkg which archived inside contrib source, while i only added main source. that is why i cann't aptitude install conky-all.
then i added contrib source into /etc/apt/sources.list
and aptitude install conky-all, will remove conky-std auto, then run conky again, will display. funny, i will try to make it nice do my best.

这个还是要视情况改的
value=tonumber(str)
if ( value == nil ) then value = 0 end

要安装conky-all 版本,就可以了
回复