Notices


Reply
Thread Tools
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#791
Originally Posted by gidzzz View Post
"[classify desktop]" was the first place where I tried to put it and initially it seemed to work, but half an hour later I was saddened to find out that the freezing was back. Then I decided to try with "system" partition, of which "sysutils" looked like the most suitable category and QtLockscreen held up smooth for well over a day, interrupted by a reboot due to curiosity caused by your post (I'm *almost* certain that I checked for typos after such traumatic disappointment ).
Hmm, interesting. For me, after I made that post, I have yet to notice the same freezing 'return' - there is still a barely noticeable delay in the time update (only easy to notice when like 15 minutes have passed, so that the numbers are significantly different), but it's way less than a second, and I'm not even sure if it's the freezing or just the DateTime widget (either way, I have yet to manage to touch the lock slider on the lockscreen, after pressing the power key, and have it not respond/move - and believe me I've tried to hold one finger right where the lock slider is, and moving it immediately after pressing the power key), where-as on an N900 that doesn't have qtlockscreen entered anywhere in that file, the 'freeze' is ~3 seconds, and the lock slider is indeed non-responsive (I have the fortune of having multiple N900s to compare things on at the same time, thanks to having the misfortune of having two, so far, succumb to the "telephony functions disabled" error).

But you might still be right - it's possible, for instance, the N900 swaps out desktop-classified programs after some long period of inactivity, or something, but doesn't touch the sysutils-classified ones, or something like that. I'm going to report back if/when I see the QtLockscreen start freezing again. (I concede it's possible I don't notice because my QtLockscreen config is fairly simple - no music player/album art/weather/etc.
 

The Following User Says Thank You to Mentalist Traceur For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#792
Have yet to have freezing return on my device so far that I've noticed, QtLockscreen still being inside the desktop section.
 

The Following User Says Thank You to Mentalist Traceur For This Useful Post:
Posts: 336 | Thanked: 129 times | Joined on Jan 2011 @ portugal
#793
nice guys..sounds like a new update will be here soon..i am excited
 
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#794
qtlockscreen has been great for use with the N900 docked in the car using FM carkit.

Its drawback is that it's driving Espeak Time crazy, & the espeak man announces the time when unlocking, sometimes a couple of times, & sometimes randomly.

Can either qtlockscreen or espeak time be tweaked to calm him down?
 
Posts: 188 | Thanked: 308 times | Joined on Jan 2013 @ UK
#795
I've written a new weatherwidget.sh to get the information form the UKMO mobile site (I think it just covers the UK). I'll post it up here when I get it all working, but I have two issues.

The first is that the icon is very small, but it's workable for me at the moment - though it may be worth eventually looking into it.

The second is that I'm not getting the Conditions being displayed.
Here is an example of my output:

Code:
Current: -3
Conditions: Light Snow
High: -2
Low: -3
Image: /tmp/ywtemp.png
Anyone spot the obvious thing I must be missing?
 
Posts: 188 | Thanked: 308 times | Joined on Jan 2013 @ UK
#796
Originally Posted by skanky View Post
I've written a new weatherwidget.sh to get the information form the UKMO mobile site (I think it just covers the UK). I'll post it up here when I get it all working, but I have two issues.

The first is that the icon is very small, but it's workable for me at the moment - though it may be worth eventually looking into it.

The second is that I'm not getting the Conditions being displayed.
Here is an example of my output:

Code:
Current: -3
Conditions: Light Snow
High: -2
Low: -3
Image: /tmp/ywtemp.png
Anyone spot the obvious thing I must be missing?
Okay, I'm an idiot, I didn't unquote the Conditions settings in the ini file.

So though this still needs work, here's the UKMO version of the script:

Code:
#!/bin/sh
#Arguments:
# 1 = Place id - from ukmo website
# 2 = output dir

url="http://www.metoffice.gov.uk/mobile/"

# Your default location here, take it from the Met Office mobile
# website.
id=${2-"XXXXXX"}
out=${3-"/tmp"}


post="forecastid=$id"

# Get info for day
wget --user-agent=""  -q -t 1 -T 10 --post-data="$post" -O "$out/ywtemp.htm" "${url}5dayforecastdetail" || { exit 1; }

curday=`date "+%a %d %b %y"`

eval `awk '
                BEGIN       { use = 0 }
                /.h2.'"$curday"'..h2./ { use = 1 }
                use == 1 && /weathervalues/ { sub("^.*>Temperature: ",""); 
                                               sub("&nbsp.*\\\(", " "); 
                                               sub("&nbsp.*$", ""); 
                                               high=$1; low=$2; exit }
                END        { printf("high=\"%s\" low=\"%s\"", high, low)}' "$out/ywtemp.htm"
`

# Get info specific to time of day
curtime=`date +%H`00
if [ $curtime -lt 1200 ]; then
        curtime=0900
elif [ $curtime -ge 1200 ] && [ $curtime -lt 1500 ]; then
        curtime=1200
elif [ $curtime -ge 1500 ] && [ $curtime -lt 1800 ]; then
        curtime=1500
elif [ $curtime -ge 1800 ] && [ $curtime -lt 2100 ]; then
        curtime=1800
elif [ $curtime -gt 2100 ]; then
        curtime=2100
fi

curday=`date "+%a %d %b %y" | sed 's/ /%20/g'`

post="forecastid=$id&detail=$curday"

wget --user-agent=""  -q -t 1 -T 10 --post-data="$post" -O "$out/ywtemp.htm" "${url}5dayforecastdetail" || { exit 1; }

eval `awk '
                BEGIN       { use = 0 }
                /Time: '$curtime'/ { use = 1 }
                use == 1 && /img/ { sub("^.*src=", ""); sub(" alt.*$", ""); img=$0 }
                use == 1 && /weathervalues/ { 
                                        sub("^.*weathervalues\">", "")
                                        sub("&nbsp.*$", "")
                                        sub("<br/>Temperature: ","\" temp=\"") 
                                        wx=$0
                                        exit 
                                 }
                END        { printf("icon=\"%s\" conditions=\"%s\"", img, wx)}' "$out/ywtemp.htm"
`

wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.gif" "${url}${icon}" || { exit 1; }

echo "Current: "$temp
echo "Conditions: "$conditions
echo "High: "$high
echo "Low: "$low
echo "Image: $out/ywtemp.png"
NB I've put it in code tags, but think there may still be some formatting issues.
 

The Following User Says Thank You to skanky For This Useful Post:
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#797
Hi, I'm here to say that maybe I may have fixed the weather widget (for all).

Of couse it will require some little changes and it may have some rough edges but here it is:

Code:
#!/bin/sh
#Arguments:
# 1 = Link to yahoo weather
# 2 = output dir
# 3 = Biggest weather code to consider

url=${1-"weather.yahooapis.com/forecastrss?w=455861&u=c"}
out=${2-"/tmp"}
big=${3-"47"}
let big="$big"+1

# ========sakya's translation========
# In order to work with QtLockscreen I need to, in the WORST case scenario:
# http://weather.yahoo.com/weather.yahooapis.com/forecastrss?w=455861&u=c?unit=c
# 1) Remove the 'http://weather.yahoo.com/'
# 2) Translate the appended '?unit=X' to '&u=X'
url=`echo "$url" | sed s/weather.yahoo.com\\\/// | sed 's/&u=[cf]//' | sed 's/?unit/\&u/'`
# the only problem is that now it requires the ?unit=c to recognize celcius, but for the qtlockscreen it is ok.

code="44d"
curr="0"
cond="Unknown"
high="0"
loww="0"

# Getting all the necessary info.
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.xml" "$url" || { exit 1; }
# Now I have to find out the condition code in order to select the icon to download
code=`cat "$out/ywtemp.xml" | grep -o code=\".* -m 1 | sed s/code=\"// | sed s/\".*//`|| { exit 1; }

# I think that it is safe to translate odd codes to night and even codes to day. It is difficult to get each match on the site, there's nothing anywhere to look into. The weather developer API does not stabilish a correlation.
  if [ "$code" -lt "$big" ] 
  then
    # It is lower than the bigger known good weather code (47?), so, it isn't the unknown code 3200 or any other also unknown. Now the unknown icon are the 44d and 44n that are equal N/A:
    if [ ` expr $code % 2 ` -eq 0 ]
    then
      code="$code""d";
    else
      code="$code""n";
    fi
    curr=`cat "$out/ywtemp.xml" | grep -o temp=\".* -m 1 | sed s/temp=\"// | sed s/\".*//` || { exit 1; }
    cond=`cat "$out/ywtemp.xml" | grep -o text=\".* -m 1 | sed s/text=\"// | sed s/\".*//` || { exit 1; }
    high=`cat "$out/ywtemp.xml" | grep -o high=\".* -m 1 | sed s/high=\"// | sed s/\".*//` || { exit 1; }
    loww=`cat "$out/ywtemp.xml" | grep -o low=\".* -m 1  | sed s/low=\"//  | sed s/\".*//` || { exit 1; }
  else
    code="44d";
  fi

# Getting the icon...
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.png" "l.yimg.com/os/mit/media/m/weather/images/icons/l/$code-100567.png" || { exit 1; }

echo "Current: $curr"
echo "Conditions: $cond"
echo "High: $high"
echo "Low: $loww"
echo "Image: $out/ywtemp.png"
So, how to make it work:

1)Open /opt/qtlockscreen/weatherwidget.sh with the editor of your choice;

2)Delete everything on this file and paste the code above;

3)Go to http://weather.yahoo.com and look for your city.

4)It should return something around the lines of:
weather.yahoo.com/doesnt-matter/doesnt/matter-455861/

5)Take the last numbers of that url and put them in the end of THIS (weather.yahooapis.com/forecastrss?w=) url, like THIS:
weather.yahooapis.com/forecastrss?w=455861

6)Go to your configuration file (of the lockscreen you use) with the weather widget and replace the link there with this new link.

7)I guess it is done.

------------------------
I just did it so it might have bugs, expand them here so I can fix/help. I may update the wiki shortly this week if I get time.

This problem was bugging me too much. Bye!
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.

Last edited by Temporal; 2013-02-16 at 19:40. Reason: Fixed a bug with the last argument intended originally for debug purposes but might be useful. No need to redo anything in case you already did it with the old one.
 

The Following 3 Users Say Thank You to Temporal For This Useful Post:
Posts: 2 | Thanked: 2 times | Joined on May 2014 @ Moscow, Russia
#798
Hi,

I'm still using the awesome device and have come across the qtlockscreen app.

The problem is that I still can't get bloody Yahoo Weather fixed.

1. Seems I've finally got the weatherwidget.sh right:
- Yahoo seems to provide a direct link to the weather icon now, no need for extra code
- the icon is provided in .gif format - I'm simply writing it with a .png extension and it works.
- the weather file is no longer in .htm, it's an .xml - fixed for this.

Here's the code:

Code:
#!/bin/sh
#Arguments:
# 1 = Link to yahoo weather
# 2 = output dir
# 3 = Biggest weather code to consider

url=${1-"weather.yahooapis.com/forecastrss?w=2122265&u=c?unit=c"}
out=${2-"/tmp"}

# ========sakya's translation========
# In order to work with QtLockscreen I need to, in the WORST case scenario:
# http://weather.yahoo.com/weather.yahooapis.com/forecastrss?w=455861&u=c?unit=c
# 1) Remove the 'http://weather.yahoo.com/'
# 2) Translate the appended '?unit=X' to '&u=X'
url=`echo "$url" | sed s/weather.yahoo.com\\\/// | sed 's/&u=[cf]//' | sed 's/?unit/\&u/'`
# the only problem is that now it requires the ?unit=c to recognize celcius, but for the qtlockscreen it is ok.

curr="0"
cond="Unknown"
high="0"
loww="0"

# Getting the XML and extracting the weather icon URL
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.xml" "$url" || { exit 1; }
image=`cat "$out/ywtemp.xml" | grep "img src" | sed s'_<img src="__' | sed s'_"/><br />__'`|| { exit 1; }
#echo "$image"

# Setting weather conditions
curr=`cat "$out/ywtemp.xml" | grep -o temp=\".* -m 1 | sed s/temp=\"// | sed s/\".*//` || { exit 1; }
cond=`cat "$out/ywtemp.xml" | grep -o text=\".* -m 1 | sed s/text=\"// | sed s/\".*//` || { exit 1; }
high=`cat "$out/ywtemp.xml" | grep -o high=\".* -m 1 | sed s/high=\"// | sed s/\".*//` || { exit 1; }
loww=`cat "$out/ywtemp.xml" | grep -o low=\".* -m 1  | sed s/low=\"//  | sed s/\".*//` || { exit 1; }

# Getting the icon...
# The icon has been changed to GIF by Yahoo, writing it with a PNG extension works.
wget --user-agent="" -q -t 1 -T 10 -O "$out/ywtemp.png" "$image" || { exit 1; }

echo "Current: $curr"
echo "Conditions: $cond"
echo "High: $high"
echo "Low: $loww"
echo "Image: $out/ywtemp.png"
2. Weatherwidget.sh executes ok manually with user permissions, puts everything into /tmp correctly, weather conditions are sent to stdout as plain text.

The problems are:
- weatherwidget.sh is not being executed automatically by qtlockscreen (it doesn't get both ywtemp.xml and ywtemp.png into /tmp) - exec perms set (+x for all), owner root.root, network is up
- both the weather icon and weather conditions are NOT displayed on lockscreen, even on the default theme.

I suspect this may have something to do with dependencies towards QBW and alarmed, but the installation of those packages didn't help and I'm not sure I can do more without sakya's help.

BTW, I'm on CSSU-Stable and using qtlockscreen-0.1.27 from devel.
 
Posts: 176 | Thanked: 468 times | Joined on Jan 2010 @ NL
#799
Thanks a lot for this app sakya, installed it last week, works really well!

I was wondering about the possibility of adding two features:
1.) Display Yappari notifications on the lockscreen,
2.) Let the music controls control the Qspot app

I've searched this thread, the Yappari thread, the Qspot thread and the QtLockScreen wiki, and I haven't found anything documented on such functionality. Would it be possible?
__________________
Sony CMD J6 > HTC Canary > HTC Universal > Nokia N82 > Nokia N8 > Nokia N900 > HTC One X > Jolla > Nexus 5 > Nexus 5X > Pixel 2 / PinePhone
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 01:57.