Skip to content

Instantly share code, notes, and snippets.

@evansd
Created June 12, 2016 10:52
Show Gist options
  • Save evansd/42899ab9a9117b5a5d1ade5352e647e9 to your computer and use it in GitHub Desktop.
Save evansd/42899ab9a9117b5a5d1ade5352e647e9 to your computer and use it in GitHub Desktop.
Thinkpad Battery Management Setup
sudo add-apt-repository ppa:morgwai/tpbat
sudo apt update
sudo apt install tpacpi-bat
# Start charging at 40%, stop charging at 80%
echo '[Unit]
Description=sets battery thresholds
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tpacpi-bat -s ST 0 40
ExecStart=/usr/bin/tpacpi-bat -s SP 0 80
ExecStop=/usr/bin/tpacpi-bat -s ST 0 0
ExecStop=/usr/bin/tpacpi-bat -s SP 0 0
[Install]
WantedBy=multi-user.target' \
| sudo tee /etc/systemd/system/tpacpi.service
sudo systemctl enable tpacpi.service
sudo systemctl start tpacpi.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment