This repository contains a systemd service for setting the battery charge control end threshold on the ASUS VivoBook 15 X509DA model running Ubuntu 22.04 LTS. The purpose is to automatically configure the battery threshold when the system starts.
-
Clone the repository to your ASUS VivoBook 15 X509DA running Ubuntu 22.04 LTS:
git clone https://github.com/mrankitvish/vivobook-x509da-battery-threshold-setter.git cd vivobook-x509da-battery-threshold-setter
-
Copy the systemd service file to the appropriate location:
sudo cp battery_threshold.service /etc/systemd/system/
-
Reload systemd:
sudo systemctl daemon-reload
-
Enable the service to start on boot:
sudo systemctl enable battery_threshold.service
-
Start the service:
sudo systemctl start battery_threshold.service
Edit the ExecStart
line in the battery_threshold.service
file to set your desired battery charge control end threshold:
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo "80" | tee /sys/class/power_supply/BAT0/charge_control_end_threshold'
RemainAfterExit=yes