Conky(2) ( No Comments

今天又折腾了一下Conky,添加了天气预报,感觉还可以,不过还有一点没搞定,显示天气那里是另一个conky,两个相交的部分,上面的把下面的覆盖了,但是显示天气的后出来的啊,应该覆盖上面的才对啊,可上面的覆盖了下面的。

~/bash 囧☯☎ cat conkystart.sh
#!/bin/bash
sleep 15
conky -c /home/element/.conkyrc
sleep 60
conky -c /home/element/bash/myconkyweather

其中myconkyweather是抓天气的,下面的参考帖子中有。
参考了:

http://forum.ubuntu.org.cn/viewtopic.php?f=33&t=125456&st=0&sk=t&sd=a
http://forum.ubuntu.org.cn/viewtopic.php?t=123232&highlight=

需要安装上面两个帖子中提到的字体,要不然出不来那种效果。天气代码的查询:http://weather.yahoo.com/


刚又在之前的基础上改了一下,那个覆盖的问题算是解决了。自己觉得还满意,花了好常时间哦。修改了 conkystart.sh 和 myconkyweather(用来显示天气),myconkyweather 调用了 conkyForecast.py ,此文件在 ~/bash 下。

~/bash 囧☯☎ ll | grep conky
-rwxr-xr-x 1 element element 47618 2008-05-18 17:51 conkyForecast.py
-rwxr--r-- 1 element element 114 2008-10-04 07:23 conkystart.sh
-rw-r--r-- 1 element element 4430 2008-10-04 07:25 myconkyweather

~/bash 囧☯☎ cat conkystart.sh
#!/bin/bash
sleep 15 && conky -c /home/element/.conkyrc & sleep 15 && conky -c /home/element/bash/myconkyweather

~/bash 囧☯☎ cat myconkyweather
# maintain spacing between certain elements
use_spacer right# set to yes if you want tormo to be forked in the background
background yesuse_xft yes# Xft font when Xft is enabled
#xftfont Vera-8
#xftfont Andale Mono-8
#xftfont Clean-8
#xftfont cubicfive10:pixelsize=8
#xftfont Sans-Serif:size=9:pixelsize=11
#xftfont swf!t_v02:pixelsize=11
font ZhunYuan:size=8
xftfont ZhunYuan:size=8# Text alpha when using Xft
xftalpha 0.8
#mail_spool $MAIL# Update interval in seconds
update_interval 2.0# Create own window instead of using desktop (required in nautilus) normal desktop or override
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager#own_window_hints below# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 308 5
maximum_width 316

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no # amplifies text

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 10

# border margins
border_margin 4

# border widt5
border_width 0

# Default colors and also border colors,
default_color gold
default_shade_color black
default_outline_color DarkGrey

# 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 0

# 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
${voffset -6}${font Weather:size=30}${color #ffa500} D ${voffset -8}${font Anklepants:regular:size=11}${color #5da5d3}Weather Broadcast${font}
${voffset 5}${color white}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=CN}
${voffset -5}${color}${hr 1}$color
${font Weather:size=44}${color white}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=WF}${font}${color}
${voffset -50}${offset 60}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=HT}
${offset 60}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=BR}
${offset 60}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=WS}km/h ${font Arrows:size=10}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=BF}$font
${voffset -60}${offset 140}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=DW --startday=1 --endday=3 --spaces=12 --shortweekday}
${offset 135}${voffset 5}${color white}${font Weather:size=26}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=WF --startday=1 --endday=3 --spaces=1}${font}${color}
${offset 125}${voffset -5}${color white}${font Weather:size=16}i${font} ${voffset -3}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=PC --startday=1 --endday=3 --spaces=12}
${offset 130}${voffset 4}${color white}${font Weather:size=16}v${font} ${voffset -3}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=WS --startday=1 --endday=3 --spaces=8}
${font Arrows:size=10}${offset 175}${voffset -11}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=BF --startday=1 --endday=1 --spaces=0}$font${offset 45}${voffset -1}${font Arrows:size=10}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=BF --startday=2 --endday=2 --spaces=0}$font${offset 45}${font Arrows:size=10}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=BF --startday=3 --endday=3 --spaces=0}$font${offset 45}
${offset 132}${voffset 2}${color white}${font Weather:size=16}z${font} ${voffset -3}${color gold}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=HT --startday=1 --endday=3 --spaces=10}
${voffset -45}${color white}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=CC}
${voffset 5}${color white}Humedad: ${color}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=HM}
${voffset 3}${color white}Sol: ${color}${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=SR}-${execi 3600 python ~/bash/conkyForecast.py --location=CHXX0120 --datatype=SS}
${voffset -5}${color #ffd700}${hr 1}$color

效果图如下(右边的为最终的效果):
Conky2 conkyweather conkyweather1

 <<auto complete bracket in vim | vim自动补全括号 在控制台下播放电影,显示中文 | Play movie & display chinese under console >>

Leave a Reply



Spam Protection by WP-SpamFree