Author Topic: Checking battery status?  (Read 8871 times)

0 Members and 3 Guests are viewing this topic.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Checking battery status?
« on: January 07, 2007, 09:26:07 pm »
Yeah -- I'm running Slackware.. uh.. 10.1, I think?

joe@religone:~$ uname -a
Linux religone 2.4.31 #6 Sun Jan 5 19:04:47 PDT 2005 i686 unknown unknown GNU/Linux


I'm using a ThinkPad 600, and I was just wondering if theres any easy way to check my battery percentage / status? Thanks!
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Checking battery status?
« Reply #1 on: January 07, 2007, 10:02:06 pm »
"acpi -b" or "cat /proc/acpi/battery/BAT0/state"

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Checking battery status?
« Reply #2 on: January 07, 2007, 10:11:07 pm »
joe@religione:~$ acpi -b
-bash: acpi: command not found
joe@religione:~$ cat /proc/acpi/battery/BAT0/state
cat: /proc/acpi/battery/BAT0/state: No such file or directory
joe@religione:~$
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Checking battery status?
« Reply #3 on: January 07, 2007, 10:30:29 pm »
Like I said, you need to compile your kernel with acpi.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Checking battery status?
« Reply #4 on: January 07, 2007, 10:36:50 pm »
Like I said, you need to compile your kernel with acpi.

God damn do I have a short attention span. :P

How do I do that? :)
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Checking battery status?
« Reply #5 on: January 07, 2007, 11:03:06 pm »
Look around on google... it's a pretty long process.

Offline Ergot

  • 吴立峰 ^_^ !
  • x86
  • Hero Member
  • *****
  • Posts: 3724
  • I steal bandwidth. p_o
    • View Profile
Re: Checking battery status?
« Reply #6 on: January 08, 2007, 02:09:42 am »
Look around on google... it's a pretty long process.
Bull, kernel (re-)compile has gotten stupid easy since 2.6.x.

make menuconfig
Select need stuffs (this is the tricky part)
make
make modules_install
cp arch/i386/boot/bzImage /boot/NAMEGOESHERE

Don't forget to update/run lilo if you're using that.
Who gives a damn? I fuck sheep all the time.
And yes, male both ends.  There are a couple lesbians that need a two-ended dildo...My router just refuses to wear a strap-on.
(05:55:03) JoE ThE oDD: omfg good job i got a boner thinkin bout them chinese bitches
(17:54:15) Sidoh: I love cosmetology

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Checking battery status?
« Reply #7 on: January 08, 2007, 03:25:16 am »
Yeah, but that "tricky" part can take a really long time for someone who doesn't have much experience compiling a kernel.  It took me two days to get a 2.6 kernel working on my laptop, but I think that's largely because it's a new laptop and Linux drivers were somewhat hard to find and they took more configuration and setup than I was familiar with.  I had a really hard time getting ALSA working properly.  In fact, I don't think I ever got it working 100% the way I wanted it to.  I think I posted something about a headphones jack here.

Just because you can compress the process into a vague, step-by-step list doesn't mean that it's always a trivial task...
« Last Edit: January 08, 2007, 11:17:08 pm by Sidoh »

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Checking battery status?
« Reply #8 on: January 08, 2007, 10:56:54 pm »
Look around on google... it's a pretty long process.
Bull, kernel (re-)compile has gotten stupid easy since 2.6.x.

make menuconfig
Select need stuffs (this is the tricky part)
make
make modules_install
cp arch/i386/boot/bzImage /boot/NAMEGOESHERE

Don't forget to update/run lilo if you're using that.

What folder do you do all that in?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Checking battery status?
« Reply #9 on: January 08, 2007, 11:02:40 pm »
....

That's rebuilding the kernel.  You download the source and unpack it.  That's the folder you do it it..

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Checking battery status?
« Reply #10 on: January 09, 2007, 07:46:36 pm »
Before anything, try "modprobe battery" then the "cat" that was posted. 

<edit>
ron@slayer:~$ cat /proc/acpi/battery/C11F/state
cat: /proc/acpi/battery/C11F/state: No such file or directory
ron@slayer:~$ sudo modprobe battery
ron@slayer:~$ cat /proc/acpi/battery/C11F/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            1488 mA
remaining capacity:      4543 mAh
present voltage:         14158 mV

I don't think I have ACPI support compiled in.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Checking battery status?
« Reply #11 on: January 11, 2007, 12:01:54 am »
Ron and I went through and installed Slack's out-of-the-box 2.6 kernel.

cat /proc/acpi/battery/BAT0/state works for me. I don't know what the hell a C11F is.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Checking battery status?
« Reply #12 on: January 11, 2007, 01:23:08 am »
Ron and I went through and installed Slack's out-of-the-box 2.6 kernel.

cat /proc/acpi/battery/BAT0/state works for me. I don't know what the hell a C11F is.

The idea behind a kernel is you customize it to meet the needs of your box. Otherwise your kernel has bloat and un-necessary crap.

And lol, aren't you glad Windows just tells you what percent of your battery is left? FreeBSD's apm does that too.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Checking battery status?
« Reply #13 on: January 11, 2007, 01:34:17 am »
The idea behind a kernel is you customize it to meet the needs of your box. Otherwise your kernel has bloat and un-necessary crap.

And lol, aren't you glad Windows just tells you what percent of your battery is left? FreeBSD's apm does that too.

Yeah, it's things like this that discourage me from using Linux.  As much as I like it, I can never last long using it on my workstation.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Checking battery status?
« Reply #14 on: January 11, 2007, 08:35:16 am »
Uhm, you realize you're reading the battery's signal directly from the kernel, right?  There's front-end programs that "just tells you what percent of your battery is left", but they use the same raw data.  The difference is, on Windows you aren't allowed to see it :P