News:

How did you even find this place?

Main Menu

Checking battery status?

Started by Joe, January 07, 2007, 09:26:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe

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!
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


rabbit

"acpi -b" or "cat /proc/acpi/battery/BAT0/state"

Joe

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:~$
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Like I said, you need to compile your kernel with acpi.

Joe

Quote from: Sidoh on January 07, 2007, 10:30:29 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? :)
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Look around on google... it's a pretty long process.

Ergot

Quote from: Sidoh on January 07, 2007, 11:03:06 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.
Quote from: Newby on February 26, 2006, 12:16:58 AM
Who gives a damn? I fuck sheep all the time.
Quote from: rabbit on December 11, 2005, 01:05:35 PM
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

Sidoh

#7
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...

Joe

Quote from: Ergot on January 08, 2007, 02:09:42 AM
Quote from: Sidoh on January 07, 2007, 11:03:06 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?
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


rabbit

....

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

iago

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.

Joe

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.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Newby

Quote from: Joex86] link=topic=8368.msg105802#msg105802 date=1168491714]
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

Quote from: Rule on June 30, 2008, 01:13:20 PM
Quote from: CrAz3D on June 30, 2008, 10:38:22 AM
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. 

Sidoh

Quote from: Newby on January 11, 2007, 01:23:08 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.

iago

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