Can Gnome limit battery charging?

Actually I have discovered a vendor-specific way to do this. I found that there’s an LG kernel driver that exposes this - and other - features and I found the EOS kernel has it. So I simply created this systemd service to run at boot:

$ cat /etc/systemd/system/lg-battery.service
[Unit]
Description=LG Gram battery charge threshold service

[Service]
ExecStart=/usr/local/bin/lg-battery-charge.sh

[Install]
WantedBy=multi-user.target

All the script does is:

$ cat /usr/local/bin/lg-battery-charge.sh 
#!/bin/sh

BT=80

echo $BT > /sys/devices/platform/lg-laptop/battery_care_limit && \
  ( echo "Set battery charge threshold to $BT..." ; exit 0 ) || \
  ( echo "Failed to configure battery charge threshold!" ; exit 1 )

I’ve discharged to 75% and am simply waiting to confirm that it will stop charging at 80% but it seems like this is going to work.

EDIT: Seems like it worked, settings even shows “Not charging” status with a charge level of 80%. Waited a while to make sure it’s truly not charging and the level has remained 80%.

Really appreciate whoever wrote this driver. It even lets you control reader mode, USB port charging, fan control…

@Epictetux Appreciate your suggestion as well. Will stick with this for now.

2 Likes