看3楼。。呵呵karllv 写了:lz把完整的配置贴出来吧
conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
- Vanishing
- 帖子: 227
- 注册时间: 2009-04-16 9:58
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
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合体。。哇哈哈
ni zen me jie jue de炎岩风火 写了:想必LZ在调试时也遇到过吧,我从Conky Hardcore!上也看到这个环的做法了,那篇文章的作者也在脚本前面的注释里说了这个错误的原因,但我看得不怎么明白。Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
还有,我是1024X768的屏幕,单核CPU,就想做一个跟你差不多的,只带有时、分、CPU使用、内存使用的环,放在右下角,怎么调试?谢谢
望青年不怨天尤人不贪图安逸
- tenzu
- 论坛版主
- 帖子: 36924
- 注册时间: 2008-11-21 20:26
- karllv
- 帖子: 632
- 注册时间: 2008-12-04 17:23
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
那段代码确实是错误的,我的指针都不显示,只有两个环quanru 写了:ni zen me jie jue de炎岩风火 写了:想必LZ在调试时也遇到过吧,我从Conky Hardcore!上也看到这个环的做法了,那篇文章的作者也在脚本前面的注释里说了这个错误的原因,但我看得不怎么明白。Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
还有,我是1024X768的屏幕,单核CPU,就想做一个跟你差不多的,只带有时、分、CPU使用、内存使用的环,放在右下角,怎么调试?谢谢
- karllv
- 帖子: 632
- 注册时间: 2008-12-04 17:23
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
代码: 全选
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)
- karllv
- 帖子: 632
- 注册时间: 2008-12-04 17:23
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
被我搜到解决方法了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
- kedacheng
- 帖子: 103
- 注册时间: 2008-08-03 14:12
-
- 帖子: 75
- 注册时间: 2008-08-26 12:14
- wtry
- 帖子: 923
- 注册时间: 2009-03-18 9:26
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
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没有任何变动
-
- 帖子: 32
- 注册时间: 2011-08-30 22:20
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
代码: 全选
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
- 联系:
-
- 帖子: 32
- 注册时间: 2011-08-30 22:20
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
代码: 全选
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
代码: 全选
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 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合体。。哇哈哈
Conky: llua_load: /root/.lua/scripts/clock_rings.lua:200: module 'cairo' not found:
cairo没装
cairo没装
-
- 帖子: 32
- 注册时间: 2011-08-30 22:20
Re: conky 时钟,cpu,wireless, battery, memory合体。。哇哈哈
不是没装,我已经搞定了。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 版本,就可以了