Re: [orca-list] GNOME Weather applet?



Willie Walker <William Walker Sun COM> writes:

I don't see a way to modify the GNOME Weather applet.  :-(  I needed a
short break from stuff that was spinning my head around, though, so I
took a look at a way for you to add your own keyboard command to speak
the result of calling a command line application.  In this case, I used
'weather', which I grabbed via "sudo apt-get install weather-util" on
Ubuntu.

Here's what I put in my ~/.orca/orca-customizations.py file.

First of all, thanks a lot for this nice example.  This is great
for starting me of with customisations.  Since I primarily use
braille, the actual functionality implemented by this example
is not that useful to me though.  After all, there is already
the details window from GNOME Weather, which just works fine with
orca.  Let me rephrase my question:  Is there
a way to programmatically replace the accessible name
of a certain object on the desktop in Orca?  With this, I could replace
"GNOME Wather" (which is currently displayed in braille and spoken
when I cycle through the panel applets) with some custom
created string.  I could then factor the temperature into
that and therefore fix up the accessibility of the applet, without
having to hack the applet code itself.

Its not really important for me to get exactly the Weather applet
working, I guess I am just trying to learn how to script things
in Orca, and this seems like a sufficiently simple example to start with.

It binds Insert+w to the weather as output by the weather
application.  I see that Concord NH has 16MPH winds with gusts up to
24MPH.  That's going to make the bike races a challenge tonight.

import commands
import orca.input_event
import orca.keybindings
import orca.orca
import orca.speech
from orca.orca_i18n import _

def sayWeather(script, inputEvent=None):
    message = commands.getoutput("weather con | tail -4")
    orca.speech.speak(message)
    return True

sayWeatherHandler = orca.input_event.InputEventHandler(
    sayWeather,
    _("Prints weather information."))

myKeyBindings = orca.keybindings.KeyBindings()

myKeyBindings.add(orca.keybindings.KeyBinding(
    "w",
    1 << orca.settings.MODIFIER_ORCA,
    1 << orca.settings.MODIFIER_ORCA,
    sayWeatherHandler))

orca.settings.keyBindingsMap["default"] = myKeyBindings

Will

On Thu, 2007-05-03 at 13:16 +0200, Mario Lang wrote:
Hi.

When I use the GNOME Weather applet with Orca, I have to invoke
Ctrl+d (Details) on the panel icon to actually be able
to read the weather report.

Is it possible to enhance the GNOME Weather applet such that
it directly displays the temperature, just like the Clock
applet directly displays the time?

-- 
CYa,
  Mario | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang db debian org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]