Hot answers tagged

100

Laptop batteries typically have onboard firmware to control safe charging & discharging of the battery, report battery charge level to the OS, and prevent thermal runaway, which is what will cause an Li-ion battery to explode (or more accurately, catch fire). Most modern ones also contain mechanical failsafes to prevent such fires & explosions. This ...


33

A modern computer contains hundreds of parts that can be turned on and off or clocked faster or slower independently. The granularity is smaller than visible chips, smaller even than cores. A large part of power saving consists on turning parts on and off at the best time. Each part should be turned off when not in use, but only if it's going to remain ...


31

write a script! battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'` if [ $battery_level -le 10 ] then notify-send "Battery low" "Battery level is ${battery_level}%!" fi then cron it to run every few minutes or so. But yeah, if you can do it through the GUI, that's probably a much better way of doing it.


26

I think all batteries can explode. The question is if Linux (an operating system using the Linux kernel) will generate more heat or not. With good use of the fan (equally good use of the fan as other operating systems might employ), the cooling should be equal or better, thus resulting in a similar (or perhaps even reduced) risk of battery explosion. There ...


13

Here's a small script that checks for the battery level and calls a custom command, here pm-hibernate, in case the battery level is below a certain threshold. #!/bin/sh ########################################################################### # # Usage: system-low-battery # # Checks if the battery level is low. If “low_threshold” is exceeded # a system ...


11

If I want to disable my GUIs completely to save battery life, how would I proceed? You can just disable your Display Manager (be it kde, lightdm, gdm, etc.) to run at boot, just run depending of your system: sudo update-rc.d gdm remove sudo update-rc.d kdm remove sudo update-rc.d lightdm remove With this you don't have to stop the desktop manager after ...


11

Use: sudo dmidecode -t 22 from dmidecode manual: DMI TYPES The SMBIOS specification defines the following DMI types: Type Information ──────────────────────────────────────── 0 BIOS . . 21 Built-in Pointing Device 22 Portable Battery 23 System Reset . ...


11

I'm pretty sure that an OS has no capabilities to destroy a battery (be it Linux OS, Windows, etc.). A malfunctioning program (and not Linux by itself) can overload a laptop/PC up to the point that, for example, it can enter CPU thermal protection. But a fresh Linux install will not damage any hardware (if it does, than something is terribly wrong with ...


10

Newer Lenovo ThinkPads (such as my E540) are not compatible with tp_smapi-dkms. Fortunately I found that the TLP utility can use either of two different modules -- the tp_smapi OR the thinkpad_acpi DKMS modules -- to communicate the thresholds to the battery. Nowadays TLP is available via standard Ubuntu or Debian repositories. (Though you may benefit from ...


8

Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension ...


8

Is there something inherent to Linux operating systems that makes them poor managers of battery power by default? No [but see my first comment below]. Note it is used on a wide range of low power devices where it is not even possible to run Windows. The battery can't be magically drained, so if it is happening at an unusual rate, it could be that you have ...


7

UEFI has nothing to do with power management. ACPI manages power. UEFI indicates modern firmware than BIOS and newer platform, thus improved power efficiency. This might be a correlation. The PM subsystem is different from UEFI. Linux includes a whole range of power management functionalities, though unrelated to UEFI, like cpufreq, intel_pstate, pcie_aspm, ...


7

re: hdgarrood 's answer, setting cron to run notify-send actually turned out to be painfully finicky. (I think crontab -e does persist across reboots by default, fortunately). I followed several guides, I'm not sure what exactly fixed it in the end, but here is my full setup for running the checker every 5 minutes: $ crontab -e */5 * * * * sh /home/nrw/....


7

I don't know why you're looking for corroborating evidence from the system, when you have solid empirical evidence. The battery won't hold a charge. Period, end of story. I'd be happier if I saw a high charge cycle count. Lithium ion isn't good for more than about 500 charge cycles. Another datum, which won't appear in the places you've been looking, is ...


6

You need to install tp_smapi-dkms, just do apt-get install tp_smapi-dkms When finished, use lsmod | grep tp_smapi to check if module is loaded, to adjust the charge thresholds, do something like this echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh echo 60 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh Add these lines to /etc/...


6

I do now run the following: $ crontab -e */5 * * * * /home/<my username>/bin/checkLowBattery $ cat /home/<my username>/bin/checkLowBattery #!/bin/bash POWERSUPPLY="/sys/class/power_supply/ACAD/online" # could be different on your system! TOO_LOW=20 # how low is too low? NOT_CHARGING="0" ICON="/usr/share/icons/ubuntu-mono-dark/status/24/battery-...


6

Instead of hacking your own scripts and if you are using Ubuntu as the tag suggests, you could just install the upower package. It should be available on all Debian derivatives including Ubuntu. By default it comes with a configuration in /etc/UPower/UPower.conf which activates hybrid sleep once the battery level reaches critical values. The default for the ...


6

push(){ shuttle push note Chrome \ "Aurora: $1" \ "Battery is at $percent percent" } full=0 while percent=$(acpi | awk '{ print $4}' | sed 's/[,%]//g') do case $percent:$full in (100:1) ;; (100:0) full=1 push 'Battery charged';; (?:*|1?:*|20:*) full=0 ...


5

You can also check the battery health by using the inxi tool with this command : $ ./inxi -Bxxx Battery: ID-1: BAT0 charge: 39.5 Wh condition: 40.3/47.5 Wh (85%) volts: 10.8/10.8 model: PA5109U-1BRS type: Li-ion serial: FA80 status: Discharging and check the condition value.


5

There's (out-of-tree) module called tp_smapi, which provides access to (amongst others) access to the battery-related functions of the embedded controller. This allows you to do things like setting the start/stop charging thresholds, charge-inhibition timeout and also force discharge of a battery. Most distributions have a tp_smapi package, providing the ...


5

I'm sorry but the question is wrong! It isn't whether a Linux laptop battery can explode, but whether any laptop's battery could explode. The latter question is indeed correct and, depending on what was done, how it was recharged and what was done to it, yes depending on the situation, it is unfortunately possible that a laptop's battery can explode just ...


5

The Smart Battery Specification (SBS) bus is not directly accessible from the OS. It is however, possible to communicate directly with the battery via a USB-I2C adapter connected directly to the battery pins. EDIT: https://media.blackhat.com/bh-us-11/Miller/BH_US_11_Miller_Battery_Firmware_Public_WP.pdf EDIT 2: I personally managed to talk directly to the ...


5

No, when the system goes into hibernation or suspend mode, all user-level activity is suspended and will not resume until the system has left that mode. It is not possible to keep a script running (performing actions) during hibernation or suspension. Related Ask Ubuntu question regarding "hybrid suspension" and "suspend to both RAM and disk": How do I use ...


4

Since you're apparently running Cinnamon, just install Battery Applet with Monitoring and Shutdown (BAMS). Right-click on a panel → + Add Applets to the Panel → Available applets (online), type 'BAMS' in the search widget, and install and configure it. It's not the flashiest, but so far it's already alerted me when I had my laptop unwittingly unplugged.


4

If you're using KDE SC as desktop environment, just do this: Open System Settings Go to Application and System Notifications (Section: Common Appearance and Behavior) If not already selected, choose Manage Notifications from the list on the left side Select Power Management System from the Event source drop-down menu Click on the list entry Charge Complete ...


4

The presence of battery information in /sys/class/power_supply is a reliable indicator that the system supports a battery, and it's a standard Linux feature, but it won't always be called the same thing. Yours is called BAT1. I am looking at one here that is called battery. Also, not all entries in /sys/class/power_supply are batteries. Look for all files ...


4

There is no way that the OS can cause the batteries to explode. Battery charging is handled by the hardware. That being said, it's possible for any lithium batteries to explode.


4

These are acpi names (4 character, upper case...) BAT0 is the first battery, the second if you had one would be BAT1. ADP0 is the first ac-ADaPter.


Only top voted, non community-wiki answers of a minimum length are eligible