web-dev-qa-db-ja.com

コンキーは天気情報を表示しません

Harmattan テーマを使用しています。

(XFCE 4.12を使用したXubuntu 14.04 LTSリリース上) enter image description here

何らかの理由で天気情報が表示されません。

ashesh-pc1@A1315IN:~$ 
Conky: desktop window (1200003) is subwindow of root window (7c)
Conky: window type - normal
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer
sh: 1: curl: not found
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
cp: cannot stat ‘/home/ashesh-pc1/.harmattan-assets/photos/smallest/.png’: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
cp: cannot stat ‘/home/ashesh-pc1/.harmattan-assets/icons/small-#dcdcdc/.png’: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
cp: cannot stat ‘/home/ashesh-pc1/.harmattan-assets/icons/small-#dcdcdc/.png’: No such file or directory
grep: /home/ashesh-pc1/.cache/weather.xml: No such file or directory
cp: cannot stat ‘/home/ashesh-pc1/.harmattan-assets/icons/small-#dcdcdc/.png’: No such file or directory
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather-1.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather-1.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather-1.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather-1.png'
Conky: Unable to load image '/home/ashesh-pc1/.cache/weather.png'

既にconkyをインストールしていますが、curlをインストールしようとすると、次のメッセージが表示されます。

ashesh-pc1@A1315IN:~$ Sudo apt-get install curl
[Sudo] password for ashesh-pc1: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 curl : Depends: libcurl3 (= 7.35.0-1ubuntu2.3) but 7.35.0-1ubuntu2.5 is to be installed
E: Unable to correct problems, you have held broken packages.

他のテーマも試しましたが、同様の問題が発生します。

これを修正するにはどうすればよいですか?

3

システムでカールを取得できませんでした。取得した可能性のある修正が多すぎたため、最終的にwgetの代わりにcurlを使用することに決めました

この場合のプログラムcurlは、基本的にyahooサーバーから天気情報を取得してディスクに保存します。これはwgetを使用して行うこともできます。

回避策

1。geditmousepadなどのテキストエディタを使用して/home/yourusername/.conkyrcファイルを開きます。

2。次のような行を探します。

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=2295411&u=c" -o ~/.cache/weather.xml}

その上に次の行を追加します。

${execi 300 wget "http://weather.yahooapis.com/forecastrss?w=2295411&u=c" --output-document=.cache/weather.xml}

そのため、次のようになります。

${execi 300 wget "http://weather.yahooapis.com/forecastrss?w=2295411&u=c" --output-document=.cache/weather.xml}
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=2295411&u=c" -o ~/.cache/weather.xml}

ファイルを保存し、Conkyを再起動しますpkill conky && conky


ここでの「2295411」はWOEIDであり、場所によって異なることに注意してください。ここで Yahoo WOEID Lookup で見つけることができます。

1

Curlがまだインストールされていない場合は、Curlを取得する必要がある場合もあります。

インストールするには、次のコマンドを使用します。

Sudo apt-get install curl

.Zipを完全にダウンロードしたら、それを抽出し、内部のファイルをホームフォルダー(/home/USERNAME)に移動する必要があります。

以下を完了している可能性がありますが、そうでない場合は読み続けてください。

Conkyテーマをインストールするのに必要なことはこれだけです。ただし、天気の場所を編集して自分の場所に一致させる必要があります。

  • Weather.yahoo.comにアクセスします
  • 天気予報検索ボックスで場所を検索します(予報の下)
  • URLの数値文字列をコピーします
  • ホームフォルダーで.conkyrcを開きます。
  • 番号を見つけます:「2294941」
  • Yahoo!からコピーした数値文字列に置き換えます。天気URL保存

ソース

3
Tim