zoukankan      html  css  js  c++  java
  • conky-lua

    --经过数天的查阅网上的资料(资料各种坑啊,一系列问题!),终于让他在linux-mint17 cinnamon工作了

    网络上的资料问题:

    getting "llua_do_call: funcction conky_clock_rings execution failed: attempt to call a nil value"

    这个问题是普遍出现, 很多指向的是lua文件的value是了nil值

    解决办法:

    打开这个lua文件,跳到conky_clock_rongs函数 即可发现差别了!

    问题2:hadtemp温度显示没有权限

    如果您的电脑系统没有将home和/分区的话,不会出现什么问题,如果分了区的话,直接hadtemp就可以了,不要那些什么 hadtemp /dev/sda 之类,

    不过我电脑显示的结果是N/A 可能是数据格式的问题  目前没有办法解决,有办法的人email我吧:11zjzhang@stu.edu.cn 感激不尽

    问题3:就是电源的问题,默认查找的路径是/proc/asci/battery... 不过本人电脑找了许久,没有这个目录,因此这个conky的接口不能使用,劝大家看到就默默的删除这个功能

    初拥conky-lua 不知道原理,所以不知如何下手自己更改,小小的磨练了一下,就关公门前耍一下大刀吧,也记录一下自己的学习

    clock_ring.lua conkyrc 两个文件 中conkyrc是conky的设置语言,里面有很多的接口函数词 大家要注意

    http://blog.csdn.net/dadoneo/article/details/6652326 配置变量表

    lua文件中起始就是一个table,对应conkyrc文件中的关键字(这些关键字就是配置变量表中的变量!),数组之后是对conky显示各种环的效果函数,利用了cairo包做的开发

    如果亲们也要自己简单DIY的话,可以任意添加新建自己的table元素,然后在conkyrc中按照配置格式配置(conky语法很容易看懂,不需要花时间按学习,照葫芦画瓢就完全OK~)

    本人将上述的电源显示环给换成了GPU的温度显示,小小的更改了一下,原来的文件是取自网上一名大神,因为各种查找资料,凌乱的忘记了这位大神发帖的网址,只记得是linux论坛网站

    clock_ring.lua

      1 --[[
      2 Clock Rings by londonali1010 (2009) Edited by jpope
      3 
      4 This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
      5 
      6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
      7 
      8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
      9     lua_load ~/scripts/clock_rings.lua
     10     lua_draw_hook_pre clock_rings
     11     
     12 Changelog:
     13 + v1.0 -- Original release (30.09.2009)
     14    v1.1p -- Jpope edit (05.10.2009)
     15 modified by putputput (13.10.2010v0.01£»14.10.2010v0.02)
     16 ]]
     17 
     18 settings_table = {
     19     {
     20         -- Edit this table to customise your rings.
     21         -- You can create more rings simply by adding more elements to settings_table.
     22         -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
     23         name='time',
     24         -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
     25         arg='%I.%M',
     26         -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
     27         max=12,
     28         -- "bg_colour" is the colour of the base ring.
     29         bg_colour=0xffffff,
     30         -- "bg_alpha" is the alpha value of the base ring.
     31         bg_alpha=0.1,
     32         -- "fg_colour" is the colour of the indicator part of the ring.
     33         fg_colour=0x3399cc,
     34         -- "fg_alpha" is the alpha value of the indicator part of the ring.
     35         fg_alpha=0.2,
     36     --×ÔŒºÐޞĵĜø¶ÈÌõ£º0 ²»¿ªÆô£»1 œö¿ªÆôœø¶ÈÌõ±äÉ«£»2 œö¿ªÆôÍžÃ÷¶È±ä»¯£»3 ¿ªÆô1¡¢2£»4 œö¿ªÆô±ß¿ò£»5 œö¿ªÆôÑÕÉ«ÍžÃ÷¶È¹ý¶É£»6 ¿ªÆô4¡¢5£»
     37     change_color=4,    
     38     start_alpha=0.2,
     39     end_alpha=0.2,
     40     startcolor=0x3399cc,
     41     endcolor=0x3399cc,
     42         -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
     43         x=100, y=170,
     44         -- "radius" is the radius of the ring.
     45         radius=50,
     46         -- "thickness" is the thickness of the ring, centred around the radius.
     47         thickness=5,
     48         -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
     49         start_angle=0,
     50         -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
     51         end_angle=360
     52     },
     53     {
     54         name='time',
     55         arg='%M.%S',
     56         max=60,
     57         bg_colour=0xffffff,
     58         bg_alpha=0.1,
     59         fg_colour=0x3399cc,
     60         fg_alpha=0.4,
     61     change_color=4,    
     62     start_alpha=0.4,
     63     end_alpha=0.4,
     64     startcolor=0x3399cc,
     65     endcolor=0x3399cc,
     66         x=100, y=170,
     67         radius=56,
     68         thickness=5,
     69         start_angle=0,
     70         end_angle=360
     71     },
     72     {
     73         name='time',
     74         arg='%S',
     75         max=60,
     76         bg_colour=0xffffff,
     77         bg_alpha=0.1,
     78         fg_colour=0x3399cc,
     79         fg_alpha=0.6,
     80     change_color=6,    
     81     start_alpha=0,
     82     end_alpha=0.6,
     83     startcolor=0x3399cc,
     84     endcolor=0x3399cc,
     85         x=100, y=170,
     86         radius=62,
     87         thickness=5,
     88         start_angle=0,
     89         end_angle=360
     90     },
     91     {
     92         name='time',
     93         arg='%d',
     94         max=31,
     95         bg_colour=0xffffff,
     96         bg_alpha=0.1,
     97         fg_colour=0x3399cc,
     98         fg_alpha=0.8,
     99     change_color=4,    
    100     start_alpha=0.8,
    101     end_alpha=0.8,
    102     startcolor=0x3399cc,
    103     endcolor=0x3399cc,
    104         x=100, y=170,
    105         radius=68,
    106         thickness=5,
    107         start_angle=-135,
    108         end_angle=135
    109     },
    110     {
    111         name='time',
    112         arg='%m',
    113         max=12,
    114         bg_colour=0xffffff,
    115         bg_alpha=0.1,
    116         fg_colour=0x3399cc,
    117         fg_alpha=1,
    118     change_color=4,    
    119     start_alpha=1,
    120     end_alpha=1,
    121     startcolor=0x3399cc,
    122     endcolor=0x3399cc,
    123         x=100, y=170,
    124         radius=74,
    125         thickness=5,
    126         start_angle=-90,
    127         end_angle=90
    128     },
    129     {
    130         name='cpu',
    131         arg='cpu1',
    132         max=100,
    133         bg_colour=0xffffff,
    134         bg_alpha=0.2,
    135         fg_colour=0xffff00,
    136         fg_alpha=0.4,
    137     change_color=6,    
    138     start_alpha=0,
    139     end_alpha=1,
    140     startcolor=0xff0000,
    141     endcolor=0xffffff,
    142         x=70, y=370,
    143         radius=25,
    144         thickness=5,
    145         start_angle=-90,
    146         end_angle=180
    147     },
    148     {
    149         name='cpu',
    150         arg='cpu2',
    151         max=100,
    152         bg_colour=0xffffff,
    153         bg_alpha=0.2,
    154         fg_colour=0xffff00,
    155         fg_alpha=0.4,
    156     change_color=6,    
    157     start_alpha=0,
    158     end_alpha=1,
    159     startcolor=0xff0000,
    160     endcolor=0xffff00,
    161         x=125, y=370,
    162         radius=25,
    163         thickness=5,
    164         start_angle=90,
    165         end_angle=-180
    166     },
    167     {
    168         name='memperc',
    169         arg='',
    170         max=100,
    171         bg_colour=0xffffff,
    172         bg_alpha=0.2,
    173         fg_colour=0x33ccff,
    174         fg_alpha=0.8,
    175     change_color=6,    
    176     start_alpha=0,
    177     end_alpha=1,
    178     startcolor=0x33ccff,
    179     endcolor=0x33ccff,
    180         x=97, y=420,
    181         radius=25,
    182         thickness=5,
    183         start_angle=-90,
    184         end_angle=180
    185     },
    186     {
    187         name='swapperc',
    188         arg='',
    189         max=100,
    190         bg_colour=0xffffff,
    191         bg_alpha=0.2,
    192         fg_colour=0x33ccff,
    193         fg_alpha=0.8,
    194     change_color=4,    
    195     start_alpha=0.8,
    196     end_alpha=0.8,
    197     startcolor=0x33ccff,
    198     endcolor=0x33ccff,
    199         x=153, y=420,
    200         radius=25,
    201         thickness=5,
    202         start_angle=90,
    203         end_angle=-180
    204     },
    205     {
    206         name='fs_used_perc',
    207         arg='/',
    208         max=100,
    209         bg_colour=0xffffff,
    210         bg_alpha=0.2,
    211         fg_colour=0x33FFFF,
    212         fg_alpha=0.7,
    213     change_color=4,    
    214     start_alpha=0.7,
    215     end_alpha=0.7,
    216     startcolor=0x33ffff,
    217     endcolor=0x33ffff,
    218         x=125, y=470,
    219         radius=25,
    220         thickness=5,
    221         start_angle=-90,
    222         end_angle=180
    223     },
    224         {
    225         name='wireless_link_qual_perc',
    226         arg='wlan0',
    227         max=100,
    228         bg_colour=0xFFFFFF,
    229         bg_alpha=0.2,
    230         fg_colour=0x33FFff,
    231         fg_alpha=0.5,
    232     change_color=6,    
    233     start_alpha=0,
    234     end_alpha=0.9,
    235     startcolor=0x33ffff,
    236     endcolor=0xff00ff,
    237         x=153, y=520,
    238         radius=25,
    239         thickness=5,
    240         start_angle=-90,
    241         end_angle=180
    242     },
    243         {
    244         name='nvidia',
    245         arg='temp',
    246         max=100,
    247         bg_colour=0xFFFFFF,
    248         bg_alpha=0.4,
    249         fg_colour=0xFF0000,
    250         fg_alpha=0.3,
    251     change_color=3,    
    252     start_alpha=0.8,
    253     end_alpha=0.3,
    254     startcolor=0xff0000,
    255     endcolor=0xff0000,
    256         x=170, y=607,
    257         radius=25,
    258         thickness=5,
    259         start_angle=-90,
    260         end_angle=180
    261     },
    262         {
    263         name='time',
    264         arg='%H',
    265         max=24,
    266         bg_colour=0xFFFFFF,
    267         bg_alpha=0.1,
    268         fg_colour=0x000000,
    269         fg_alpha=1,
    270     change_color=6,    
    271     start_alpha=0.2,
    272     end_alpha=0.5,
    273     startcolor=0xFFFFFF,
    274     endcolor=0x000000,
    275         x=53, y=607,
    276         radius=60,
    277         thickness=10,
    278         start_angle=-45,
    279         end_angle=90
    280     },
    281 }
    282 
    283 -- Use these settings to define the origin and extent of your clock.
    284 
    285 clock_r=65
    286 
    287 -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    288 
    289 clock_x=100
    290 clock_y=170
    291 
    292 show_seconds=true
    293 
    294 require 'cairo'
    295 
    296 function rgb_to_r_g_b(colour,alpha)
    297     return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    298 end
    299 
    300 function draw_ring(cr,t,pt)
    301     local w,h=conky_window.width,conky_window.height
    302     
    303     local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    304     local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    305     local cr1,t1,pt1=cr,t,pt
    306     local set_o=pt['change_color']
    307     local stc,edc=pt['startcolor'],pt['endcolor']
    308     local t_color=edc-stc
    309     local d_c=t*t_color+stc
    310     local sta,eda=pt['start_alpha'],pt['end_alpha']
    311     local t_alpha=eda-sta
    312     local d_a=t*t_alpha+sta
    313     local angle_0=sa*(2*math.pi/360)-math.pi/2
    314     local angle_f=ea*(2*math.pi/360)-math.pi/2
    315     local t_arc=t*(angle_f-angle_0)
    316 
    317     -- Draw background ring
    318     if angle_0>angle_f then
    319     cairo_arc_negative(cr,xc,yc,ring_r,angle_0,angle_f)
    320     else    
    321     cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    322     end
    323     cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    324     cairo_set_line_width(cr,ring_w)
    325     cairo_stroke(cr)
    326     
    327     -- Draw indicator ring
    328     if angle_0>angle_f then
    329     cairo_arc_negative(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    330     else
    331         cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    332     end
    333     if set_o==3 then
    334     cairo_set_source_rgba(cr,rgb_to_r_g_b(d_c,d_a))    
    335     else
    336         if set_o==2 then
    337         cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,d_a))
    338                 
    339         else
    340             if set_o==1 then
    341             cairo_set_source_rgba(cr,rgb_to_r_g_b(d_c,fga))    
    342             else
    343                 if set_o==0 then
    344                 cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))                
    345                 else
    346                     if set_o==4 then            
    347                     change_clr_alpha(cr1,t1,pt1,1)                
    348                     else
    349                         if set_o==5 then
    350                         change_clr_alpha(cr1,t1,pt1,2)
    351                         else
    352                         change_clr_alpha(cr1,t1,pt1,3)
    353                         end
    354                     end
    355                 end
    356             end
    357         end
    358     end
    359     --cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    360     cairo_stroke(cr)        
    361 end
    362 
    363 function draw_clock_hands(cr,xc,yc)
    364     local secs,mins,hours,secs_arc,mins_arc,hours_arc
    365     local xh,yh,xm,ym,xs,ys
    366     local mych,mycm,mycs
    367     local myhc,mymc,mysc
    368     
    369     secs=os.date("%S")    
    370     mins=os.date("%M")
    371     hours=os.date("%I")
    372     mych=hours/12
    373     mycm=mins/60
    374     mycs=secs/60        
    375 
    376     myhc=mych*(0x3399ff)
    377 
    378     secs_arc=(2*math.pi/60)*secs
    379     mins_arc=(2*math.pi/60)*mins+secs_arc/60
    380     hours_arc=(2*math.pi/12)*hours+mins_arc/12
    381             
    382 
    383     -- Draw hour hand
    384     
    385     xh=xc+0.7*clock_r*math.sin(hours_arc)
    386     yh=yc-0.7*clock_r*math.cos(hours_arc)
    387     cairo_move_to(cr,xc,yc)
    388     cairo_line_to(cr,xh,yh)
    389     
    390     cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    391     cairo_set_line_width(cr,5)
    392     --cairo_set_source_rgba(cr,rgb_to_r_g_b(colour,alpha))
    393     cairo_set_source_rgba(cr,1,1,1,0.4)
    394     cairo_stroke(cr)
    395     
    396     -- Draw minute hand
    397     
    398     xm=xc+0.9*clock_r*math.sin(mins_arc)
    399     ym=yc-0.9*clock_r*math.cos(mins_arc)
    400     cairo_move_to(cr,xc,yc)
    401     cairo_line_to(cr,xm,ym)
    402     
    403     cairo_set_line_width(cr,3)
    404     cairo_stroke(cr)
    405     --cairo_new_path(cr)
    406     -- Draw seconds hand
    407     
    408     if show_seconds then
    409         xs=xc+clock_r*math.sin(secs_arc)
    410         ys=yc-clock_r*math.cos(secs_arc)
    411         cairo_move_to(cr,xc,yc)
    412         cairo_line_to(cr,xs,ys)
    413     
    414         cairo_set_line_width(cr,1)
    415         cairo_stroke(cr)
    416     end
    417 cairo_destroy(cr)
    418 end
    419 
    420 function change_clr_alpha(cr,t,pt,num1)
    421 
    422     local w,h=conky_window.width,conky_window.height
    423     
    424     local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    425     local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    426     local n1=pt['max']
    427     if n1<60 then
    428     n1=60         --×îС·Ö¶ÎÊýÁ¿Îª60£¬±£Ö€¹ý¶ÉÆœ»¬
    429     end    
    430     local set_o=pt['change_color']
    431     local stc,edc=pt['startcolor'],pt['endcolor']
    432     local t_color=tonumber(edc-stc)
    433     local d_c=t*t_color+stc
    434     local sta,eda=pt['start_alpha'],pt['end_alpha']
    435     local t_alpha=eda-sta
    436     local d_a=t*t_alpha+sta
    437     local angle_0=sa*(2*math.pi/360)-math.pi/2
    438     local angle_f=ea*(2*math.pi/360)-math.pi/2
    439     local t_arc=t*(angle_f-angle_0)
    440     cairo_new_path(cr)
    441 
    442     if num1==1 or num1==3 then
    443 
    444     if angle_0>angle_0+t_arc then
    445     cairo_arc_negative(cr,xc,yc,ring_r+ring_w/2,angle_0,angle_0+t_arc)    
    446     cairo_line_to(cr,xc+(ring_r-ring_w/2)*math.cos(angle_0+t_arc),yc+(ring_r-ring_w/2)*math.sin(angle_0+t_arc))
    447         
    448     cairo_arc(cr,xc,yc,ring_r-ring_w/2,angle_0+t_arc,angle_0)
    449         cairo_line_to(cr,xc+(ring_r+ring_w/2)*math.cos(angle_0),yc+(ring_r+ring_w/2)*math.sin(angle_0))
    450     cairo_set_source_rgba(cr,1,1,1,0.5) --±ß¿òÑÕÉ«
    451         cairo_set_line_width(cr,1)
    452     cairo_stroke_preserve(cr)
    453 
    454         cairo_stroke(cr)
    455 
    456     else    
    457     cairo_arc(cr,xc,yc,ring_r+ring_w/2,angle_0,angle_0+t_arc)    
    458     cairo_line_to(cr,xc+(ring_r-ring_w/2)*math.cos(angle_0+t_arc),yc+(ring_r-ring_w/2)*math.sin(angle_0+t_arc))
    459         
    460     cairo_arc_negative(cr,xc,yc,ring_r-ring_w/2,angle_0+t_arc,angle_0)
    461         cairo_line_to(cr,xc+(ring_r+ring_w/2)*math.cos(angle_0),yc+(ring_r+ring_w/2)*math.sin(angle_0))
    462     cairo_set_source_rgba(cr,1,1,1,0.5) --±ß¿òÑÕÉ«
    463         cairo_set_line_width(cr,1)
    464     cairo_stroke_preserve(cr)
    465 
    466         cairo_stroke(cr)
    467 
    468     end
    469 
    470     end 
    471 
    472     if num1==2 or num1==3 then
    473     cairo_new_path(cr)
    474     local angle_k,d_k=angle_0,stc
    475     local sp_angle= (angle_f-angle_0)/n1 --t_arc/n
    476     local f_angle=t*n1
    477     local r_k,g_k,b_k,a_k=rgb_to_r_g_b(d_k)
    478     local a_k=sta
    479     local r_ke,g_ke,b_ke=rgb_to_r_g_b(edc)
    480     local a_ke=eda
    481     local sp_dr,sp_dg,sp_db,sp_a=(r_ke-r_k)/n1,(g_ke-g_k)/n1,(b_ke-b_k)/n1,(a_ke-a_k)/n1
    482 
    483         for i=1,f_angle do
    484         if angle_k<angle_k+sp_angle then
    485               cairo_arc(cr,xc,yc,ring_r,angle_k,angle_k+sp_angle)
    486         else
    487         cairo_arc_negative(cr,xc,yc,ring_r,angle_k,angle_k+sp_angle)
    488         end
    489         cairo_set_source_rgba(cr,r_k,g_k,b_k,a_k)
    490         cairo_set_line_width(cr,ring_w-2)
    491         angle_k=angle_k+sp_angle
    492         r_k=r_k+sp_dr
    493         g_k=g_k+sp_dg
    494         b_k=b_k+sp_db
    495         a_k=a_k+sp_a
    496         cairo_stroke(cr)
    497         cairo_new_path(cr)
    498         end
    499     end
    500 end
    501 
    502 function conky_clock_rings()
    503     local function setup_rings(cr,pt)
    504         local str=''
    505         local value=0
    506         
    507         str=string.format('${%s %s}',pt['name'],pt['arg'])
    508         str=conky_parse(str)
    509         
    510         value=tonumber(str)
    511     if ( value == nil ) then value = 0 end
    512         pct=value/pt['max']
    513         
    514         draw_ring(cr,pct,pt)
    515 --change_clr_alpha(cr,pct,pt)
    516     end
    517     
    518     -- Check that Conky has been running for at least 5s
    519 
    520     if conky_window==nil then return end
    521     local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    522     
    523     local cr=cairo_create(cs)    
    524     
    525     local updates=conky_parse('${updates}')
    526     update_num=tonumber(updates)
    527     
    528     if update_num>5 then
    529         for i in pairs(settings_table) do
    530             setup_rings(cr,settings_table[i])
    531         cairo_stroke(cr)
    532 
    533         end
    534     end
    535     
    536     draw_clock_hands(cr,clock_x,clock_y)
    537 end

    .conkyrc

     1 # Conky settings #
     2 background no
     3 update_interval 1
     4 
     5 cpu_avg_samples 2
     6 net_avg_samples 2
     7 
     8 override_utf8_locale yes
     9 
    10 double_buffer yes
    11 no_buffers yes
    12 
    13 text_buffer_size 2048
    14 #imlib_cache_size 0
    15 
    16 temperature_unit fahrenheit
    17 
    18 # Window specifications #
    19 
    20 own_window yes
    21 own_window_type desktop
    22 own_window_transparent yes
    23 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    24 
    25 border_inner_margin 0
    26 border_outer_margin 0
    27 
    28 minimum_size 200 250
    29 maximum_width 200
    30 
    31 alignment tr
    32 gap_x 35
    33 gap_y 10
    34 
    35 # Graphics settings #
    36 draw_shades yes
    37 draw_outline no
    38 draw_borders no
    39 draw_graph_borders yes
    40 
    41 # Text settings #
    42 use_xft yes
    43 xftfont caviar dreams:size=8
    44 xftalpha 0.5
    45 
    46 uppercase no
    47 
    48 temperature_unit celsius
    49 
    50 
    51 default_color FFFFFF
    52 
    53 # Lua Load  #
    54 lua_load ~/.lua/scripts/clock_rings.lua ~/.lua/scripts/time_list.lua
    55 lua_draw_hook_pre clock_rings
    56 lua_draw_hook_post t_list
    57 
    58 TEXT
    59 ${color 00FF00}Highest CPU $alignr CPU%  MEM%%${color FFFFFF}
    60 ${top name 1}$alignr${top cpu 1}   ${top mem 1}
    61 ${top name 2}$alignr${top cpu 2}   ${top mem 2}
    62 ${top name 3}$alignr${top cpu 3}   ${top mem 3}
    63 ${top name 4}$alignr${top cpu 4}   ${top mem 4}
    64 ${font Zekton:Bold:size=12}${alignr}${nodename}/${machine}${font}
    65 ${color FFFFFF}${voffset 45}
    66 ${font Zekton:Bold:size=15}${alignc}${time %T}${font}
    67 ${color 7FFFD4}${voffset 51}
    68 ${font caviar dreams:size=8}${color #FFFFFF}${alignc}${execi 99999 cat /proc/cpuinfo | grep "model name" -m1 | cut -d':' -f2 |cut -d"@" -f1}
    69 ${font caviar dreams:size=8}${color FFFF00}CPU${alignr}${freq 1}MHz×2 / ${acpitemp}°C${font}
    70 ${font caviar dreams:size=8}${color FFFF00}根目录${alignr}${fs_size} ${font}
    71 ${if_up wlan0}${font caviar dreams:size=8}${color FFFF00}IP地址${alignr}${color #FFDC35}${addr wlan0}${else}${voffset 2}${color FF6600} LocalIP: ${color #FFDC35}${addr eth0}${endif}
    72 ${font caviar dreams:size=8}${color FFFF00}${alignr}${execi 600 /sbin/ifconfig eth0|grep "Scope:Global" | awk '{print $1 "	" $3}' | cut -f2 -s |cut -f1 -d"/"} 
    73 ${voffset -15}
    74 ${color 3399FF}${voffset 1}${sysname}${color FFFFFF}${alignr}${kernel}${machine}
    75 ${color 3399FF}运行时间${alignr}${color FFFFFF}${uptime}
    76 ${color FFFFFF}${goto 45}${voffset 30}${cpu cpu1}%${offset 65}${cpu cpu2}%
    77 ${color 3399FF}${goto 45}CPU1${offset 55}CPU2
    78 ${color FFFFFF}${goto 70}${voffset 23}${memperc}%${alignr}${swapperc}%
    79 ${color 3399FF}${goto 70}内存${offset 65}交换区
    80 ${color FFFFFF}${goto 95}${voffset 23}${fs_used_perc /}%
    81 ${color 3399FF}${alignr 80}根目录
    82 ${color FFFFFF}${voffset 23}${alignr 50}${wireless_link_qual_perc wlan0}%
    83 ${color 3399FF}${alignr 50}${wireless_essid wlan0}
    84 ${voffset 17}${color FFFFFF}子夜${offset 14}${voffset -12}清晨${offset 10}${voffset 12}黄昏${offset -6}${voffset 31}深夜${font }
    85 ${color 3399FF}${font WenQuanYi Micro Hei:bold:size=13}${voffset -25}酱油${font}${font caviar dreams:size=8}de一天${font}
    86 ${voffset 5}${color FFFFFF}${alignr 32}${nvidia temp}°C
    87 ${color 3399FF}${alignr 32}GPU温度
    88 ${color 00FF00}Highest MEM $alignr CPU%  MEM%${color FFFFFF}
    89 ${top_mem name 1}$alignr${top_mem cpu 1}   ${top_mem mem 1}
    90 ${top_mem name 2}$alignr${top_mem cpu 2}   ${top_mem mem 2}
    91 ${top_mem name 3}$alignr${top_mem cpu 3}   ${top_mem mem 3}
    92 ${voffset 12}

    效果图:上面部分因为有名字,所以就没截图,大家共勉!也谢谢网上的各位大神提供的各种帮助!

  • 相关阅读:
    eclipse 关闭web项目无用校验
    Java7的那些新特性
    Linux内核源码情景分析-wait()、schedule()
    android canvas 画图笔记
    android启动第一个界面时即闪屏的核心代码(两种方式)
    leetCode(24):Binary Search Tree Iterator
    12:打印 1 到最大的 n 位数
    Android仿QQ ios dialog,仿QQ退出向上菜单
    iOS UI16_数据持久化
    Android自己定义百度地图缩放图标
  • 原文地址:https://www.cnblogs.com/jackcin/p/4156623.html
Copyright © 2011-2022 走看看