View Single Post
Posts: 112 | Thanked: 105 times | Joined on Mar 2010 @ Montpellier, FRANCE
#333
Hi all

Finally I've made a script for add weather from yahoo on the lockscreen and now i share with you before sakya make a "widget".

@sakya I've started to write lsweather.h lsweather.cpp, but I'm a beginner in c++.

Requires:
- wget for downloading html file and image file
- ImageMagick for making the image, install it via apt-get, or in HAM select categories "All packages (Advanced)" and install it
- Alarmed, for add a cron task for automatic refresh, install it via apt-get

in xterm:
Code:
sudo gainroot
apt-get install alarmed imagemagick wget
Now in attachment extract "weather.sh" in /home/user/WHEREYOUWANT/, but not in MyDocs.

Finally open weather.sh and modify it

1/ Line 42: url of yahooweather for your contry copy an past from your browser
2/ Line 55: unit for the text "°C"
3/ Line 57: 58: string "Max: " and "Min: "
4/ Line 62: Font, size color and position for the text and its stroke
5/ Line 33: Check path for making and storing image file, make sure user can be write in it
Code:
sudo gainroot
chown user:users "/home/user/YourPath"
info: yahooweather use a png file its size is 250x180.
read convert documentation http://imagemagick.org/script/index.php

6/ add in your qtlockscreen.ini
modify xx for matching your number off "widget"
[Main]
....
Widgets\xx\Name="Image.Weather"
Widgets\Size=xx

[Weather]
Image="/home/user/apps/QtLockscreen/Weather.png"
SizeP="250;180"
SizeL="250;180"
PosL="0;0"
PosP="0;0"

Make it executable and run it, in xterm:
Code:
chmod +x /home/user/WHEREYOUWANT/weather.sh
/home/user/WHEREYOUWANT/weather.sh
7/ Open alarmed, add a new event
Title: "Yahhoo Weather for QtLockScreen"
Type: command execution, " /home/user/WHEREYOUWANT/weather.sh"
Cron String for updating every 2 hours: "* */2 * * *"
Click Save Event


That's all, i hope you like it .

Sorry for my English I'm French, in weather.sh, script it's fully documented in french.
Attached Images
  
Attached Files
File Type: zip weather.zip (1.4 KB, 180 views)

Last edited by GaRy delaMEr; 2011-07-28 at 14:08. Reason: More info
 

The Following 8 Users Say Thank You to GaRy delaMEr For This Useful Post: