启动项设置延时30秒开机启动,详情看man page
第一步:安装
终端输入:
代码:
sudo apt-get install conky
zcat /usr/share/doc/conky/examples/conky.conf.gz > ~/.conkyrc
或者新立德搜索comky安装
也许你会发现找不到这个文件,这大概是版本不同的原因。不过还好,一般情况下这个路径下只有这一个压缩文件。
第二步:配置conky
终端输入:
代码:
gedit ~/.conkyrc
代码: 全选
# set to yes if you want Conky to be forked in the background
background yes
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Microsoft YaHei:size=8
# Text alpha when using Xft
xftalpha 0.8
#on_bottom yes
# mail spool
#mail_spool $MAIL
# Update interval in seconds
update_interval 2
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_colour hotpink
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 200 5
maximum_width 300
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
draw_graph_borders yes
# Stippled borders?
stippled_borders 3
# border margins
border_margin 0
# border width
border_width 0
# Default colors and also border colors
default_color grey90
default_shade_color black
default_outline_color DarkGrey
# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
gap_x 2
gap_y 1
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer yes
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# none, xmms, bmp, audacious, infopipe (default is none)
#none xmms_player bmp
# boinc (seti) dir
# seti_dir /opt/seti
# Possible variables to be used:
#
# Variable Arguments Description
# acpiacadapter ACPI ac adapter state.
# acpifan ACPI fan state
# acpitemp ACPI temperature.
# adt746xcpu CPU temperature from therm_adt746x
# adt746xfan Fan speed from therm_adt746x
# 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
# 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
#
# seti_prog Seti@home current progress
# seti_progbar (height) Seti@home current progress bar
# seti_credit Seti@hoome total user credit
# 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
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
# stuff after 'TEXT' will be formatted on screen
TEXT
${voffset -93}${font OpenLogos:regular:size=18}${color #ffa500}${voffset 93}${font Microsoft YaHei:regular:size=11}${color #5da5d3}系统信息 WWW.LIZHENGLIN.COM
${voffset -6}${color #ffd700}${hr 1}$font$color
${font Microsoft YaHei:bold:size=8}${color #ffd700}系统: $alignr${color}${execi 99999 uname -o} ${color #cdc8b1}${execi 99999 lsb_release -d -s -c | tr -s "\n" " "}
${font Microsoft YaHei:bold:size=8}${color #ffd700}内核: $alignr${color}$kernel $machine ${color}${execi 99999 uname -v | cut -c -15}
${font Microsoft YaHei:bold:size=8}${color #ffd700}开机时间: $alignr${color}$uptime_short
${font Your Keys:regular:18}${color white}${font Anklepants:regular:size=11}${color #5da5d3}CPU信息
${voffset -8}${color #ffd700}${hr 1}$font$color
${font Microsoft YaHei:bold:size=8}${color #ffd700}${execi 99999 cat /proc/cpuinfo | grep "model name" -m1 | cut -d":" -f2 | cut -d" " -f2- | sed 's#Processor ##'}${font Microsoft YaHei:size=8}$color
${freq_g 1}GHz ${color #c0ff3e}${execi 5 sensors |grep '^Core 0' |cut -c15-16} °C${font Microsoft YaHei:size=8}$color$alignr${freq_g 2}GHz ${color #c0ff3e}${execi 5 sensors |grep '^Core 1' |cut -c15-16} °C $color
${voffset -6}${cpugraph cpu1 25,115 000000 ff4500 } $alignr${offset -2}${cpugraph cpu2 25,115 000000 436eee}
${color #ffffff}${voffset -25} ${cpu cpu1}%$alignr${cpu cpu2}% ${color #ff4500}
${voffset 5}${color #ffe7ba}Load: $color $loadavg ${color #ffe7ba} $alignr Processes: $color$running_processes/$processes
${color #ffe7ba}Top Processes$alignr -PID- CPU MEM$color
${top name 1}${color #ff6a6a}$alignr${top pid 1}${top cpu 1} ${top mem 1}$color
${top name 2}${color #ffc125}$alignr${top pid 2}${top cpu 2} ${top mem 2}$color
${top name 3}${color #eeee00}$alignr${top pid 3}${top cpu 3} ${top mem 3}$color
${top name 4}${color #c0ff3e}$alignr${top pid 4}${top cpu 4} ${top mem 4}$color
${voffset 4}${font Your Keys:regular:18}${color white}${font Anklepants:regular:size=11}${color #5da5d3}GPU信息
${voffset -8}${color #ffd700}${hr 1}$font$color
${font Microsoft YaHei:bold:size=10}${color #ffd700}显卡: ${font Bitstream Charter:bold:size=10}${color #cdc8b1}${execi 20 glxinfo | grep "OpenGL renderer" | cut -c 25-39}$color$font
显卡频率:${color #c0ff3e}${execi 20 nvidia-settings -q GPUCurrentClockFreqs | grep "Attribute" | cut -d" " -f6 | tr -s "," "/" | tr -d "."
} MHz $alignr${color} 温度:${color #c0ff3e}${execi 20 nvidia-settings -q gpucoretemp | grep "Attribute" | cut -d" " -f6 | cut -c -2} °C
${voffset 4}${font Mac Dingbats:regular:size=14}${color #f5f5dc}V ${voffset -4}${font Microsoft YaHei:regular:size=11}${color #5da5d3}内存和硬盘
${voffset -8}${color #ffd700}${hr 1}$font$color
${color #ffe7ba}内存:$color $mem/$memmax${color #828282}$alignr${offset -2}${membar 10,80}
${color #ffff00}${voffset -16}$alignr$memperc% ${voffset 2}
${color #c0ff3e}硬盘温度:$alignr${color #f0e68c}${hddtemp /dev/sda}
$color${diskiograph 10 00ff00 2f4f4f}
${voffset -25}${color #ffd700} Reading: $color$diskio_read$alignr${color #ffd700}Writing: $color$diskio_write ${voffset 10}
${color #ffe7ba}文件系统:$color${fs_used /}/ ${fs_size /}$alignr${color #ffd700}${fs_type /} $color${fs_used_perc /}%
${voffset -5}${color #7fff00}${fs_bar 3 /}
${color #ffe7ba}Home:$color$alignc ${fs_used /home}/ ${fs_size /home}$alignr${color #ffd700}${fs_type /home} $color${fs_used_perc /home}%
${voffset -5}${color #ffff00}${fs_bar 3 /home}
${voffset 3}${font Wingdings 3:regular:size=18}${color #bcee68}${voffset -3}${font Microsoft YaHei:regular:size=11}${color #5da5d3} 网络信息
${voffset -8}${color #ffd700}${hr 1}${font Microsoft YaHei:size=8}$color
${color #ffe7ba}公网IP: $alignr$color${execi 3600 wget -O - http://www.lizhenglin.com/wwip.asp | tail}
${color #ffe7ba}内网IP:$color $alignr${addr eth1}
${voffset 3}${downspeedgraph eth1 25,115 e02a2a ff0000}${alignr}${offset -2}${upspeedgraph eth1 25,115 2121db 0000ff}
${voffset -26}${color #ffd700} 下载速度: ${color white}${downspeed eth1}KB/s ${alignr}${color #ffd700}上传速度: ${color white}${upspeed eth1}KB/s
${voffset 5}${color #ffe7ba}总计下载: ${color white}${totaldown eth1} ${alignr}${color #ffe7ba}总计上传: ${color white}${totalup eth1}
IP调用代码(自己有网站把代码放自己空间去):
代码: 全选
<%
ip=Request.ServerVariables("LOCAL_ADDR")
response.write Request.ServerVariables("REMOTE_ADDR")&""&port
%>
本来现个调用天气的,但是发现调用了启动比较慢,就去掉了
天气配置:
打开yahoo的天气网址:
http://weather.yahoo.com/
在Enter city or zip code:中输入你的城市(只有一些大城市,小城市可以选择较近的),搜索。然后在地址栏中获取你城市的代码,是CHXX开头的一个8字节串。例如:CHXX0015
天气代码:
代码: 全选
${color white}WEATHER ${hr 1}${color}
${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=CN}
${font Weather:size=44}${color gold}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=WF}${font}${color}${voffset -20}${offset 18}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=CC}${offset 10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=HT}${offset 10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=WS} ${font Arrows:size=10}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=BF}$font
${offset 60}Sol: ${color}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=SR}-${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=SS}
${font Weather:size=26}${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=WF --startday=1 --endday=4 --spaces=1}${font}
${execi 3600 python ~/conkyrc/conkyForecast.py --location=CHXX0015 --datatype=HT --startday=1 --endday=4 --spaces=11}