Spectrwm baraction.sh example for acpi battery...convert to non-acpi?

https://wiki.archlinux.org/index.php/Sp … sh_scripts
I've copied the baraction.sh script there, and it has a pretty beefy section at the beginning to pull battery info from acpi...I apparently don't have acpi battery on my laptop...but I can query the battery with cat /sys/class/power_supply/BAT0/energy_now
there's other things to query such as energy_full, power_now, power/, status, and a bunch of other stuff.
My problem is...state and info which is queried by the script above is not available to query by my battery.  I was wondering if someone familiar with shell scripting could work me up a quick battery status script?

I've made something similar, but nowhere near as complex.
#!/bin/bash
while true; do
cat /proc/acpi/battery/BAT0/state && sleep 1
clear
done
For everything else, there's 'acpi -V'.
Edit: This is what happens when I run your script:
$ ./battery "%S: %t at %r, health: %h"
Traceback (most recent call last):
File "./battery", line 62, in <module>
alarm = extractValue(line)
File "./battery", line 23, in extractValue
return int(battery_line.split(':')[1].strip().split(' ')[0].strip())
ValueError: invalid literal for int() with base 10: 'unsupported'
Last edited by Krause (2010-01-31 00:06:20)

Similar Messages

  • Examples for converting multiple form output to single pdf

    Hi all ,
         I need sample code or examples for converting multiple smart form outputs (more than 1)  to single pdf. Can someone provide that? Reply  ASAP 
    Thanks & Regards,
    Pavan.

    Hi,
    check this:
    [How to merge multiple spools into single PDF file?;
    [Merge multiple PDF Files;
    [https://www.sdn.sap.com/irj/scn/advancedsearch?query=multipleformoutputtosinglepdf++]
    hope u'll get some idea.
    Regards,
    Sneha.

  • ABAP program for BAPI and convert DB into XML

    ABAP program for BAPI and convert DB into XML
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Refer the link -
    give an example of bapi coding?
    how can we transfer huge amount of data from database server to xml format
    Regards,
    Amit
    Reward all helpful replies.

  • Provide simple example for Arbitrary data sending through NI4551(DSA)

    We Converted NI-DSA function palette
    in LabVIEW under Application
    Examples>>Advanced>>Arbitrary Output Example.
    But, We not exactly getting arbitrary wave. Our arbitrary data is correct. I think there is a problem with FFT settings. So Please Provide simple example for Arbitrary data sending through NI4551(DSA)

    Hello Sateesh!
    First, what versions of LabVIEW and NI-DSA are you using.  I have been searching around for the example you are refering too and I am not able to find it.  Are you creating and arb. wave in the frequency domain and then performing an FFT to get it to the time domain?  Next, remember your wave will only be as exact as the AO specs. of the hardware...
    The output conversions occur simultaneously at software-programmable rates from 1.25 to 51.2 kS/s in increments of 47.684 µS/s. The analog output circuitry uses eight-times oversampling interpolators with 64-times oversampling delta-sigma modulators to generate high-quality signals. Software-programmable attenuation of 0, -20, or -40 dB is available on the output channels. The PCI-4451 has excellent amplitude flatness of ±0.2 dB within DC to 23 kHz, and a THD of -90 dB at 1 kHz.
    Now, as far as obtaining other examples If you use the LabVIEW example finder and goto Hardware Input and Output>>Traditional DAQ>>Analog Output.  I would also in the lower right hand corner of the Example Finder select your 4451 this will show you all examples that work with your hardware.  I hope this helps a little but please give me more details we will go from there.   Have a great day!
    Allan S.
    National Instruments

  • C100 with Blackmagic Battery Converter HDMI to SDI

    The Blackmagic box will not recognize the HDMI signal out of my Canon C100. It will recognize the signal out of both a Sony handicam and the output of a Dell laptop computer. We tested an AJA HDMI to SDI converter with the Canon C100 and it worked fine, so it is not the output of the camera or the HDMI cable itself. Has anyone had the same issue? Any advice? Thanks!

    I had this same problem recently. Just go to the black magic website and download the latest firmware for the blackmagic battery converter. Follow the instructions on how to update the converter. With the firmware update, everything  works perfectly! I use it reliably on a Steadicam setup.

  • Example for Using WDR_SELECT_OPTIONS and SALV_WD_TABLE in one View

    Hello,
    I need an Example for Using the WD-Components WDR_SELECT_OPTIONS and SALV_WD_TABLE
    in one view. Can anybody help me?
    Thanks
    Toto

    Hello,
    Please see these:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/21706b4b-0901-0010-7d93-c93b6394bc1d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637]
    [/people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application]
    [/people/thomas.jung3/blog/2005/12/21/webdynpro-abap-alv]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
    Regards.

  • Is it possible for automator to convert all word documents in my dropbox folder to apple's "pages" on iCloud and keep the same folder organization?

    Is it possible for automator to convert all word documents in my dropbox folder to apple's "pages" on iCloud and keep the same folder organization?  I am a teacher and want to switch from using microsoft office on my macbook pro to using pages/number/keynote.  I am hoping to get an iPad next year and go "paperless" with lesson plans and gradebooks and I heard that pages/numbers/keynote are great on the ipad.  I'd like to write an automator script (workflow?) to convert all my documents in dropbox to pages and have them stored on iCloud, then be able to access the files on my macbook pro and ipad.  Thanks!

    Create an AppleID under different email addresses for each family member at http://appleid.apple.com
    If they don't already have their own email address just setup a free one with Gmail, Yahoo, Hotmail or whoever you prefer.
    Then on each device sign into iMessage with the users own AppleID in:
    Settings > Messages > Send &amp; Receive > Tap AppleID at top > Sign Out, then sign back in again with the correct AppleID.

  • Any hope for my battery?

    Hi
    My 15" MBP's battery charge time has been reducing gradually over the last few months. iStat Pro gives my 15" battery a 'Health' of 47% (195 cycles) - and in Energy Saver in System Preferences, there's a yellow warning triangle and it says "Service Battery"
    Before I go out and buy a new battery, I just thought I'd check a few things.
    • Can the battery be serviced? Or should I trash it and replace?
    • Don't suppose it's replaceable under AppleCare?
    • What should I be doing to optimise battery life in the future? I've not been calibrating, so  that's one thing I can start doing. Anything else?
    Thanks
    Marcus

    You don't mention what model MBP you nor when you bought it. The battery cannot be serviced. You need a new battery. Check with AppleCare to see if they will replace it under warranty considering the low number of cycles. For new battery follow Apple's guide lines for proper operation and maintenance.
    http://support.apple.com/kb/HT1490

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • I have an iPod Nano that is synced to my mac, but it is sent in for the battery issue. Anyway, I have bought a 2nd gerneration Ipod touch and I want to now sync it to my mac, but it does not show up in the left menu bar. Please help. Thanks All!

    I have an iPod Nano that is synced to my mac, but it is sent in for the battery issue. Anyway, I have bought a 2nd gerneration Ipod touch and I want to now sync it to my mac, but it does not show up in the left menu bar. Please help. Thanks All!

    http://support.apple.com/kb/TS1591
    There have been some problems accessing pages on the Apple web site.  If the hyperlink gives you a "We're sorry" message, try again.

  • I was wondering why the iPhone 5 has the option for a battery percentage and the iPod touch 5g doesn't? I mean... they are almost both the same thing... just the iPod does not have the phone.

    I was wondering why the iPhone 5 has the option for a battery percentage and the iPod touch 5g doesn't? I mean... they are almost both the same thing... just the iPod does not have the phone.

    One likely reason is the % battery is not that accurate because of the smaller battery capacity in the iPod compared to iPhone and iPad. Users why use a % battery app post that the % reading changes a lot.

  • What is Apple's official plan for future battery replacement in the Macbook Pro with Retina Display?

    What is Apple's official plan for future battery replacement in the Macbook Pro with Retina display?

    No one here works for Apple nor does Apple visit this message board.  We are all end users like yourself helping each other out. 
    "Official" Apple "replacement" announcements will be listed on their website and possibly on their Knowledge Base website.
    Check the All Programs website too.

  • Example for 4 or 3 level Hierarchail Seq ALV report?

    i need the example for 4 or 3 level heirarchial sequential ALV report. ?

    Hi,
    Hierarchail Seq ALV may not support 3rd 4th levels.For this type of requirement you may go to tree report.
    Refer the below links for tree report.
    [http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm|http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm]
    DWDM -  transaction for sample/demo programs for controls
    sample Program
    BCALV_TREE_01                  ALV Tree Control: Build Up the Hierarchy Tree
    BCALV_TREE_02                  ALV Tree Control: Event Handling
    BCALV_TREE_03                  ALV Tree Control: Use an Own Context Menu
    BCALV_TREE_04                  ALV Tree Control: Add a Button to the Toolbar
    BCALV_TREE_05                  ALV Tree Control: Add a Menu to the Toolbar
    BCALV_TREE_06                  ALV tree control: Icon column and icon for nodes/items
    BCALV_TREE_DEMO                Demo for ALV tree control
    BCALV_TREE_DND                 ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_DND_MULTIPLE        ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_EVENT_RECEIVER      Include BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT          ALV Tree: Change Item Layouts at Runtime
    BCALV_TREE_MOVE_NODE_TEST      Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO         Program BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY              Verifier for ALV Tree and Simple ALV Tree
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Studio.
    http://www.4shared.com/file/128256802/f20abc7a/PAPI-WS_for_Oracle_BPM_Studio.html
    Be sure to use the project that is in the zip file for this example.
    If you need an example of how to use PAPI-WS on Oracle BPM Enterprise, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Hi,
    Is there any sample code showing PAPI-WS with VS 2008? AFAIK, there is a sample using VS 2005 and WSE 3.0, but I'm interested in using VS 2008/WCF.
    Regards,

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Enterprise Standalone.
    http://www.4shared.com/file/128249957/9bd6ef61/PAPI-WS_for_Oracle_BPM_Standalone.html
    Be sure to use the project that is in the zip file for this example.
    To see how to invoke PAPI-WS when using Oracle BPM Studio, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Dan,
    I tried in both studio and Standalone.
    From Studio :*
    1. The Url for the Webservice is (http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl). From studio by default port number was 8585.From this studio wsdl URL(http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl),I did n't see any wsdl text in the browser.
    From Standalone :*
    1. In BPM Admin Center, I have selected *"PAPI Web Services"* check box(Page 5 of your document).
    2. In The BPM Admin Center, I have clicked on *"Start BPM Web Applications"*.
    3. After Stand alone server started *"Launch PAPI WebServices Console"* link was enabled,And I clicked on that link.It opened a browser with URL (http://localhost:8686/papiws/PapiWebService)
    Oracle® BPM PAPI Web Services
    Service Name 'PapiWebService'
    Style: Document Literal Wrapped
    SSO Enabled: false
    WS-Security UsernameToken Profile Authentication Enabled: false
    HTTP Basic Authentication Enabled: true
    Preset Authentication Enabled: false
    MTOM Optimization for attachments Enabled*: false
    Endpoint: http://localhost:8686/papiws/PapiWebServiceEndpoint
    WSDL: http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl
    I have copied wsdl URL(http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl) and pasted it into a browser's URL field.I did n't see any wsdl text in the browser,but I see following error
    HTTP Status 404 - Servlet PapiWebServiceServlet is not available
    type Status report
    message Servlet PapiWebServiceServlet is not available
    description The requested resource (Servlet PapiWebServiceServlet is not available) is not available.
    Apache Tomcat/5.5.15
    Edited by: Prabhasankar on Dec 24, 2010 9:10 AM

Maybe you are looking for