Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have been studying Ubuntu 12.04 for a while. If everything works fine, I would like to switch to it from Windows 7. I have searched the net on the way to check battery status with Orca but i not yet have an answer. Could someone resolve my problem? Thanks!

share|improve this question
    
This should get you started:upower -i /org/freedesktop/UPower/devices/battery_BAT0 –  Cumulus007 Jul 21 '12 at 1:15
add comment

1 Answer 1

Here is an option. It does not use Orca -- I'm sorry, but I don't know how to use it.

  1. Install the acpitools package. From command line (opened terminal window or ALT-F2), run: sudo apt-get install acpitools

  2. Create a program that will read out the battery status. Edit a text file called "batstat.sh" and save it in your home directory. Here is the file contents:

    #!/bin/sh
    
    spd-say "`acpitool | grep Battery | sed 's/.*[^0-9]\([0-9]\+\)\.[0-9]\+%.*/Remaining battery \1 percent/'`"
    

    (that's two lines, the empty line between them doesn't count)

  3. Make this file an exectuable. Again, from command line

    chmod a+x batstat.sh
    

    Test that the tools is working by running

    ./batstat.sh
    

    from your command line.

  4. Move it to another location.

    sudo mv batstat.sh /usr/local/bin/
    
  5. With an editor, create a file called "Batstat.desktop". The contents should be as follows:

    [Desktop Entry]
    Name=Battery status
    Comment=
    Exec=/usr/local/bin/batstat.sh
    Icon=icon name
    Terminal=false
    Type=Application
    StartupNotify=true
    
  6. Open the folder in which you have saved "Batstat.desktop" in nautilus, drag it to the Unity toolbar.

  7. By clicking on the unity toolbar, you will hear what battery time remains.

If this kind of solution is fine for you, but you need something more complex, just respond, and I will update my answer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.