Notices


Reply
Thread Tools
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#1
Could someone please help me to get the weatherwidget.sh script to show on qtlockscreen the info about the weather.
I try to use this script
#!/bin/sh
#Arguments:
# 1 = Link to yahoo weather
# 2 = output dir

url=${1-"http://de.weather.yahoo.com/germany/berlin/berlin-638242/?unit=c"}
out=${2-"/tmp"}

# Getting all the necessary info.
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.htm" "$url"
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.png" `grep 'forecast-icon.*http.*png' $out/ywtemp.htm | grep -o http*[a-zA-Z0-9\\.\\-\\\\_/\\:]*.png | grep -m 1 http` | echo "Current: `grep 'forecast-icon.*http.*png' $out/ywtemp.htm | grep -o yw-temp..[-0-9]\\* | grep -o temp..[-0-9]* | grep -o [-0-9][-0-9]*`" || { exit 1; }
echo "Conditions: `grep 'forecast-icon.*http.*png' $out/ywtemp.htm | grep -o 'yw-cond..[a-zA-Z ]*' | grep -o \[A-Z].*`" || { exit 1; }
echo `grep 'forecast-icon.*http.*png' $out/ywtemp.htm | grep -o High[:].[-0-9][-0-9]*` || { exit 1; }
echo `grep 'forecast-icon.*http.*png' $out/ywtemp.htm | grep -o Low[:].[-0-9][-0-9]*`|| { exit 1; }
echo "Image: $out/ywtemp.png"
Do i put this script into the folder for the pictures or should it stay in /opt/qtlockscreen ? How do I call the script inside the config for a working theme? As a widget? Do i have to reserve some space for it as well?
Please elaborate as much as possible, because sometimes I act as if I have this awesome N900 for the first day
 
Banned | Posts: 695 | Thanked: 308 times | Joined on Apr 2011 @ originally pakistan ,now in china
#2
http://de.weather.yahoo.com/germany/...638242/?unit=c

only this line has to be edited .for your current location ,thats it .nothing more ,nothing less .
 
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#3
This is what i did change, and the page would load fine in a browser, no error here.

But how do i actually get the script to work with qtlockscreen and how does qtlockscreen call the script from the config file?
 
sakya's Avatar
Posts: 533 | Thanked: 1,341 times | Joined on Dec 2010 @ Italy
#4
There is absolutely no need to change or move the script.
The link used by the widget in qtlockscreen is in the configuration file (that's what configuration file are for: configuration).
This is the widget from the default config:
Code:
[YahooWeather]
MinimumSecondsBetweenUpdates=1200
AutoUpdateIntervalSeconds=10800
Link="italy/lombardy/milan-718345"
Unit="c"
#ConditionsText=""
#ConditionsPos="20;120"
#ConditionsFont=";14;normal;0"
#ConditionsColor="255;255;255;255"
CurrentText=""
CurrentPos="170;60"
CurrentFont=";40;normal;0"
CurrentColor="255;255;255;255"
HighText="High:"
HighPos="170;100"
HighFont=";14;normal;0"
HighColor="255;255;255;255"
LowText="Low:"
LowPos="170;120"
LowFont=";14;normal;0"
LowColor="255;255;255;255"
SizeL="250;180"
SizeP="250;180"
PosL="500;90"
PosP="center;550"
 

The Following 2 Users Say Thank You to sakya For This Useful Post:
Minhaz's Avatar
Posts: 117 | Thanked: 76 times | Joined on Aug 2010 @ Samnan,Sharjah,U.A.E.
#5
Originally Posted by sakya View Post
There is absolutely no need to change or move the script.
The link used by the widget in qtlockscreen is in the configuration file (that's what configuration file are for: configuration).
This is the widget from the default config:
Code:
[YahooWeather]
MinimumSecondsBetweenUpdates=1200
AutoUpdateIntervalSeconds=10800
Link="italy/lombardy/milan-718345"
Unit="c"
#ConditionsText=""
#ConditionsPos="20;120"
#ConditionsFont=";14;normal;0"
#ConditionsColor="255;255;255;255"
CurrentText=""
CurrentPos="170;60"
CurrentFont=";40;normal;0"
CurrentColor="255;255;255;255"
HighText="High:"
HighPos="170;100"
HighFont=";14;normal;0"
HighColor="255;255;255;255"
LowText="Low:"
LowPos="170;120"
LowFont=";14;normal;0"
LowColor="255;255;255;255"
SizeL="250;180"
SizeP="250;180"
PosL="500;90"
PosP="center;550"
sakya do i hav to change anything to show weather for my current location? or will it detect automatically?
 
sakya's Avatar
Posts: 533 | Thanked: 1,341 times | Joined on Dec 2010 @ Italy
#6
The location/unit used is this:
Code:
Link="italy/lombardy/milan-718345"
Unit="c"
 

The Following 2 Users Say Thank You to sakya For This Useful Post:
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#7
Thanks a lot, my fault was to edit weatherwidget.sh itself, while i had only to change the link in the theme's config.
Now i am a happy bunny
 

The Following User Says Thank You to michaaa62 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:34.