maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   How do i get weatherwidget.sh to work in qtlockscreen (https://talk.maemo.org/showthread.php?t=77478)

michaaa62 2011-09-23 06:32

How do i get weatherwidget.sh to work in qtlockscreen
 
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
Quote:

#!/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:rolleyes:

prankster 2011-09-23 06:40

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
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 .

michaaa62 2011-09-23 06:59

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
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 2011-09-23 07:36

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
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"


Minhaz 2011-09-23 07:49

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
Quote:

Originally Posted by sakya (Post 1094341)
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 2011-09-23 07:54

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
The location/unit used is this:
Code:

Link="italy/lombardy/milan-718345"
Unit="c"


michaaa62 2011-09-23 09:44

Re: How do i get weatherwidget.sh to work in qtlockscreen
 
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:D


All times are GMT. The time now is 03:22.

vBulletin® Version 3.8.8