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!
"acpi -b" or "cat /proc/acpi/battery/BAT0/state"
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:~$
Like I said, you need to compile your kernel with acpi.
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? :)
Look around on google... it's a pretty long process.
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.
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...
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?
....
That's rebuilding the kernel. You download the source and unpack it. That's the folder you do it it..
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.
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: 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.
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.
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
Quote from: iago 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
Totally off-topic and I don't wanna drag this away from the original point, but yes, we know; the average user doesn't know how to read that and just wants "%" left. I wager Joe is/was one of those people.
Quote from: iago 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
I'm well aware that there are front ends.
No, the difference is I had to go through this trouble to be able to see it in Linux.
Quote from: Sidoh on January 11, 2007, 01:34:17 AM
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.
It felt that way with FreeBSD until I discovered freshports.org ... this is a very easy-to-use website that searches the ports system for you (There is a make search but not nearly as nice). While it shows the port's description and so forth, it also shows you vulnerabilities or breakages (if any) and the maintenance history. A site like this beats google since it is tailored specifically for applications that are ported and known to work on FreeBSD, their problems, and maintenance history. Maybe there is site like this for Slackware or Linux in a broader sense? I know Gentoo has such a directory for its portage.
Misc sites:
http://www.freshports.org/ (nice web interface to ports)
http://www.freebsd.org/ports/ (web interface to ports)
http://pointyhat.freebsd.org/ (ports compilation/testing cluster)
That's great (really, it is). However, it's the fact that I have to go through this sort of trouble just to check the battery status. It's not just this. There are tons of trivial little things like this that add up frustration. I like Linux (I know you don't, but I can't say anything about FreeBSD because I've never used it). I've had it on my server for a number of years and have absolutely no plan to change that.
I can usually work myself through a given problem with linuxquestions, google and a few other references (like iago and Newby, but I usually consult them as a last resort. being bothered constantly would be annoying, right, guys? :P). I know that I'd get used to it and that I'd eventually come to ignore things like this, but until I see a significant advantage to using something other than windows on my workstation, I'm going to continue to do so. I'm not trying to turn this into a debate and I'm not trying to be defensive; I'm just trying to convey my point.
I'm just saying I'd rather use Windows on my workstation (this includes my laptops) and have things "just work" without going through this sort of trouble.
Quote from: Sidoh on January 11, 2007, 03:55:19 PM
That's great (really, it is). However, it's the fact that I have to go through this sort of trouble just to check the battery status. It's not just this. There are tons of trivial little things like this that add up frustration. I like Linux (I know you don't, but I can't say anything about FreeBSD because I've never used it). I've had it on my server for a number of years and have absolutely no plan to change that.
I can usually work myself through a given problem with linuxquestions, google and a few other references (like iago and Newby, but I usually consult them as a last resort. being bothered constantly would be annoying, right, guys? :P). I know that I'd get used to it and that I'd eventually come to ignore things like this, but until I see a significant advantage to using something other than windows on my workstation, I'm going to continue to do so. I'm not trying to turn this into a debate and I'm not trying to be defensive; I'm just trying to convey my point.
I'm just saying I'd rather use Windows on my workstation (this includes my laptops) and have things "just work" without going through this sort of trouble.
Yeah, I dislike certain aspects of Linux, but it has its advantages. I'm not sure what kind of trouble it is to check the battery or enable battery checking in Linux, but I tend to use wmbatteries to monitor my battery. KDE offers a KLaptop Daemon, and I am sure Gnome has one too.
As to FreeBSD, if you have ACPI, the battery life can be queried through sysctl and the battery information can be queried through acpiconf. APM has an apmconf command ... but I rarely have to do this checking from the command line. ACPI is enabled on FreeBSD out of the box on systems that support it ... I imagine this is true on Linux too.
To those interested/curious:
Here's an example of checking battery life in FreeBSD with ACPI.
Quote
%sysctl hw.acpi
hw.acpi.supported_sleep_state: S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S3
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: S1
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 3
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.reset_video: 1
hw.acpi.cpu.cx_supported: C1/1 C2/1 C3/85
hw.acpi.cpu.cx_lowest: C1
hw.acpi.cpu.cx_usage: 100.00% 0.00% 0.00%
hw.acpi.thermal.min_runtime: 0
hw.acpi.thermal.polling_rate: 10
hw.acpi.thermal.tz0.temperature: 50.0C
hw.acpi.thermal.tz0.active: -1
hw.acpi.thermal.tz0.passive_cooling: 1
hw.acpi.thermal.tz0.thermal_flags: 0
hw.acpi.thermal.tz0._PSV: 94.5C
hw.acpi.thermal.tz0._HOT: -1
hw.acpi.thermal.tz0._CRT: 99.0C
hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.battery.life: 100
hw.acpi.battery.time: -1
hw.acpi.battery.state: 0
hw.acpi.battery.units: 1
hw.acpi.battery.info_expire: 5
hw.acpi.acline: 1
Some of these values can be set while others are read-only for obvious reasons.
Here's an example to acquire battery information in FreeBSD.
Quote
%acpiconf -i 0
Design capacity: 77760 mWh
Last full capacity: 54560 mWh
Technology: secondary (rechargeable)
Design voltage: 10800 mV
Capacity (warn): 2728 mWh
Capacity (low): 200 mWh
Low/warn granularity: 1 mWh
Warn/full granularity: 1 mWh
Model number: IBM-92P1077
Serial number: 685
Type: LION
OEM info: SANYO
State: high
Remaining capacity: 100%
Remaining time: unknown
Present rate: 0 mW
Voltage: 12452 mV
Misc links:
(http://www.dockapps.org/files/216/374/wmbatteries.gif) (http://www.dockapps.org/file.php/id/216)
I type "apm."
Incidentally, if you install one of those commercial distros (Red Hat, Suse, Fedora, etc) on a laptop, you'll generally get a battery status automatically in KDE or Gnome.
If you want your hand held (or at least, if you don't want to have to learn how things work), then don't use a distro like Slackware or Gentoo, and don't use FreeBSD -- they expect you to look after yourself a lot more.
Quote from: iago on January 11, 2007, 08:23:48 PM
Incidentally, if you install one of those commercial distros (Red Hat, Suse, Fedora, etc) on a laptop, you'll generally get a battery status automatically in KDE or Gnome.
If you want your hand held (or at least, if you don't want to have to learn how things work), then don't use a distro like Slackware or Gentoo, and don't use FreeBSD -- they expect you to look after yourself a lot more.
I'm aware of that. Like I said, this was a simple (probably bad) example. :P