好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

系统字体配置、中文显示和输入法问题
回复
头像
zoe1210
帖子: 28
注册时间: 2010-11-18 0:47
联系:

好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#1

帖子 zoe1210 » 2011-03-14 18:18

好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决 ??希望高人啊
screenshot4.png




代码如下:

# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit fahrenheit

# Window specifications #

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 200 250
maximum_width 200

alignment tr
gap_x 35
gap_y 55

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5

uppercase no

temperature_unit celsius


default_color FFFFFF

# Lua Load #
lua_load ~/.lua/scripts/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT
${voffset 8}${color FF6600}${font caviar dreams:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font caviar dreams:size=38}${time %e}${font}
${color FFFFFF}${voffset -30}${color FFFFFF}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font caviar dreams:size=20}${time %Y}${font}${color FF6600}${hr}
${voffset 140}${font caviar dreams:size=10}${alignr}HOME${font}
${font caviar dreams:size=12}${color FFFFFF}${alignr}${weather http://weather.noaa.gov/pub/data/observ ... /stations/ LQBK temperature temperature 30} °C${font}
${image ~/.conky/new-ubuntu-logo.png -p 64,125 -s 70x20}

${color FFFFFF}${goto 25}${voffset 35}${cpu cpu0}%
${color FF6600}${goto 25}CPU
${color FFFFFF}${goto 50}${voffset 23}${memperc}%
${color FF6600}${goto 50}RAM
${color FFFFFF}${goto 75}${voffset 23}${swapperc}%
${color FF6600}${goto 75}Swap
${color FFFFFF}${goto 100}${voffset 23}${fs_used_perc /}%
${color FF6600}${goto 100}Disk
${color FFFFFF}${goto 125}${voffset 25}${downspeed eth0}
${color FFFFFF}${goto 125}${upspeed eth0}
${color FF6600}${goto 125}Net



${color FFFFFF}${font caviar dreams:size=8}Uptime: ${uptime_short}
${color FFFFFF}${font caviar dreams:size=8}Processes: ${processes}
${color FFFFFF}${font caviar dreams:size=8}Running: ${running_processes}


${color FF6600}${font caviar dreams:size=8}${alignr}${nodename}
${color FF6600}${font caviar dreams:size=8}${alignr}${pre_exec cat /etc/issue.net} $machine
${color FF6600}${font caviar dreams:size=8}${alignr}Kernel: ${kernel}


clock_rings.lua

--[[
Clock Rings by londonali1010 (2009) Edited by jpope

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.

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.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/clock_rings.lua
lua_draw_hook_pre clock_rings

Changelog:
+ v1.0 -- Original release (30.09.2009)
v1.1p -- Jpope edit (05.10.2009)
]]

settings_table = {
{
-- Edit this table to customise your rings.
-- You can create more rings simply by adding more elements to settings_table.
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
name='time',
-- "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 ''.
arg='%I.%M',
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
max=12,
-- "bg_colour" is the colour of the base ring.
bg_colour=0xffffff,
-- "bg_alpha" is the alpha value of the base ring.
bg_alpha=0.1,
-- "fg_colour" is the colour of the indicator part of the ring.
fg_colour=0x3399cc,
-- "fg_alpha" is the alpha value of the indicator part of the ring.
fg_alpha=0.2,
-- "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.
x=100, y=150,
-- "radius" is the radius of the ring.
radius=50,
-- "thickness" is the thickness of the ring, centred around the radius.
thickness=5,
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
start_angle=0,
-- "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.
end_angle=360
},
{
name='time',
arg='%M.%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0x3399cc,
fg_alpha=0.4,
x=100, y=150,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0x3399cc,
fg_alpha=0.6,
x=100, y=150,
radius=62,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%d',
max=31,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0x3399cc,
fg_alpha=0.8,
x=100, y=150,
radius=70,
thickness=5,
start_angle=-90,
end_angle=90
},
{
name='time',
arg='%m',
max=12,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0x3399cc,
fg_alpha=1,
x=100, y=150,
radius=76,
thickness=5,
start_angle=-90,
end_angle=90
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffff00,
fg_alpha=0.4,
x=50, y=300,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x33ccff,
fg_alpha=0.8,
x=75, y=350,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x33ccff,
fg_alpha=0.8,
x=100, y=400,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x3399cc,
fg_alpha=0.3,
x=125, y=450,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='upspeedf',
arg='eth0',
max=100,
bg_colour=0xffff33,
bg_alpha=0.2,
fg_colour=0xffff33,
fg_alpha=0.3,
x=150, y=500,
radius=25,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='downspeedf',
arg='eth0',
max=100,
bg_colour=0xccff33,
bg_alpha=0.2,
fg_colour=0xccff33,
fg_alpha=0.3,
x=150, y=500,
radius=20,
thickness=4,
start_angle=-90,
end_angle=180
},
}

-- Use these settings to define the origin and extent of your clock.

clock_r=65

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=100
clock_y=150

show_seconds=true

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height

local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)

-- Draw background ring

cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)

-- Draw indicator ring

cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end

function draw_clock_hands(cr,xc,yc)
local secs,mins,hours,secs_arc,mins_arc,hours_arc
local xh,yh,xm,ym,xs,ys

secs=os.date("%S")
mins=os.date("%M")
hours=os.date("%I")

secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12

-- Draw hour hand

xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)

cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,0.2,0.6,1,0.4)
cairo_stroke(cr)

-- Draw minute hand

xm=xc+clock_r*math.sin(mins_arc)
ym=yc-clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)

cairo_set_line_width(cr,3)
cairo_stroke(cr)

-- Draw seconds hand

if show_seconds then
xs=xc+clock_r*math.sin(secs_arc)
ys=yc-clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)

cairo_set_line_width(cr,1)
cairo_stroke(cr)
end
end

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

-- Check that Conky has been running for at least 5s

if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)

local cr=cairo_create(cs)

local updates=conky_parse('${updates}')
update_num=tonumber(updates)

if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table)
end
end

draw_clock_hands(cr,clock_x,clock_y)
end
挺直身子走路 www.114ubuntu.co.cc
头像
kumox
帖子: 2114
注册时间: 2008-04-14 23:29
来自: 曾也在NB大学呆过
联系:

Re: 好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#2

帖子 kumox » 2011-03-14 19:57

TEXT后第一句,换个字体

${voffset 8}${color FF6600}${font caviar dreams:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font caviar dreams:size=38}${time %e}${font}
${color FFFFFF}${voffset -30}${color FFFFFF}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font caviar dreams:size=20}${time %Y}${font}${color FF6600}${hr}
susan518
帖子: 1
注册时间: 2011-03-15 11:17

Re: 好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#3

帖子 susan518 » 2011-03-15 11:37

同意楼上的观点,换成系统已经安装的字体,我的为了保险起见,全是‘文泉驿等宽正黑‘,我当初为了一个weather字体花了两天的时间,最后终于搞明白是怎么回事了,顺便分享一下我的conky代码,我是从veket上移植过来的;

# perryfa configuration
#适合蓝色背景,有天气预报,右边。 单核cpu。
#如要更改天气预报的城市,这里去搜:http://bbs.weiphone.com/read.php?tid=258980

# X font used, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
font fixed
# font *mintsmild.se*
# font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# mail spool
# mail_spool $MAIL

# Create own window instead of using desktop (required in nautilus)
own_window yes

# If own_window is yes, you may use type normal, desktop or override
own_window_type normal

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window_transparent is set to no, you can set the background colour here
own_window_colour hotpink

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

background no

Update interval in seconds
update_interval 10

# Minimum size of text area
minimum_size 160 5
maximum_width 300

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 2

# border margins

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color red

color0 000000
color1 ACCAE8
color2 grey

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 50

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none

# Possible variables to be used:
#
# Variable Arguments Description
# acpiacadapter ACPI ac adapter state.
# acpifan ACPI fan state
# acpitemp ACPI temperature.
# battery (num) Remaining capasity in ACPI or APM
# battery. ACPI battery number can be
# given as argument (default is BAT0).
# buffers Amount of memory buffered
# cached Amount of memory cached
# color (color) Change drawing color to color
# cpu CPU usage in percents
# cpubar (height) Bar that shows CPU usage, height is
# bar's height in pixels
# downspeed net Download speed in kilobytes
# downspeedf net Download speed in kilobytes with one
# decimal
# exec shell command Executes a shell command and displays
# the output in torsmo. warning: this
# takes a lot more resources than other
# variables. I'd recommend coding wanted
# behaviour in C and posting a patch :-).
# execi interval, shell Same as exec but with specific interval.
# command Interval can't be less than
# update_interval in configuration.
# fs_bar (height), (fs) Bar that shows how much space is used on
# a file system. height is the height in
# pixels. fs is any file on that file
# system.
# fs_free (fs) Free space on a file system available
# for users.
# fs_free_perc (fs) Free percentage of space on a file
# system available for users.
# fs_size (fs) File system size
# fs_used (fs) File system used space
# hr (height) Horizontal line, height is the height in
# pixels
# i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev
# may be omitted if you have only one I2C
# device. type is either in (or vol)
# meaning voltage, fan meaning fan or temp
# meaning temperature. n is number of the
# sensor. See /sys/bus/i2c/devices/ on
# your local computer.
# kernel Kernel version
# loadavg (1), (2), (3) System load average, 1 is for past 1
# minute, 2 for past 5 minutes and 3 for
# past 15 minutes.
# machine Machine, i686 for example
# mails Mail count in mail spool. You can use
# program like fetchmail to get mails from
# some server using your favourite
# protocol. See also new_mails.
# mem Amount of memory in use
# membar (height) Bar that shows amount of memory in use
# memmax Total amount of memory
# memperc Percentage of memory in use
# new_mails Unread mail count in mail spool.
# nodename Hostname
# outlinecolor (color) Change outline color
# pre_exec shell command Executes a shell command one time before
# torsmo displays anything and puts output
# as text.
# processes Total processes (sleeping and running)
# running_processes Running processes (not sleeping),
# requires Linux 2.6
# shadecolor (color) Change shading color
# stippled_hr (space), Stippled (dashed) horizontal line
# (height)
# swapbar (height) Bar that shows amount of swap in use
# swap Amount of swap in use
# swapmax Total amount of swap
# swapperc Percentage of swap in use
# sysname System name, Linux for example
# temp1 Temperature #1 from i2c-sensors, same as
# ${i2c temp 1}
# temp2 Temperature #2 from i2c-sensors, same as
# ${i2c temp 2}
# time (format) Local time, see man strftime to get more
# information about format
# totaldown net Total download, overflows at 4 GB on
# Linux with 32-bit arch and there doesn't
# seem to be a way to know how many times
# it has already done that before torsmo
# has started.
# totalup net Total upload, this one too, may overflow
# updates Number of updates (for debugging)
# upspeed net Upload speed in kilobytes
# upspeedf net Upload speed in kilobytes with one
# decimal
# uptime Uptime
# uptime_short Uptime in a shorter format


# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

#font fixed
use_xft yes
xftfont sans-serif:size=11

TEXT
${font 文泉驿等宽正黑:size=11}${alignc}${time %G}年${time %b%e}日 星期${time %a}
${time %p} ${font Casual:size=25}${color #7B204A}${time %I:%M}${color}
${voffset -10}${font 文泉驿等宽正黑:size=13}${color white}天气 ${hr 1}${color}${font}
${font 文泉驿等宽正黑:size=10}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=CN}${font}
${font Weather:size=44}${color gold}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=WF}${color}${font}${font 文泉驿等宽正黑:size=11}${voffset -20}${offset 18}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=CC}${offset 10}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=HT} 湿度:${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=HM}
${offset 56}风速:${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=WS} 风向:${font}${font Arrows:size=10}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=BF}${font}
${font 文泉驿等宽正黑:size=11}${offset 56}日出日落: ${color}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=SR}-${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=SS}${font}
${font Weather:size=20}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=WF --startday=1 --endday=4 --spaces=3}${font}
${font Monofonto:size=11}${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=DW --startday=1 --endday=4 --spaces=7 --shortweekday}
${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=HT --startday=1 --endday=4 --spaces=6}
${execi 3600 python ~/my-applications/conky/conkyForecast.py --location=CHXX0122 --datatype=LT --startday=1 --endday=4 --spaces=6}${font}
${voffset 10}${font 文泉驿等宽正黑:size=13}${color white}网络(eth0) ${hr 1}${color}
${font 文泉驿等宽正黑:size=8}${color1}上传:$color ${upspeed eth0} k/s${color1} - 下载:$color ${downspeed eth0} k/s
${font 文泉驿等宽正黑:size=13}${color white}系统 ${hr 1}${color}${font}
${color1}${font 文泉驿等宽正黑:size=8}${color1}CPU使用率:$color $cpu%
${color1}${cpubar 3}
内存使用率:$color $mem/$memmax - $memperc%
${color1}${membar 3}
交换分区使用率:$color ${alignr}${swapperc}% (${swap}b/${swapmax}b)
${color1}${swapbar 3}
文件系统:
2fs/3fs:${color} ${fs_used /}/${fs_size /}
${color1}${fs_bar 3 /}
Home(硬盘):${color} ${fs_used /home/}/${fs_size /home}

${font 文泉驿等宽正黑:size=11}${color1}进程:$color $processes ${color1}运行中:$color $running_processes${font}
${font Monofonto:size=10} ${color #98c2c7}NAME PID CPU% MEM%
${color #e5e5e5}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #c4c4c4}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color #a3a3a3}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color #828282}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}$font${color}
${hr 1}
${font 文泉驿等宽正黑:size=8}${color1}开机时间: $color $uptime
${color1}$sysname${color} $kernel ${color1}on${color1} $machine
${color1}Host: $color veket Quirky ${execi 180
genime
帖子: 155
注册时间: 2010-05-29 0:48

Re: 好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#4

帖子 genime » 2013-05-26 16:54

楼主解决么, 我的也是这个问题,但是换什么字体呢,去哪里找?
echohiccups
帖子: 4
注册时间: 2012-08-11 14:27

Re: 好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#5

帖子 echohiccups » 2013-08-16 11:26

我解决了,你要的话留下邮箱我给你发一份无框框的
头像
adagio
论坛版主
帖子: 22110
注册时间: 2008-02-17 23:47
来自: 美丽富饶的那啥星球

Re: 好不容易找到个蛋蛋图conky 但是弄好后发现 有框框 不知怎么解决

#6

帖子 adagio » 2013-08-16 15:29

genime 写了:楼主解决么, 我的也是这个问题,但是换什么字体呢,去哪里找?
1. 找出配置文件中对应字体,去网上搜、下载、安装,over
或者
2. 找出配置文件中对应字体,换成自己电脑里已安装的字体,over
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……

---------------------------------------------------------------------------------
[图片版]新手当自强(续)FAQ
[新手进阶]挂载、fstab、调整linux分区
[图片版]E17桌面环境配置手把手
回复