当前位置:首页 > 用户投稿 > 正文

天气插件添加方法(geektool添加天气图标 天气信息教程)

天气插件添加方法(geektool添加天气图标 天气信息教程)

日期日历添加

百度一搜一把代码,今天就给大家讲讲天气的添加,因为名早有课,写得有些混乱。。见谅

curl --silent"http://weather.yahoo.com/forecast/CHXX0200.html"| grep"forecast-icon"| sed"s/.*background:url('(.*)'); _background.*/1/"| xargs curl --silent -o /tmp/weather.png

curl --silent"http://xml.weather.yahoo.com/forecastrss?p=CHXX0200&u=c"| grep -E '(Current Conditions:|C

curl --silent"http://weather.yahoo.com/china/xinjiang/karamay-2144016"| grep"forecast-icon"| sed"s/.*background:url('(.*)'); _background.*/1/"| xargs curl --silent -o /tmp/weather.png

这时候打开进入网站:http://weather.yahoo.com 搜索你要添加的城市,复制其链接

找到你的城市代码

之后返回终端框,第一第二行红色字段用你的城市代码代替,第三段红色部分用你要的城市网址

下一步添加天气图标,回到geektool界面,把image拖动到桌面

在右栏url输入框里输入“file:///tmp/weather.png"注意是三个斜杠!!

ok 完成了。还有注意事项:天气的刷新频率最好调到600s以上!

你可能想看: