My X1 Carbon battery just died without any warning.

On my second notebook (running Windows), I got warnings a few weeks ago that the battery is malfunctioned and needs replacement. And when the battery died, I just disabled the battery from the Device Manager.

Is there a way to do the same? I mean to disable the battery completely so I don't see any battery on my navbar (plugged in, not charging)

  • You may try this – Marmayogi May 16 at 12:39
  • This one is to temporary disable the battery for servicing the laptop. – Faheem May 16 at 16:34

Gnome settings

Actualy it should be possible to disable it by setting:

gsettings set org.gnome.settings-daemon.plugins.power active false

but for some reason it doesn't work anymore.

GNOME Shell extensions

However, there are GNOME Shell extensions that you may try to workaround it.

  • Icon Hider - may help you remove parts of gnome panel, but the battery icon is probably a part of aggregateMenu, so removing it will also remove whole power/settings menu
  • Extend Panel Menu - but with this exention you can split aggregateMenu into separate icons and then use extension's setting to disable one of them

Edit: beware, I found one of these extensions conflicting with my Ubuntu setup. I had to remove them because my Gnome desktop wasn't loading (I had only black screen with just cursor on it). In case it happens switch to anoher TTY, log in and type:

cd .local/share
mv gnome-shell gnome-shell.bak

then reboot

Pretending you are not on laptop

There's a APT package called laptop-detect.

This package provides a simple shell script which attempts to determine whether it is being run on a laptop (or similar portable machine). It is mainly useful for installers.

While runing this script in debug mode:

laptop-detect -D

it brings the idea of tricking GNOME that you're not on a laptop.

It might be useful if you want to work on AC-only, with i.e. disassembled battery.

I won't tell you how to do this, but you might want to try to figure it out on your own, based on laptop-detect output.

One thing is for example /sbin/modprobe battery. So first step will be to blacklist this module with modprobe config.

Another thing is /sys/devices/virtual/dmi/id/chassis_type, but it's more tricky, because it's related to Linux kernel and changing this value may even require changing its source code somwhere in drivers/firmware/dmi-id.c. It's rather something for hardcore linux users ;)

Other places related to laptop battery (for the sake of google-searches):

  • /sys/class/power_supply
  • /proc/acpi/battery
  • /proc/apm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.