日期:2014-05-16  浏览次数:20836 次

linux 桌面时钟

? 生成桌面时钟的原理是,通过conky来解析对应rc 文件,最终显示到桌面。

?

生成~/.conkyrc文件:

?

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 400
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment top_right
gap_x 50
gap_y 80
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right

TEXT
${voffset 10}${color EAEAEA}${font GE Inspira:pixelsize=60}${time %H:%M}${font}${voffset -35}${offset 10}${color FFA300}${font GE Inspira:pixelsize=21}${time %d} ${voffset -15}${color EAEAEA}${font GE Inspira:pixelsize=11}${time  %B} ${time %Y}${font}${voffset 24}${font GE Inspira:pixelsize=29}${offset -90}${time %A}${font}
#${voffset 1}${offset 12}${font Ubuntu:pixelsize=10}${color FFA300}HD ${offset 9}$color${fs_free /} / ${fs_size /}${offset 30}${color FFA300}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%
?

输入命令来执行和解析conkyrc文件:

conky -c ~/.conkyrc &

?

对应rc文件参考:

http://www.osmsg.com/2011/05/conky-themes/

?

conkyrc语法:

http://conky.sourceforge.net/config_settings.html