conkyforecast japanese

https://github.com/ktkr3d/conkyforecast-ja

ConkyForecast 用の日本語PO ファイルを作成して、Conky-HTC を日本語化してみました。また、Conky-HTC の表示用スクリプトを整理してみました。

パッケージのインストール

http://ktkr3d.site11.com/2011/10/09/conky-htc/
conky, conkyForecast, Conky-HTC パッケージをインストールして以下の構成にしておきます。

フォルダ/ファイル構成
~/
├── .fonts/
├── .images/
├── .conkyForecast.config
├── .conkyrc
├── .conky_start
└── .vreme.template

conkyForecast の日本語化

$ wget https://github.com/ktkr3d/conkyforecast-ja/raw/master/locale/ja/LC_MESSAGES/conkyForecast.po
$ wget https://github.com/ktkr3d/conkyforecast-ja/raw/master/locale/ja/LC_MESSAGES/conkyForecastWU.po
$ msgfmt -o conkyForecast.mo conkyForecast.po
$ msgfmt -o conkyForecastWU.mo conkyForecastWU.po
$ sudo mkdir -p /usr/share/conkyforecast/locale/ja/LC_MESSAGES/
$ sudo cp *.mo /usr/share/conkyforecast/locale/ja/LC_MESSAGES/

~/.conkyForecast.config の編集

~/.conkyForecast.config
#=============================================#
# EXPERT SETTINGS, NOT REQUIRED TO BE ALTERED #
#=============================================#
#BASE_XOAP_URL = http://xoap.weather.com/weather/local/<LOCATION>?cc=*&dayf=5&link=xoap&prod=xoap&par=<XOAP_PARTNER_ID>&key=<XOAP_LICENCE_KEY>&unit=m
BASE_XOAP_URL = http://xml.weather.com/weather/local/<LOCATION>?cc=*&dayf=10&link=xoap&prod=xoap&par=<XOAP_PARTNER_ID>&key=<XOAP_LICENCE_KEY>&unit=m
MAXIMUM_DAYS_FORECAST = 10

#===============================================#
# USER SETTINGS, EDIT BASED ON DOCUMENTED SETUP #
#===============================================#
CACHE_FOLDERPATH = /tmp/
CONNECTION_TIMEOUT = 5
EXPIRY_MINUTES = 30
TIME_FORMAT = %H:%M
DATE_FORMAT = %Y-%m-%d
LOCALE = ja
XOAP_PARTNER_ID =
XOAP_LICENCE_KEY =
DEFAULT_LOCATION = JAXX0085
AUTO_NIGHT = False
PROXY_HOST =
PROXY_PORT = 8080
PROXY_USERNAME =
PROXY_PASSWORD =

~/.conkyrc の編集

~/.conkyrc
 # Time
${voffset 35}${goto 39}${font Helvetica LT Std:style=Condensed:size=60}${color 434343}${time %H}${goto 140}${color 434343}${time %M}${font Helvetica LT Std:style=Condensed:size=18}${color ffffff}${goto 225}${time %S}
# Date
${voffset 47}${font TakaoPGothic:size=8}${alignr 80}${time %G}/${time %m}/${time %d} (${time %a})
# City Name
${voffset -40}${goto 22}${exec conkyForecast --datatype=CN}
# Conditions Text, Current Temp
${goto 22}${execi 1800 conkyForecast --datatype=CT}${voffset -20}${goto 200}${font Helvetica LT Std:size=24}${execi 1800 conkyForecast -u --datatype=HT}
# High Temp, Low Temp of Today
${voffset -15}${font Helvetica LT Std:style=Condensed:size=10}#
${goto 200}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=0}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=0}
# High Temp, Low Temp of Next 5 Days
${voffset 53}${font Helvetica LT Std:style=Condensed:size=8}#
${goto 25}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=1}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=1}#
${goto 70}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=2}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=2}#
${goto 115}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=3}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=3}#
${goto 160}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=4}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=4}#
${goto 205}${color ffaaaa}${execi 1800 conkyForecast --datatype=HT -u --startday=5}${color ffffff} / ${color aaaaff}${execi 1800 conkyForecast --datatype=LT -u --startday=5}
# Day of Week
${font TakaoPGothic:size=8}${color ffffff}#
${goto 37}${execi 1800 conkyForecast --datatype=DW --shortweekday --startday=1}#
${goto 82}${execi 1800 conkyForecast --datatype=DW --shortweekday --startday=2}#
${goto 127}${execi 1800 conkyForecast --datatype=DW --shortweekday --startday=3}#
${goto 172}${execi 1800 conkyForecast --datatype=DW --shortweekday --startday=4}#
${goto 217}${execi 1800 conkyForecast --datatype=DW --shortweekday --startday=5}
${image ~/.images/base.png -p 12,30 -s 238x140}
${image ~/.images/base.png -p 12,190 -s 238x55}
${image ~/.images/flip_bg.png -p 30,10 -s 100x110}
${image ~/.images/flip_bg.png -p 130,10 -s 100x110}
${execpi 1800 conkyForecast --template=~/.vreme.template}

行中/行末に# を挿入すると次の行と連結(改行をエスケープ)できます。
今日の最高/最低気温を取得するために「–startday=0」を指定してみましたが、値は無効かもしれません。