Conky(简体中文)
From ArchWiki
i18n |
---|
English |
简体中文 |
Italiano |
Türkçe |
Contents |
简介
Conky is a system monitor software for the X Window System. It is available for Linux and FreeBSD. It is free software released under the terms of the BSD license. Conky is able to monitor many systems variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.
安装 & 配置
- Conky is available in the Extra repository
# pacman -S conky
- Edit config file using an example configuration file from homeproject-screenshot
$ nano ~/.conkyrc
- Alternatively, you can use the default config at /etc/conky/conky.conf:
$ cp /etc/conky/conky.conf ~/.conkyrc
提示 & 技巧
如何防止闪烁
Conky needs Double Buffer Extension (DBE) support from X server to prevent flickering, because it can't update window fast enough without it. It can be enabled in /etc/X11/xorg.conf with Load "dbe" line in Section "Module". To enable double-buffer check to have in ~/.conkyrc:
double_buffer yes
与桌面集成
Conky with screenshot configuration generate problems with icons visualization. So there are some steps to follow.
- Add these lines to ~/.conkyrc:
own_window yes own_window_type normal own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar,skip_page
- if this setting is on, comment it out or delete the line
minimum_size
- To autostart conky create this link
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink
- Install feh
# pacman -S feh
- Make a script to allow transparency with the desktop
For KDE3 users
$ nano -w ~/.kde/share/autostart/fehconky
#!/bin/bash feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`
For KDE4 users
$ nano -w ~/.kde4/share/autostart/fehconky
#!/bin/bash feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"
use --bg-center if you use a centered wallpaper.
- Make it executable
$ chmod +x ~/.kde/share/autostart/fehconky
- Optionally instead using a script you can add the corresponding line to the bottom of .conkyrc
$ nano ~/.conkyrc
For KDE3
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}
For KDE4
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}
How To Display Information About Available Package Updates in Conky
Take a look at the following threads for scripts to display information about available updates in conky:
- Script to display the number of packages waiting for update.
- Update notifier in python
- Scrolling package update notifier
- bash script for users that have enabled ShowSize
如何在Conky中显示天气预报
请参阅此教程.
如何在Conky中显示RSS feeds
Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute you would put this into your .conkyrc:
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }
如何在Conky中显示rtorrent状态
请参阅此教程.
如何在Conky中显示Gmail中新邮件的数量
Create a file named gmail.py
in a convenient location (this example uses ~/.scripts/
) with the folowing Python code:
import os import string #Enter your username and password below within double quotes # eg. username="username" and password="password" username="****" password="****" com="wget -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate" temp=os.popen(com) msg=temp.read() index=string.find(msg,"<fullcount>") index2=string.find(msg,"</fullcount>") fc=int(msg[index+11:index2]) if fc==0: print "0 new" else: print str(fc)+" new"
Add the folowing string to your .conkyrc
in order the check your gmail account for new email every five minutes (300 seconds) and display: # new
${execi 300 python ~/.scripts/gmail.py}
外部链接
- Conky Configs on arch forums
- Official website
- Conky on Freshmeat
- Conky on SourceForge
- #conky IRC chat channel on freenode
- FAQ
用户提供的实例.conkyrc文件
Graysky的.conkyrc
[截图]
Modify to fit your system. Optimized for a quad core chip w/ three hdds (although two of them aren't connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds.
# for this to work you need both lm-sensors and hddtemp # get both from main repos # set to yes if you want Conky to be forked in the background background no own_window yes own_window_type override own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager 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 Bitstream Vera Sans Mono:size=8 # # #own_window_transparent no #own_window_colour hotpink # Text alpha when using Xft xftalpha 0.8 #on_bottom yes # Update interval in seconds update_interval 2 # Create own window instead of using desktop (required in nautilus) #own_window no # Use double buffering (reduces flicker, may not work for everyone) double_buffer yes # Minimum size of text area #minimum_size 250 5 maximum_width 258 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders around text draw_borders no # Stippled borders? stippled_borders 10 # border margins border_margin 4 # border width border_width 1 # Default colors and also border colors default_color white default_shade_color white default_outline_color white # Text alignment, other possible values are commented #alignment top_left #minimum_size 10 10 #alignment top_right alignment bottom_left #alignment bottom_right # Gap between borders of screen and text gap_x 12 gap_y 37 # Add spaces to keep things from moving about? This only affects certain objects. use_spacer no # Subtract file system buffers from used memory? no_buffers yes # set to yes if you want all text to be in uppercase uppercase no TEXT ${color #ddaa00}$nodename$color $sysname $kernel on $machine ${color lightgrey}Uptime:$color $uptime ${color lightgrey}- Load:$color $loadavg${color lightgrey} RAM Usage:$color $memperc% or $mem of $memmax${color lightgrey} Swap Usage:$color $swapperc%${color lightgrey} $color$stippled_hr${color lightgrey} Intel Xeon X3360 @ $color${freq_g} GHz${color lightgrey} (Vcc: ${execi 8 sensors | grep in0 | cut -c15-19} V) ${color black}${cpugraph 000000 5000a0}${color lightgrey} ${color lightgrey}Core0:$color ${execi 8 sensors | grep -A 1 'Core 0' | cut -c15-16 | sed '/^$/d'} °C${color grey} @$color ${cpu cpu1}% ${alignr}${cpubar cpu1 6,120} ${color lightgrey}Core1:$color ${execi 8 sensors | grep -A 1 'Core 1' | cut -c15-16 | sed '/^$/d'} °C${color grey} @$color ${cpu cpu2}% ${alignr}${cpubar cpu2 6,120} ${color lightgrey}Core2:$color ${execi 8 sensors | grep -A 1 'Core 2' | cut -c15-16 | sed '/^$/d'} °C${color grey} @$color ${cpu cpu3}% ${alignr}${cpubar cpu3 6,120} ${color lightgrey}Core3:$color ${execi 8 sensors | grep -A 1 'Core 3' | cut -c15-16 | sed '/^$/d'} °C${color grey} @$color ${cpu cpu4}% ${alignr}${cpubar cpu4 6,120}${color grey} $color$stippled_hr${color lightgrey} ${color grey} sda:$color ${execi 300 sudo hddtemp /dev/sda | cut -c25-26} °C ${color grey} sdb:$color ${execi 300 sudo hddtemp /dev/sdb | cut -c24-25} °C ${color grey} sdc:$color ${execi 300 sudo hddtemp /dev/sdc | cut -c34-35} °C ${color grey} GPU:$color ${execi 8 nvclock -T | grep 'GPU t' | cut -c21-22} °C ${color grey} M/B:$color ${execi 8 sensors | grep temp2 | cut -c15-16} °C ${color grey} NB:$color ${execi 8 sensors | grep temp3 | cut -c15-16} °C $color$stippled_hr${color lightgrey} ${color slate grey} /dev/shm: ${color }${fs_used_perc /dev/shm} % ${fs_bar /dev/shm} ${color grey}$stippled_hr${color light grey} ${color lightgrey}Processes:$color $processes ${color grey}Running:$color $running_processes ${color}Name PID CPU% MEM% ${color #ddaa00} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${color}Mem usage ${color #ddaa00} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1} ${color lightgrey} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2} ${color lightgrey} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}