GNOME Bugzilla – Bug 617406
Key command to speak and braille battery status in Orca
Last modified: 2020-11-30 15:31:46 UTC
Accessing battery status is something that Orca users expect to do quickly. Going to the pannel, finding the correct icon and reading its tooltip is a time consumming task. I Propose the orca+b combination to inform in speech and braille this information. Note that retrieving battery status in a platform neutral is not trivial, Using upower API like gnome-power-manager does seems the best option. Upower API: http://upower.freedesktop.org/docs/ This RFE was separate from date/time reading described in bug #611576. Comments there regarding battery status are still useful.
Rui, unfortunately Orca+b key combination is default key binding to jump next bookmark. I will be look upover api documentation with you linked and try search python examples how can possible apply this API. Attila
Rui, not good if we process for example the /proc/acpi/battery/BAT0 files, for example state and info files? For example because now not attached the battery my notebook, state file showing following information: present: no Linux systems I think acpi support is default enabled. If you use a notebook with attached the battery, what informations shows you the state and info files? I don't no Open Solaris use acpi or not, if not, this is not good ydea with I suggest. Attila Attila
Possible /proc/acpi/battery/BATT0/info and state files processing is not good ydea. When my battery is attached, I see for example following informations when my notebook battery is full charged, but the charger is not detached: present: yes capacity state: ok charging state: charged present rate: 0 mA remaining capacity: 3683 mAh present voltage: 23644 mV When I turn off the charger, this informations is following changed in /proc/acpi/battery/BATT0/state file: present: yes capacity state: ok charging state: discharging present rate: 854 mA remaining capacity: 3609 mAh present voltage: 23644 mV I don't no how can possible calculate the remaining time values and percentage this value. Attila
Rui, if you have a little time please look the acpi source package the acpi.c file. Between 242. and 400. line have importanter part to calculate remaining battery capacity values (charging status, hour, minute, second and percentage). Acpi process /proc/acpi/battery/Batt0 or BATT1 subdirectory awailable files. I not want copy the code part with this lines, because this is longer code with a comment. I asked now Orca list Opensolaris is using default acpi support or not, if the answer is not, this acpi related ydea is dead, and not need working this acpi based processing. Now, I begin reading you linked documentation.
Rui, I found a very little application with monitoring battery capacity, developed with Python and proposal with startup point. This application is using Dbus/HAL. The application is pyGTK based, but the starting point is very good. The download link is following: http://batterymon.googlecode.com/files/batterymon-1.2.0.tar.gz When I run batterymon.py file, the battery indicator is correct present my top panel, and right presents the state changes. This is the right way (Dbus/HAL). If I have enough time, I analyze the batterymon.py code, we not need all parts, only state request parts. What your openion this code? Attila
(3.0 Planning Spam-o-rama. Sorry!)
(In reply to comment #5) > Rui, I found a very little application with monitoring battery capacity, > developed with Python and proposal with startup point. This application is > using Dbus/HAL. The application is pyGTK based, but the starting point is very > good. > The download link is following: > http://batterymon.googlecode.com/files/batterymon-1.2.0.tar.gz > > When I run batterymon.py file, the battery indicator is correct present my top > panel, and right presents the state changes. This is the right way (Dbus/HAL). > If I have enough time, I analyze the batterymon.py code, we not need all parts, > only state request parts. > > What your openion this code? > > Attila Hi, It is a good starting point for sure. Note that hal is beeing deprecated so upower is our best choice in my opion. Now that I have time (finally) I'll take a look on this. Regards, Rui Batista
Ok, I'm already working on this. Made some tests using upower dbus api and everything seems to work as expected. Some questions 1. What information to present? My guess is percentage, time remaining and status (charging/recharging/full/...). 2. What key combination to assign if one? 3. Make dbus synchrnous or assynchronous calls? Don't know if blocking orca waiting for a dbus reply is that bad or note. Assync calls are more complex but doable. Regards, Rui Batista
Created attachment 165836 [details] [review] First try to implement this feature using UPower. Assigned to orca+ctrl+b to easy testing, for now Here it is. I'm just reporting percentage and state (charging discharging etc.). Please test. I supose it just works with GNOME 2.30 and above (Ubuntu lucid for instance). There is the old devicekit-power API and hal but I think coding for all those can be a mess.... What do you think?
Rui, I looked your attachment. The first patch is fantastic, I have got some suggestion, this is example outputs my orca-customizations.py cases with using now acpi: You wroted: "1. What information to present? My guess is percentage, time remaining and status (charging/recharging/full/...)." If the status is "discharging", need present the remaining time and percentage, not need present the discharging status, for example: 1 hour, 44 minute remaining (92%) I don't no, how can present this output format the remaining time if any value is < 10, for example, if the remaining time capacity is 0:59 minute, I would like see only 59 minute remaining, not 0 hour 59 minute type output. If the remaining time is 0 hour 9 minute, I would like see 9 minute remaining type output, not 0 hour 09 minute remaining type output. This is possible to do, or impossible and not localizable? 2. If the batteri is charging, need present the charging percentage and status, for example: 92 percent are available (connected, charging). 3. If the battery is full charged, but the charger is not detached: full charged (100%) You wroted: "2. What key combination to assign if one?" Orca+a keycombination is not good? Not assigned this keycombination with any application based Orca command? Now I not remember. If we not have another choice, your defined shortcut key is good, because this is absolute sure not use any application based Orca command. I tested your attachment with Ubuntu Lucid, Orca git master version and GNOME 2.30. Works very well. I found only one problem with following translation marked message, not entire translated following message: #: ../src/orca/battery.py:96 #, python-format msgid "%d percent remaing, %s" msgstr "%d% van hátra (%s)." The wrong partialy translated output is following for example if the battery is charging: 98 percent remaing, töltődik. So, only the %s part are translated, I don't no why.
Comment on attachment 165836 [details] [review] First try to implement this feature using UPower. Assigned to orca+ctrl+b to easy testing, for now Thanks for doing this Rui. You know, this might make another excellent candidate for a plugin in the New World Order. (Along with the date and time functionality.)
Marking this as ASSIGNED since I'm now actively working on the libpeas support.